diff --git a/.agents/hooks/enforce-git-hygiene.sh b/.agents/hooks/enforce-git-hygiene.sh new file mode 100755 index 000000000000..d125e2835bea --- /dev/null +++ b/.agents/hooks/enforce-git-hygiene.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# PreToolUse hook for the Bash tool. +# Blocks dangerous git patterns that cause CI failures. +set -euo pipefail + +input=$(cat) +command=$(echo "$input" | jq -r '.tool_input.command // empty') + +if [ -z "$command" ]; then + exit 0 +fi + +# Block 'git add .' / 'git add -A' / 'git add --all' +# These stage package-lock.json and other generated files. +if echo "$command" | grep -qE 'git\s+add\s+(\.|--all|-A)(\s|$|;)'; then + echo "BLOCKED: do not use 'git add .' / 'git add -A' / 'git add --all'. Stage files explicitly by name." >&2 + exit 2 +fi + +exit 0 diff --git a/.agents/hooks/enforce-vendored.sh b/.agents/hooks/enforce-vendored.sh new file mode 100755 index 000000000000..d7404d7c66e2 --- /dev/null +++ b/.agents/hooks/enforce-vendored.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# PreToolUse hook for Edit and Write tools. +# Blocks edits to vendored content that must be fixed upstream. +set -euo pipefail + +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty') + +if [ -z "$file_path" ]; then + exit 0 +fi + +# Block edits to vendored Hugo modules. +if echo "$file_path" | grep -qE '/_vendor/'; then + echo "BLOCKED: _vendor/ is vendored from upstream Hugo modules. Fix in the source repo instead." >&2 + exit 2 +fi + +# Block edits to vendored CLI reference data. +if echo "$file_path" | grep -qE '/data/cli/'; then + echo "BLOCKED: data/cli/ is generated from upstream repos (docker/cli, docker/buildx, etc.). Fix in the source repo instead." >&2 + exit 2 +fi + +exit 0 diff --git a/.agents/settings.json b/.agents/settings.json new file mode 100644 index 000000000000..f9a81de3a2e3 --- /dev/null +++ b/.agents/settings.json @@ -0,0 +1,27 @@ +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "bash .agents/hooks/enforce-vendored.sh" + } + ], + "description": "Block edits to vendored content (_vendor/, data/cli/)" + }, + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "if": "Bash(git add *)", + "command": "bash .agents/hooks/enforce-git-hygiene.sh" + } + ], + "description": "Block git add . and dangerous patterns" + } + ] + } +} diff --git a/.agents/skills/agent-readiness-audit/SKILL.md b/.agents/skills/agent-readiness-audit/SKILL.md new file mode 100644 index 000000000000..afb2e56a3add --- /dev/null +++ b/.agents/skills/agent-readiness-audit/SKILL.md @@ -0,0 +1,228 @@ +--- +name: agent-readiness-audit +description: > + Audit a documentation site for agent-friendliness: discovery, markdown + delivery, crawlability, semantic structure, machine-readable surfaces, + and content legibility. Use when asked to assess docs.docker.com or any + docs site for AI/agent readiness, produce a scored report, compare with + external scanners, or generate a remediation list. Triggers on: + "audit docs for agent readiness", "how agent-friendly is docs.docker.com", + "score our docs for AI agents", "review llms.txt / markdown / crawlability", + "create an agent-readiness remediation plan". +argument-hint: "" +--- + +# Agent Readiness Audit + +Audit the live site, not the source tree alone. Prefer the same fetch path +an external agent would use in the wild: direct HTTP requests, sitemap +sampling, and page-level inspection. + +Do not reduce the result to a homepage-only scan or a binary checklist. + +## 1. Set scope + +Use `$ARGUMENTS` as the base URL when provided. Otherwise infer the base +URL from context and state the assumption. + +Decide whether the host being audited is: + +- a docs-only host +- an app/tool host +- a mixed host + +This matters for optional checks such as MCP, plugin manifests, or other +tool discovery files. Do not penalize a docs-only host for missing +tooling manifests that belong on a separate service. + +For `docs.docker.com`, treat the public docs host as docs-only. Docker's +MCP server is published separately, so missing MCP files on the docs host +should be reported as `N/A`, not as a failure. + +## 2. Gather sitewide signals + +Always check these resources first: + +- `/llms.txt` +- `/llms-full.txt` +- `/robots.txt` +- `/sitemap.xml` + +Only check host-level tool manifests when the host is an app/tool host, +mixed host, or explicitly advertises them: + +- `/.well-known/ai-plugin.json` +- `/.well-known/agent.json` +- `/.well-known/agents.json` + +Use the bundled script for a baseline: + +```bash +bash .agents/skills/agent-readiness-audit/scripts/baseline-probes.sh \ + "$ARGUMENTS" +``` + +The script produces baseline evidence only. You still need to interpret +what matters for a docs property and score it with the rubric. + +For docs-only hosts, you may skip tool-manifest probes to reduce noise: + +```bash +CHECK_TOOL_MANIFESTS=0 \ + bash .agents/skills/agent-readiness-audit/scripts/baseline-probes.sh \ + "$ARGUMENTS" +``` + +## 3. Sample representative pages + +Use the sitemap when available. Do not rely on the homepage alone. + +If `llms.txt` exists, sample some URLs from it as well. This helps catch +stale or misleading discovery surfaces that a sitemap-only sample would miss. + +Sample at least 12 pages when the site is large enough, and cover multiple +page types: + +- homepage or docs landing page +- section landing pages +- task guides +- product manuals +- reference or API pages +- tutorial or learning pages + +If the sitemap is missing or unusable, discover pages through internal +links and note the lower confidence. + +If the site has distinct delivery patterns, sample each one. For example: + +- normal content pages +- generated reference pages +- versioned docs +- localized docs + +## 4. Run fetch-path checks on each sample + +For each sampled page, verify: + +- HTML fetch status, content type, and final URL +- `Accept: text/markdown` behavior +- direct markdown route behavior such as `.md` or another stable path +- page-level markdown alternate links and whether they actually resolve +- whether page actions such as "Open Markdown" agree with the working route +- whether the HTML title or H1 matches the markdown H1 closely enough for + retrieval parity +- whether main content is present in the initial HTML +- redirect chain length and canonical URL consistency +- obvious chrome/noise in the markdown response + +Do not assume a `.md` mirror exists just because another site uses one. +Verify the actual markdown path the site exposes. + +Treat these as separate signals: + +- negotiated markdown works +- a stable direct markdown URL works +- the page advertises the correct markdown URL + +If the page advertises dead markdown alternates but a working markdown route +exists, do not fail markdown delivery outright. Score it as a discoverability +and consistency problem instead. + +For API or generated reference pages, also verify whether a machine-readable +asset such as OpenAPI YAML is directly linked and fetchable. + +## 5. Judge structure and legibility + +Measure structural signals: + +- exactly one `h1` +- sane heading hierarchy +- `main` and `article` presence where appropriate +- canonical tags +- JSON-LD or breadcrumb structured data +- stable anchors and deep-linkable headings + +Also make a qualitative judgment about agent legibility: + +- markdown strips site chrome cleanly +- headings are specific and task-oriented +- code blocks stay intelligible without client-side JS +- the page is not dominated by banners, injected chat, or nav noise + +Measure code block labeling explicitly when code samples are common. A page +type with many untagged fenced blocks should lose points even if the prose is +otherwise clean. + +For page types that intentionally render interactive UIs with JavaScript, +judge them separately from normal docs pages. If the HTML shell is thin, +check whether the page still provides: + +- a fetchable markdown summary +- a directly linked machine-readable asset +- a usable non-JS fallback + +## 6. Score with the rubric + +Use [references/rubric.md](references/rubric.md). + +Rules: + +- score only what you verified +- mark non-applicable checks as `N/A` +- normalize the final score against applicable points only +- do not let optional manifest checks dominate the grade + +Apply the foundational caps from the rubric. A site with broken discovery +or broken markdown delivery should not earn a high grade because it has +clean metadata. + +Do not average away a weak page type. If one major page type, such as API +reference, is materially worse than the rest of the corpus, call it out as +the weakest segment and reflect it in the category notes. + +## 7. Compare with external scanners when useful + +If external scanner results are available, compare them to your live +findings. Treat them as secondary evidence. + +If a scanner and the live fetch disagree: + +- trust the live fetch +- report the mismatch explicitly +- explain whether the scanner is testing a different assumption + +## 8. Produce a remediation list + +Turn findings into a short backlog: + +- `P0`: fetchability or discovery blockers +- `P1`: recurring structural or parity issues +- `P2`: polish, optional manifests, or low-impact enhancements + +For each remediation, include: + +- the failing signal +- why it matters to agents +- a concrete fix +- whether it is sitewide or page-type-specific + +## 9. Report in a stable format + +Use [references/report-template.md](references/report-template.md). + +Always include: + +- overall score and grade +- confidence level +- sampled URLs or sample strategy +- category scores +- highest-priority findings +- remediation backlog + +## Notes + +- Favor docs-delivery checks over marketing-site heuristics. +- Do not fail a docs host for lacking MCP or plugin manifests unless the + host itself is meant to expose tools. +- Treat raw byte size as supporting evidence, not as a primary scoring input. +- Prefer short evidence excerpts and commands over long copied page text. diff --git a/.agents/skills/agent-readiness-audit/references/report-template.md b/.agents/skills/agent-readiness-audit/references/report-template.md new file mode 100644 index 000000000000..e1592eb5054b --- /dev/null +++ b/.agents/skills/agent-readiness-audit/references/report-template.md @@ -0,0 +1,63 @@ +# Agent Readiness Report Template + +Use this structure for final audit output. + +```markdown +## Agent Readiness Audit + +**Site:** +**Date:** +**Overall score:** /100 +**Grade:** +**Confidence:** + +### Summary + +<2-4 sentence verdict focused on what an external agent can actually +discover, fetch, and interpret on this site.> + +### Category Scores + +| Category | Score | Notes | +| --- | ---: | --- | +| Discovery and policy | / | | +| Retrieval and markdown delivery | / | | +| Structure and semantics | / | | +| Crawlability and delivery behavior | / | | +| Machine-readable surfaces | / | | +| Content legibility | / | | + +### Sample + +- Sample strategy: +- Sampled pages: +- Page types covered: +- Weakest page type: + +### Findings + +- `P0`: +- `P1`: +- `P2`: + +### Remediation + +- `P0`: , because +- `P1`: , because +- `P2`: , because + +### Evidence + +- Sitewide checks: +- Fetch-path checks: +- Structural checks:

+- Code block checks: +- Scanner comparison: +``` + +## Notes + +- Keep the summary short and outcome-oriented. +- Findings should refer to concrete URLs or page types. +- If a criterion is `N/A`, say why instead of leaving it blank. diff --git a/.agents/skills/agent-readiness-audit/references/rubric.md b/.agents/skills/agent-readiness-audit/references/rubric.md new file mode 100644 index 000000000000..51f089ed6135 --- /dev/null +++ b/.agents/skills/agent-readiness-audit/references/rubric.md @@ -0,0 +1,129 @@ +# Agent Readiness Rubric + +Score the site on a 100-point scale before normalization. If a criterion is +not applicable, remove its points from the denominator instead of treating +it as failed. + +## Grade bands + +- `A`: 90-100 +- `B`: 80-89 +- `C`: 65-79 +- `D`: 50-64 +- `F`: below 50 + +## Confidence levels + +- `High`: sitemap available and at least 12 sampled pages across at least + four page types +- `Medium`: six to 11 sampled pages, or weaker coverage of page types +- `Low`: fewer than six sampled pages, or homepage-biased sampling + +## Foundational caps + +Apply these after computing the raw score: + +- No `sitemap.xml` and no `llms.txt`: maximum grade `C` +- Markdown delivery fails on most sampled pages and no usable alternate + markdown path exists: maximum grade `D` +- Main content is missing from initial HTML on more than 25% of sampled + pages: maximum grade `D` +- `robots.txt` blocks broad crawl access to the docs site and the block is + not clearly intentional: maximum grade `F` + +Optional manifest gaps alone must not drop a docs-only host below `B`. + +## Categories + +### 1. Discovery and policy - 15 points + +- `5` `llms.txt` exists, is fetchable, and is useful for agent discovery +- `4` `sitemap.xml` exists and includes the main docs corpus +- `4` `robots.txt` is accessible and does not unintentionally block major + crawl agents or search agents +- `2` curated bulk-discovery aid exists, such as `llms-full.txt` or an + equivalent machine-readable catalog + +When `llms.txt` exists, sample some URLs from it. Stale or misleading +discovery links should reduce this category even if the file itself exists. + +### 2. Retrieval and markdown delivery - 25 points + +- `8` `Accept: text/markdown` works on sampled pages or an equivalent + negotiated markdown response exists +- `5` a stable direct markdown route works on sampled pages +- `5` page-level markdown hints, alternates, or UI actions point to a + working markdown URL +- `4` markdown responses strip navigation chrome and preserve headings, + links, and code blocks cleanly +- `3` HTML and markdown stay in parity across the sampled set + +### 3. Structure and semantics - 20 points + +- `6` sampled pages have one `h1` and a mostly consistent heading hierarchy +- `5` `main` or `article` marks the primary content and the content is + present in the initial HTML +- `4` canonical tags and stable final URLs are correct +- `3` structured data such as breadcrumbs or article metadata exists where + appropriate +- `2` headings expose stable anchors or deep-link targets, and the HTML title + or H1 stays reasonably aligned with the markdown H1 + +### 4. Crawlability and delivery behavior - 15 points + +- `5` crawl directives are sane for a public docs property +- `4` the site does not depend on client-side rendering to expose core + content +- `3` cache and freshness signals are reasonable for bots, such as + `ETag`, `Last-Modified`, or useful cache headers +- `3` redirect chains are short and predictable + +### 5. Machine-readable surfaces - 10 points + +- `4` API or reference sections expose OpenAPI, schema, or downloadable + machine-readable assets where relevant +- `3` pages with interactive JavaScript reference UIs still provide a usable + non-JS fallback such as markdown, YAML, or another directly linked asset +- `3` tool manifests such as MCP, plugin, or agent descriptors exist only + when the audited host is actually meant to expose tools + +### 6. Content legibility - 15 points + +- `5` markdown is clean and low-noise rather than a dump of site chrome +- `4` headings and section intros are specific enough for retrieval and + chunking +- `3` fenced code blocks are mostly language-tagged and remain copyable and + interpretable +- `3` repeated banners, chat chrome, consent overlays, or other boilerplate + do not overwhelm the main content + +## Scoring guidance + +Use the full category only when the signal is consistently good across the +sample. Partial credit is expected. + +Examples: + +- A sitewide `llms.txt` that exists but is stale or too shallow may earn + partial credit rather than full credit. +- If markdown works only on some page types, score that criterion based on + observed coverage instead of failing or passing it outright. +- If a working markdown route exists but the page advertises a dead + alternate URL, deduct in markdown discoverability rather than in raw + markdown availability. +- If `llms.txt` exists but points to stale, broken, or inconsistent paths, + deduct in discovery rather than in core fetchability. +- If tool manifests are irrelevant to the host, mark them `N/A`. +- If a major page type is weaker than the rest of the site, note that + explicitly instead of letting stronger page types hide it in the average. + +## Reporting guidance + +For every category, include one line that explains the score: + +- what was tested +- what passed +- what limited the score + +Use evidence from live fetches. Do not score from assumptions about the +framework or source repository. diff --git a/.agents/skills/agent-readiness-audit/scripts/baseline-probes.sh b/.agents/skills/agent-readiness-audit/scripts/baseline-probes.sh new file mode 100755 index 000000000000..50875aee068d --- /dev/null +++ b/.agents/skills/agent-readiness-audit/scripts/baseline-probes.sh @@ -0,0 +1,287 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ $# -lt 1 ]]; then + echo "usage: $0 [sample-url ...]" >&2 + exit 1 +fi + +if ! command -v curl >/dev/null 2>&1; then + echo "curl is required" >&2 + exit 1 +fi + +if ! command -v rg >/dev/null 2>&1; then + echo "rg is required" >&2 + exit 1 +fi + +BASE_URL="${1%/}" +shift || true +SAMPLE_SIZE="${SAMPLE_SIZE:-12}" +LLMS_SAMPLE_SIZE="${LLMS_SAMPLE_SIZE:-2}" +CHECK_TOOL_MANIFESTS="${CHECK_TOOL_MANIFESTS:-1}" +TMPDIR="$(mktemp -d)" +trap 'rm -rf "$TMPDIR"' EXIT + +count_matches() { + local pattern="$1" + local file="$2" + rg -o "$pattern" "$file" 2>/dev/null | wc -l | tr -d ' ' || true +} + +header_value() { + local header_file="$1" + local name="$2" + awk -F': ' -v target="$name" ' + tolower($1) == tolower(target) { value = $2 } + END { + gsub(/\r/, "", value) + print value + } + ' "$header_file" +} + +normalize_text() { + printf '%s' "$1" \ + | tr '[:upper:]' '[:lower:]' \ + | sed -E 's/[[:space:]]+/ /g; s/^[[:space:]]+//; s/[[:space:]]+$//; s/ \| docker docs$//' +} + +code_fence_stats() { + local file="$1" + awk ' + BEGIN { in_block = 0; total = 0; tagged = 0 } + /^```/ { + line = $0 + sub(/^```[[:space:]]*/, "", line) + if (!in_block) { + total++ + if (line != "") { + tagged++ + } + in_block = 1 + } else { + in_block = 0 + } + } + END { + printf "%d\t%d\n", total, tagged + } + ' "$file" +} + +resource_probe() { + local url="$1" + local label="$2" + local body="$TMPDIR/resource-body" + local headers="$TMPDIR/resource-headers" + local status + local content_type + local bytes + + status="$(curl -sS -L -o "$body" -D "$headers" -w '%{http_code}' "$url" || true)" + content_type="$(header_value "$headers" "content-type")" + bytes="$(wc -c < "$body" | tr -d ' ')" + + printf '%s\t%s\t%s\t%s\t%s\n' "$label" "$url" "$status" "$content_type" "$bytes" +} + +page_probe() { + local url="$1" + local html="$TMPDIR/page-html" + local html_headers="$TMPDIR/page-html-headers" + local md="$TMPDIR/page-md" + local md_headers="$TMPDIR/page-md-headers" + local direct_md="$TMPDIR/page-direct-md" + local direct_md_headers="$TMPDIR/page-direct-md-headers" + local alt_md="$TMPDIR/page-alt-md" + local alt_md_headers="$TMPDIR/page-alt-md-headers" + local status + local content_type + local final_url + local h1_count + local main_count + local article_count + local canonical_count + local jsonld_count + local md_alt + local md_alt_url + local direct_md_url + local html_title + local html_h1 + local md_h1 + local md_status + local md_content_type + local md_bytes + local direct_md_status + local direct_md_content_type + local md_alt_status="na" + local md_alt_content_type="na" + local title_md_h1_match="no" + local html_h1_md_h1_match="no" + local code_blocks_total + local code_blocks_tagged + + status="$( + curl -sS -L -o "$html" -D "$html_headers" \ + -w '%{http_code}\t%{url_effective}' "$url" || true + )" + content_type="$(header_value "$html_headers" "content-type")" + final_url="${status#*$'\t'}" + status="${status%%$'\t'*}" + + h1_count="$(count_matches ']' "$html")" + main_count="$(count_matches ']' "$html")" + article_count="$(count_matches ']' "$html")" + canonical_count="$(count_matches 'rel=canonical' "$html")" + jsonld_count="$(count_matches 'application/ld\+json' "$html")" + md_alt="$( + rg -o 'type=text/markdown href=[^ >]+|href=[^ >]+[^>]*type=text/markdown' \ + "$html" -m 1 2>/dev/null | sed -E 's/.*href=([^ >]+).*/\1/' || true + )" + + md_status="$(curl -sS -L -H 'Accept: text/markdown' -o "$md" -D "$md_headers" -w '%{http_code}' "$url" || true)" + md_content_type="$(header_value "$md_headers" "content-type")" + md_bytes="$(wc -c < "$md" | tr -d ' ')" + direct_md_url="$(printf '%s' "$final_url" | sed 's#/$##').md" + direct_md_status="$(curl -sS -L -o "$direct_md" -D "$direct_md_headers" -w '%{http_code}' "$direct_md_url" || true)" + direct_md_content_type="$(header_value "$direct_md_headers" "content-type")" + html_title="$(rg -o '[^<]+' "$html" -m 1 2>/dev/null | sed 's/<title>//' || true)" + html_h1="$(rg -o '<h1[^>]*>[^<]+' "$html" -m 1 2>/dev/null | sed -E 's/<h1[^>]*>//' || true)" + md_h1="$(awk '/^# / { sub(/^# /, ""); print; exit }' "$md" || true)" + + if [[ -n "$html_title" && -n "$md_h1" ]]; then + if [[ "$(normalize_text "$html_title")" == "$(normalize_text "$md_h1")" ]]; then + title_md_h1_match="yes" + fi + fi + + if [[ -n "$html_h1" && -n "$md_h1" ]]; then + if [[ "$(normalize_text "$html_h1")" == "$(normalize_text "$md_h1")" ]]; then + html_h1_md_h1_match="yes" + fi + fi + + IFS=$'\t' read -r code_blocks_total code_blocks_tagged < <(code_fence_stats "$md") + + if [[ -n "$md_alt" ]]; then + if [[ "$md_alt" =~ ^https?:// ]]; then + md_alt_url="$md_alt" + elif [[ "$md_alt" == /* ]]; then + md_alt_url="${BASE_URL}${md_alt}" + else + md_alt_url="${BASE_URL}/${md_alt}" + fi + md_alt_status="$(curl -sS -L -o "$alt_md" -D "$alt_md_headers" -w '%{http_code}' "$md_alt_url" || true)" + md_alt_content_type="$(header_value "$alt_md_headers" "content-type")" + else + md_alt_url="na" + fi + + printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' \ + "$url" \ + "$status" \ + "$content_type" \ + "$final_url" \ + "$h1_count" \ + "$main_count" \ + "$article_count" \ + "$canonical_count" \ + "$jsonld_count" \ + "$md_status" \ + "$md_content_type" \ + "$md_bytes" \ + "$direct_md_url" \ + "$direct_md_status" \ + "$direct_md_content_type" \ + "$md_alt_url" \ + "$md_alt_status" \ + "$md_alt_content_type" \ + "$title_md_h1_match" \ + "$html_h1_md_h1_match" \ + "$code_blocks_total" \ + "$code_blocks_tagged" +} + +llms_urls() { + local llms="$TMPDIR/llms-sample.txt" + local llms_status + + llms_status="$(curl -sS -L -o "$llms" -w '%{http_code}' "$BASE_URL/llms.txt" || true)" + if [[ "$llms_status" == "200" ]]; then + rg -o '\(https?://[^)]+\)' "$llms" 2>/dev/null \ + | tr -d '()' \ + | rg "^${BASE_URL//./\\.}" \ + | rg -v '/404\.html$|/search/?$|\.xml$|\.txt$' \ + | awk -v limit="$LLMS_SAMPLE_SIZE" '!seen[$0]++ && NR <= limit { print }' + fi +} + +sitemap_urls() { + local sitemap="$TMPDIR/sitemap.xml" + local sitemap_status + + sitemap_status="$(curl -sS -L -o "$sitemap" -w '%{http_code}' "$BASE_URL/sitemap.xml" || true)" + if [[ "$sitemap_status" == "200" ]]; then + rg -o '<loc>[^<]+' "$sitemap" \ + | sed 's/<loc>//' \ + | rg "^${BASE_URL//./\\.}" \ + | rg -v '/404\.html$|/search/?$|\.xml$|\.txt$' \ + | awk '!seen[$0]++ { print }' + fi +} + +sample_urls() { + if [[ $# -gt 0 ]]; then + printf '%s\n' "$@" + return + fi + + local sample_file="$TMPDIR/sampled-urls.txt" + + { + llms_urls + sitemap_urls + } | awk -v limit="$SAMPLE_SIZE" ' + !seen[$0]++ { + print + count++ + if (count >= limit) { + exit + } + } + ' > "$sample_file" + + if [[ ! -s "$sample_file" ]]; then + printf '%s/\n' "$BASE_URL" + else + cat "$sample_file" + fi +} + +printf 'META\tbase-url\t%s\n' "$BASE_URL" +if [[ $# -gt 0 ]]; then + printf 'META\tsample-source\texplicit\n' +else + printf 'META\tsample-source\tllms-and-sitemap-or-homepage\n' +fi +printf '\nSITEWIDE\n' +printf 'label\turl\tstatus\tcontent-type\tbytes\n' +resource_probe "$BASE_URL/llms.txt" "llms.txt" +resource_probe "$BASE_URL/llms-full.txt" "llms-full.txt" +resource_probe "$BASE_URL/robots.txt" "robots.txt" +resource_probe "$BASE_URL/sitemap.xml" "sitemap.xml" +if [[ "$CHECK_TOOL_MANIFESTS" == "1" ]]; then + resource_probe "$BASE_URL/.well-known/ai-plugin.json" "ai-plugin.json" + resource_probe "$BASE_URL/.well-known/agent.json" "agent.json" + resource_probe "$BASE_URL/.well-known/agents.json" "agents.json" +fi + +printf '\nPAGES\n' +printf 'url\tstatus\tcontent-type\tfinal-url\th1\tmain\tarticle\tcanonical\tjsonld\tmd-negotiate-status\tmd-negotiate-content-type\tmd-bytes\tmd-direct-url\tmd-direct-status\tmd-direct-content-type\tmd-alt-url\tmd-alt-status\tmd-alt-content-type\ttitle-md-h1-match\th1-md-h1-match\tcode-blocks-total\tcode-blocks-tagged\n' +while IFS= read -r page_url; do + [[ -z "$page_url" ]] && continue + page_probe "$page_url" +done < <(sample_urls "$@") diff --git a/.agents/skills/create-lab-guide/SKILL.md b/.agents/skills/create-lab-guide/SKILL.md new file mode 100644 index 000000000000..a1d559a026b5 --- /dev/null +++ b/.agents/skills/create-lab-guide/SKILL.md @@ -0,0 +1,115 @@ +--- +name: create-lab-guide +description: "Clone a dockersamples Labspace repo, extract learning objectives and module structure from labspace.yaml, and produce a Hugo guide page under content/guides/ with correct frontmatter, labspace-launch shortcode, and Docker docs style compliance. Use when asked to create a lab guide, write a Labspace page, add a Docker lab tutorial, migrate a lab to docs, or document a hands-on lab." +--- + +# Create Lab Guide + +Create a guide page for a Docker Labspace: clone the source repo, extract +structure from `labspace.yaml`, write the Hugo markdown page, and validate. + +## Inputs + +- **REPO_NAME**: GitHub repo in the `dockersamples` org (e.g. `labspace-ai-fundamentals`) + +## Step 1: Clone the labspace repo + +```bash +TMPDIR=$(mktemp -d) +git clone --depth 1 https://github.com/dockersamples/{REPO_NAME}.git "$TMPDIR/{REPO_NAME}" +``` + +## Step 2: Extract key information + +Read these files from the cloned repo: + +| File | Purpose | +|------|---------| +| `README.md` | Lab purpose and overview | +| `labspace/labspace.yaml` | Module structure and content paths | +| `labspace/*.md` | Module content (only files listed in `labspace.yaml`) | +| `.github/workflows/*.yml` | Published Compose file URL for the launch command | +| `compose.override.yaml` | Check for top-level `model` specs (triggers `model-download` param) | + +Extract: +1. A short description for the `description` and `summary` frontmatter fields. +2. Learning objectives from the module content. +3. Whether a model download is required (`compose.override.yaml` → top-level `model` key). + +## Step 3: Write the guide markdown + +Place the file at `content/guides/lab-{GUIDE_ID}.md`. + +```markdown +--- +title: "Lab: { Short title }" +linkTitle: "Lab: { Short title }" +description: | + A short description of the lab for SEO and social sharing. +summary: | + A short summary of the lab for the guides listing page. 2-3 lines. +keywords: AI, Docker, Model Runner, agentic apps, lab, labspace +aliases: # Include only for AI-related labs + - /labs/docker-for-ai/{REPO_NAME_WITHOUT_LABSPACE_PREFIX}/ +params: + tags: [ai, labs] + time: 20 minutes + resource_links: + - title: A resource link pointing to relevant documentation or code + url: /ai/model-runner/ + - title: Labspace repository + url: https://github.com/dockersamples/{REPO_NAME} +--- + +Short explanation of the lab and what it covers. + +## Launch the lab + +{{< labspace-launch image="dockersamples/{REPO_NAME}" >}} + +## What you'll learn + +By the end of this Labspace, you will have completed the following: + +- Objective #1 +- Objective #2 +- Objective #3 + +## Modules + +| # | Module | Description | +|---|--------|-------------| +| 1 | Module #1 | Description of module #1 | +| 2 | Module #2 | Description of module #2 | +| 3 | Module #3 | Description of module #3 | +``` + +Conditional rules: +- All lab guides **must** include `labs` in `params.tags`. +- AI-related labs: also add `ai` tag and an alias under `/labs/docker-for-ai/`. +- If a model download is required: add `model-download: true` to the `labspace-launch` shortcode. + +## Step 4: Apply Docker docs style rules + +Follow STYLE.md and COMPONENTS.md. Key rules: + +| Avoid | Use instead | +|-------|-------------| +| "we", "let's" | Imperative voice or "you" | +| "simply", "easily", "just" | Remove the hedge word | +| "allows you to" / "enables you to" | "lets you" or rephrase | +| "click" | "select" | +| Bold for emphasis / product names | Bold only for UI elements | +| "currently", "new", "recently" | Remove time-relative language | + +Use `console` as the language hint for shell blocks with `$` prompts. +Use contractions ("it's", "you're", "don't"). + +## Step 5: Validate + +1. Confirm frontmatter has `title`, `description`, `keywords`, and `params.tags` including `labs`. +2. Run `npx --no-install rumdl fmt <file>` to format. +3. Run `docker buildx bake lint vale` and fix any errors. +4. Re-read the file and verify: correct shortcode syntax, objectives match source content, modules match `labspace.yaml`, no vendored paths edited. + +Do not proceed to commit until validation passes. diff --git a/.agents/skills/create-pr/SKILL.md b/.agents/skills/create-pr/SKILL.md new file mode 100644 index 000000000000..2bec1eb3d360 --- /dev/null +++ b/.agents/skills/create-pr/SKILL.md @@ -0,0 +1,180 @@ +--- +name: create-pr +description: > + Push the current branch and create a pull request against docker/docs. + Use after changes are committed and reviewed. "create a PR", "submit the + fix", "open a pull request for this". +--- + +# Create PR + +Push the branch and create a properly structured pull request. + +## 1. Verify the branch + +Confirm you're on a dedicated branch, not the default branch: + +```bash +git branch --show-current # must not be main or master +``` + +If this returns `main` or `master`, stop. Create a branch and move your +commits onto it before continuing. + +Confirm commits exist and the working tree is clean: + +```bash +git log --oneline main..HEAD # confirm commits exist +git status --porcelain # must print nothing +``` + +If `git status --porcelain` prints anything, there are uncommitted or +unstaged changes. Stop and commit them — or unstage stray files like +`package-lock.json` — before opening a PR. Don't open a PR mid-edit. + +## 2. Push the branch + +Identify the remote that points at your fork. Inspect the remotes: + +```bash +git remote -v +``` + +If `origin` is your fork, use it. If `origin` points at canonical +`docker/docs` (the upstream), push to your separate fork remote instead — +never push the branch to `docker/docs` directly: + +```bash +FORK_REMOTE=origin # or the name of your fork remote if origin is upstream +git push -u "$FORK_REMOTE" <branch-name> +``` + +## 3. Create the PR + +Before creating a PR for an issue, check whether that issue already has an open +linked PR: + +```bash +gh api repos/docker/docs/issues/<issue-number>/timeline --paginate \ + --jq '.[] | select((.event=="cross-referenced" or .event=="connected" or .event=="referenced") and .source.issue.pull_request and .source.issue.state=="open") | {url: .source.issue.html_url, title: .source.issue.title}' +``` + +If this returns an open PR that addresses the same issue, stop. Don't open a +duplicate PR; report the existing PR instead. Only proceed if there is no open +linked PR, or if the existing PR clearly does not address the issue and you +explain why in the new PR body. + +Derive the fork owner dynamically from the same fork remote you pushed to: + +```bash +FORK_OWNER=$(git remote get-url "$FORK_REMOTE" | sed -E 's|.*[:/]([^/]+)/[^/]+(\.git)?$|\1|') +``` + +```bash +gh pr create --repo docker/docs \ + --head "${FORK_OWNER}:<branch-name>" \ + --title "<concise summary under 70 chars>" \ + --body "$(cat <<'EOF' +## Summary + +<1-2 sentences: what was wrong and what was changed> + +Closes #NNNN + +Generated by <active coding agent name> +EOF +)" +``` + +Prefix the title with the change type to match repo convention — `docs:` for +documentation changes (or another scope like `hub:` when appropriate), for +example `docs: fix broken link on install page`. + +Keep the body short. Reviewers need to know what changed and why — nothing +else. Do **not** add a "Test plan" section — documentation PRs don't need one. + +Use an accurate disclosure footer that names the active coding agent, for +example `Generated by Codex` or `Generated by Claude Code`. + +### Optional: Netlify preview entry path + +If the PR primarily edits a single page or a focused section of pages, add a +`@netlify` stanza to the PR body (for example, just below the Summary). This +sets the entry path for the Netlify deploy preview so reviewers land on the +edited page instead of the site root: + +```markdown +@netlify /desktop/setup/install/ +``` + +The stanza takes a single published URL path. Derive it from the source file +path: drop the `content/` prefix and `.md` suffix, strip the `/manuals` +segment, and add a trailing slash. For example, +`content/manuals/desktop/setup/install/mac-install.md` becomes +`/desktop/setup/install/mac-install/`. + +Only add this when the change is focused on one page or section. Skip it for +PRs that touch many unrelated pages — there is no useful single entry path. + +### Optional: Preview links + +When the change is focused, also add direct links to the deploy preview in the +PR body so reviewers can jump straight to the affected pages. The preview URL +embeds the PR number: + +``` +https://deploy-preview-<pr-number>--docsdocker.netlify.app/path/to/page/ +``` + +The PR number isn't known until `gh pr create` returns, so add these links +after creating the PR by updating the body: + +```bash +gh pr edit <pr-number> --repo docker/docs --body "..." +``` + +Use the same source-path-to-URL mapping as the `@netlify` stanza above. + +## 4. Apply labels and request review + +Use the Issues API for labels — `gh pr edit --add-label` silently fails: + +```bash +gh api repos/docker/docs/issues/<pr-number>/labels \ + --method POST \ + --field 'labels[]=status/review' +``` + +Request review: + +```bash +gh pr edit <pr-number> --repo docker/docs --add-reviewer docker/docs-team +``` + +Verify the reviewer was assigned: + +```bash +gh pr view <pr-number> --repo docker/docs --json reviewRequests \ + --jq '.reviewRequests[].slug' +``` + +If the team doesn't appear, use the API directly: + +```bash +gh api repos/docker/docs/pulls/<pr-number>/requested_reviewers \ + --method POST --field 'team_reviewers[]=docs-team' +``` + +## 5. Report + +Print the PR URL and current CI state: + +```bash +gh pr view <pr-number> --repo docker/docs --json url,state +gh pr checks <pr-number> --repo docker/docs --json name,state +``` + +## Notes + +- Always use `Closes #NNNN` (not "Fixes") for GitHub auto-close linkage +- One issue, one branch, one PR — never combine diff --git a/.agents/skills/curate-whats-new/SKILL.md b/.agents/skills/curate-whats-new/SKILL.md new file mode 100644 index 000000000000..fb9bd323906b --- /dev/null +++ b/.agents/skills/curate-whats-new/SKILL.md @@ -0,0 +1,101 @@ +--- +name: curate-whats-new +description: Curate noteworthy Docker launches from documentation pull requests merged during a requested period. Use when generating or reviewing data/whats-new.json, preparing the Docker Docs What's new timeline, or deciding which documented releases merit Docker-wide highlights. +--- + +# Curate What's New + +Treat merged documentation as evidence that a capability shipped, but do not +treat a documentation change as news by itself. + +Include an item only when the merged documentation directly shows all of the +following: + +- A released user-facing feature, material enhancement, or broader availability + milestone that was not available before the period +- A substantial capability or workflow, not new syntax or a small control + within an existing workflow +- Enough Docker-wide editorial significance to merit proactively telling users + about it outside product release notes +- A useful published page and a factual title and description + +Apply a high bar. The result is a curated launch archive, not a complete +changelog. A specialized feature can qualify when its user impact is +substantial. A quiet period can produce few or no items. + +## Exclusions + +Exclude documentation maintenance; fixes; rewrites; guidance for old behavior; +routine release or generated-content syncs; limitations, prerequisites, and +workarounds; narrow flags, settings, command variants, protocols, and +compatibility changes; incremental UI, safety, permissions, or observability +improvements; and lower-level Engine, Build, networking, or storage changes. +These qualify only when they are part of an independently newsworthy +product-level launch. + +Judge the user outcome, not PR size, product popularity, labels, changed lines, +a dedicated page, or the existence of a new API or command. + +## Select highlights + +Include every qualifying launch; do not impose a quota. Mark the five most +important as `featured: true`, or all items when fewer than five qualify. Rank +by the magnitude and distinctness of the user outcome and the value of helping +its audience discover it. Breadth can matter, but a major capability for a +specialized audience can outrank a smaller change for a broad audience. Recency +and product variety are not ranking goals. + +Create one item per launch and combine PRs that document the same launch. +Preserve existing copy while it remains accurate and qualifies. Change featured +status only when the relative importance of the candidate set changes. + +## Procedure + +1. Read `data/whats-new.json`. +2. Determine the review mode from the request: + - If the request does not specify a publication window, end it on the + previous UTC day and start it 29 days earlier. + - For an incremental review, list PRs merged from the day after the supplied + checkpoint through the end of the publication window. Retain existing + items inside the publication window without re-reviewing their source PRs. + If the request does not supply a checkpoint, use the existing + `period_end` from `data/whats-new.json`. + - For a full review, inspect every PR merged in the supplied publication + window. +3. List PRs in the range that applies to the review mode: + + ```console + $ gh pr list --repo docker/docs --state merged --search 'merged:START..END' --limit 200 + ``` + + If an incremental search returns no PRs, skip candidate inspection and only + remove expired items. +4. Inspect the diff and resulting pages for every plausible new candidate. +5. Decide what qualifies using only evidence in the merged documentation. +6. Remove existing items published before the requested publication window. + Add newly qualifying launches, combine related PRs, and reconsider featured + status across the resulting list. Do not replace or rewrite retained items + merely because they were not part of the incremental candidate range. +7. Replace `period_start`, `period_end`, and `items` in + `data/whats-new.json`. Sort items by `published` date, newest first. +8. Report the curation outcome in the response: + - Enumerate every newly selected entry by product, title, and source PRs. + - Summarize retained and expired entries by count. Identify any retained + entry whose content or sources changed. + - Explain only the most relevant plausible exclusions. Do not enumerate + routine maintenance PRs that were never credible candidates. + +If the request includes creating a pull request, use the same report in the PR +body with `## Summary`, `## Selected entries`, and `## Curation notes` +sections. Put each selected entry on one Markdown bullet and reference PRs as +`#NNNN` rather than full same-repository links. Do not hard-wrap bullets. Do +not create `.pr-body.md` or another handoff file unless the request explicitly +asks for one. + +Each item must contain `product`, `title`, `description`, `url`, `published`, +`source_prs`, and `featured`. Use the canonical product name, a published +internal URL, the merge date in `YYYY-MM-DD` format, and source PR numbers. + +Write factual, restrained copy. Avoid superlatives, promotional language, and +claims about ease or importance. Do not modify tracked files other than +`data/whats-new.json`. diff --git a/.agents/skills/curate-whats-new/agents/openai.yaml b/.agents/skills/curate-whats-new/agents/openai.yaml new file mode 100644 index 000000000000..6b51529d64a8 --- /dev/null +++ b/.agents/skills/curate-whats-new/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Curate What's New" + short_description: "Curate noteworthy Docker launches from merged docs" + default_prompt: "Use $curate-whats-new to curate Docker launches published during the requested date range." diff --git a/.agents/skills/fix-issue/SKILL.md b/.agents/skills/fix-issue/SKILL.md new file mode 100644 index 000000000000..4f32fe91f5bb --- /dev/null +++ b/.agents/skills/fix-issue/SKILL.md @@ -0,0 +1,85 @@ +--- +name: fix-issue +description: > + Fix a single GitHub issue end-to-end: triage, research, write the fix, + review, and create a PR. Use when asked to fix an issue: "fix issue 1234", + "resolve #500", "create a PR for issue 200". +argument-hint: "<issue-number>" +--- + +# Fix Issue + +Given GitHub issue **$ARGUMENTS**, decide what to do with it and either +close it or fix it. This skill orchestrates the composable skills — it owns +the decision tree, not the individual steps. + +## 1. Triage + +Invoke `/triage-issue $ARGUMENTS` to understand the issue and decide what +to do. This runs in a forked subagent and returns a verdict. + +## 2. Act on the triage result + +If triage says **close it** — comment with the reason and close: +```bash +gh issue close $ARGUMENTS --repo docker/docs \ + --comment "<one sentence explaining why> + +Generated by <active coding agent name>" +``` +Done. + +If triage says **escalate upstream** — comment noting the repo and stop: +```bash +gh issue comment $ARGUMENTS --repo docker/docs \ + --body "This needs to be fixed in <upstream-repo>. + +Generated by <active coding agent name>" +``` +Done. + +If triage says **leave it open** — comment explaining what was checked and +what's unclear. Do not close. +Done. + +End every issue comment with an accurate agent-disclosure footer that names +the active coding agent, for example `Generated by Codex` or `Generated by +Claude Code`. + +If triage says **fix it** — proceed to step 3. + +## 3. Research + +Invoke `/research` to locate affected files, verify facts, and identify +the fix. The issue context carries over from triage. This runs inline — +findings stay in conversation context for the write step. + +If research reveals the issue is upstream or cannot be fixed (e.g. +unverifiable URLs), comment on the issue and stop. + +## 4. Write + +Invoke `/write` to create a branch, make the change, format, self-review, +and commit. + +## 5. Review + +Invoke `/review-changes` to check the diff for correctness, coherence, and +mechanical compliance. This runs in a forked subagent with fresh context. + +If issues are found, fix them and re-review until clean. + +## 6. Create PR + +Invoke `/create-pr` to push the branch and open a pull request. + +## 7. Return to main + +```bash +git checkout main +``` + +## 8. Report + +Summarize what happened: the issue number, what was done (closed, escalated, +fixed with a PR link), and why — in a sentence or two. diff --git a/.agents/skills/maintain-pr/SKILL.md b/.agents/skills/maintain-pr/SKILL.md new file mode 100644 index 000000000000..ceb563616a43 --- /dev/null +++ b/.agents/skills/maintain-pr/SKILL.md @@ -0,0 +1,89 @@ +--- +name: maintain-pr +description: > + Maintain and follow up on a single Docker documentation pull request that + you own or are responsible for updating. Check CI and review feedback, fix + actionable failures, push changes, reply to comments, and report status. + Use for requests such as "babysit this PR", "check the status of my PR", + "fix CI on my PR", or "address review comments on #500". Do not use for + maintainer review of an incoming contribution; use review-pr for that. +--- + +# Maintain PR + +Do one maintenance pass over the specified author-owned PR: inspect its +state, fix actionable failures or feedback, reply to reviewers, and report +the result. This workflow may modify the branch and GitHub because the user +is asking to maintain the PR. Do not apply it to an incoming PR merely +because the user asks to review or assess it. + +## 1. Gather PR state + +```bash +gh pr view <PR> --repo docker/docs --json state,title,url,headRefName,headRepositoryOwner,comments,reviews,reviewDecision +gh pr checks <PR> --repo docker/docs --json name,state,detailsUrl +gh api repos/docker/docs/pulls/<PR>/comments \ + --jq '[.[] | {id, author: .user.login, body, path, line, in_reply_to_id}]' +``` + +Always check both top-level reviews and inline comments. A review with an +empty body may still contain line-level feedback. Confirm that the PR is one +the user owns or is authorized to update before checking out or pushing its +branch. If not, stop and use `review-pr`. + +## 2. Handle terminal states + +If merged, report the final state and identify unanswered review comments. +Reply only when the user remains responsible for follow-up. + +If closed without merge, read the closing context and report the reason. +Common causes include maintainer rejection, supersession, or automation. + +## 3. Diagnose CI failures + +- Read the failure details. +- Determine whether the failure comes from the PR or predates it. +- Fix actionable failures in the PR's changed files. +- Report pre-existing or upstream failures without changing unrelated files. + +Follow repository instructions for formatting, targeted linting, explicit +staging, commits, and pushes. Preserve unrelated working-tree changes. + +## 4. Address review feedback + +Treat every review comment as a claim to verify. Implement it only when the +evidence supports it; explain any evidence-based disagreement. + +After each fix: + +1. Format and validate the changed files. +2. Commit and push the focused change. +3. Reply to every addressed thread with what changed or why no change was + made. +4. End replies with an accurate agent-disclosure footer, such as + `Generated by Codex`. +5. Resolve threads only after replying. +6. Re-request review when appropriate. + +Use the inline comment endpoint to reply: + +```bash +gh api repos/docker/docs/pulls/<PR>/comments \ + --method POST \ + --field in_reply_to=<COMMENT_ID> \ + --field body='<RESPONSE>' +``` + +Use GraphQL to retrieve unresolved review-thread IDs and resolve only the +threads that were addressed. Do not silently fix feedback without replying. + +## 5. Report + +```markdown +## PR #<number>: <title> + +**State:** <open, merged, or closed> +**CI:** <passing, failing, or pending> +**Review:** <approved, changes requested, or pending> +**Action taken:** <changes, replies, and thread resolution, or none needed> +``` diff --git a/.agents/skills/maintain-pr/agents/openai.yaml b/.agents/skills/maintain-pr/agents/openai.yaml new file mode 100644 index 000000000000..54c4fb6d1d86 --- /dev/null +++ b/.agents/skills/maintain-pr/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Maintain PR" + short_description: "Maintain an authored PR through review and CI" + default_prompt: "Use $maintain-pr to maintain this pull request through CI and review follow-up." diff --git a/.agents/skills/migrate-content-ia/SKILL.md b/.agents/skills/migrate-content-ia/SKILL.md new file mode 100644 index 000000000000..cf0bf697ee89 --- /dev/null +++ b/.agents/skills/migrate-content-ia/SKILL.md @@ -0,0 +1,384 @@ +--- +name: migrate-content-ia +description: > + Handle Hugo docs information-architecture moves: discover old vs new URLs, + add front matter aliases (Phase 1), update in-repo links (Phase 2), interactive + List 2 resolution and fragment validation (Phase 3; no guessing). Supports + PR-scoped mapping plus whole-content sweeps for inbound links to that mapping, + or a full-site follow-up. Triggers on: "IA migration", "redirects for moved + pages", "fix links after content move", "PR-scoped link/anchor pass", + "aliases for old URLs". After branch work, chain the review-changes skill + (main...HEAD) before a PR. Agents must run the in-file required procedure + and definition of done, not the phases alone in isolation. +--- + +# Migrate content IA (redirects + links + anchors) + +Use this skill when pages **move or rename** under `content/` and you must +preserve old public URLs and/or fix cross-references. Work in **phases**; +choose **PR-scoped** vs **full-site** mode per run. + +**Read first:** **CLAUDE.md** / **AGENTS.md** (URL rules, vendored areas, external +links, special cases) and **hugo.yaml** (`permalinks`, `refLinksErrorLevel`, +`disablePathToLower`). For **prose and link text**, follow **STYLE.md**; for +**components, front matter, and link examples**, follow **COMPONENTS.md**. + +**Related skills:** **research** helps map moves and find inbound links; **write** +commits minimal edits. Run this skill’s phases after the move is identified (or +in parallel with research for large IA work). + +## Agent: required procedure (do not skip) + +**Common mistake (wrong):** use **`git diff main...HEAD` (or the PR’s file +list) as the full set of places to fix links** for a migration. That set shows +**what *moved***; it is **not** the list of every page that **points *to*** a +moved page. Inbound stragglers are often in files the PR **never** touched. You +must still **sweep the repo** for every string in the **old path and published-URL set** +for this run, not only for “files in the diff.” + +**Definition of done (when the migration is *finished*):** **Both** of the +following (unless the user or **AGENTS.md** **explicitly defers** a **List 2** +item in **Phase 3**; document the deferral): + +1. **`docker buildx bake validate`** passes for the branch, with no new + build/link errors from this work. +2. A **sweep of the old path and published-URL set for this run** (see + [Sweep commands](#sweep-commands) below) finds **no** remaining + migration-relevant **inbound** reference—**including**: + - links to an old **source** path (plain `.md` and equivalent `ref` forms), + - links that use the old path **and** a `#fragment`, + - and, where your mapping includes them, old **published-style** `link:` / + `url:` / full-site URL strings, + **except** intentional entries to keep: for example `aliases` on the **new** + canonical page, or **redirects.yml** *sources* you must not edit per policy. + (A hit on a **source** that is only an `alias` line on the new page is + **expected**—do not “fix” that away; distinguish alias rows from straggler + links in body or nav config.) + +**Chaining (policy):** when this branch’s content work is ready for handoff, +**run the [review-changes](../review-changes/SKILL.md) skill** on +**`main...HEAD`** (or **`merge-base`…`HEAD`** for a different target branch) so +the **whole branch** is re-read for cross-page issues before opening a PR. Do +not treat phases 0–3 alone as the final check. + +**Run in order (mandatory for agents):** + +1. **Scope the moves (mapping input):** set the Git range like **review-changes** + (for a PR to `main`: `git diff --name-only main...HEAD`; for another target: + `BASE=$(git merge-base <target-branch> HEAD)` then + `git diff --name-only $BASE...HEAD`, as in **Phase 0.5**). Include + renames; build the **old → new** table (source and published) per **Phase + 0**. +2. **Sweep and list:** for every **old** path/URL in that table, run + [Sweep commands](#sweep-commands) on the **allowed** trees. Record + every hit as **List 1** (no `#`) or **List 2** (old path with `#...`) per + **Phase 0.5**. +3. **Phased edits:** **Phase 1** (`aliases`), then **Phase 2** (List 1), then + **Phase 3** (List 2) with **no guessing**—as in the sections below. +4. **Re-sweep** the same old-path set, then run **`docker buildx bake + validate`**. The **Definition of done** above is met or you have **explicit + defers** for the remainder. +5. **review-changes:** run **[review-changes](../review-changes/SKILL.md)** + on the branch vs **`main`…`HEAD`** (or the correct base) before a PR. + +### Sweep commands + +Use a **repository** search (e.g. `rg` / your IDE) so **nothing** in the +allowed scope is only eyeballed. + +**Trees to include** (at minimum): all of `content/`, plus **`data/`** and +**`layouts/`** when a migration can appear in config, `link:`-like fields, +shortcodes, or hardcoded path strings. Follow **Vendored / generated** rules in +**AGENTS.md**; do not edit disallowed files. + +**What to search for (repeat per row in the old side of the mapping):** + +- **Hugo / source form:** path segments that identify the *old* file, e.g. + `manuals/.../old-segment/...` or `../old-segment/.../page.md` as your tree + uses; include variants that still appear in the repo. +- **Published / site form:** e.g. `/admin/.../old-slug/` in front matter, nav + `url:`, or `https://docs.docker.com/...` in allowed files—**match the + file’s** established pattern, per **Conventions** below. +- **Anchors:** search for the **old path string**; matches that also include + `#...` belong on **List 2** for **Phase 3** unless the whole link is + a pure path-only case. + +[scripts/scope-pr-files.sh](scripts/scope-pr-files.sh) (if present) prints +**`PR_SCOPE_FILES` only**—it does **not** replace this sweep. Use it to build +the **old → new** table, **not** to list where inbound links were fixed. + +## Progressive disclosure (optional) + +The procedure below stays in this file. If a run produces a very large +**old → new** URL table, store that table in **`reference.md`** in this skill +directory and link it from the task summary, so the agent reads the long +mapping only when needed. + +## Modes + +- **PR-scoped (typical for a single PR)** + - **What the PR “owns” (focus):** use `git diff` / `base...HEAD` to know which + pages and renames the branch actually moves (`PR_SCOPE_FILES`). The **old → + new** mapping and **List 1 / List 2** for this migration are defined from + **that** work, not from unrelated areas. + - **Where to look for stale references (sweep):** search broadly—typically all + of `content/` (and config, shortcodes, layouts, per Conventions)—for **inbound** + links and fields whose **target** is an **old** path or URL in **this** PR’s + mapping. Inbound stragglers are often in files the PR never touched; finding + them is **in scope** for this migration. + - **What to edit:** update **any** file in the allowed trees that contains a + **migration-relevant** reference (target ∈ this PR’s old path set) according + to the phases below. **Do not** treat `PR_SCOPE_FILES` as a hard limit on + *which files you may save* for **inbound** link repairs (unless + project policy for a given PR says otherwise; then follow policy and + **defer** out-of-PR file fixes). + - **Out of scope (defer / ignore in this run):** link and anchor problems that + are **not** about this PR’s old→new map—e.g. a different area’s own slug + issues, rot unrelated to the remapped path set. *Example:* a PR that only + remaps `content/strawberry/...` should not “fix the whole site”; it **should** + still fix a link under `mango/…` that **points at** an old `strawberry/…` path + in the mapping, and **should not** chase **mango/**-only issues that do + not involve those old targets. + +- **Full-site (complete migration after the PR)** + - Update stragglers **across the repo** (or all inbound links to moved + sections), including config-driven `link:` fields if policy allows. + - Still make **minimal** edits; no drive-by rewrites to **unrelated** targets + outside the run’s **declared** mapping and lists. + +### No guessing + +- The agent must **not** guess **replacement paths, published URLs, or fragment + IDs** (including for consolidated pages, renamed headings, or + “semantic” remaps of `#anchor` → new `#…`). If the user has not given an + explicit new target, **ask**, **defer**, or **stop** per **AGENTS.md**; never + infer, autocomplete, or substitute a plausible fragment from the target page’s + heading list. That rule applies in **every** phase, including after validation + in Phase 3. + +--- + +## Conventions (links, anchors, redirects) + +### Front matter `aliases` (redirects) + +- Per **COMPONENTS.md**, `aliases` are **URLs that redirect to this page**. +- Add or **merge** on the **new canonical** page; do not drop unrelated + entries. Match local examples: **published-style paths** (leading `/`), and + **trailing `/`** when that matches existing pages in the same area. +- **No** speculative redirects for URLs that were never published. +- **Collision check** before adding: no other page or redirect may already + own the same old path. +- If the site also uses **`data/redirects.yml`**, only add entries when + project policy requires it; avoid duplicating the same old URL in + `aliases` **and** `redirects.yml` unless maintainers do. + +### Internal links in Markdown (STYLE.md + COMPONENTS.md) + +- Use **relative paths to source files** (e.g. `../section/page.md`) with + **`.md`**, following **COMPONENTS.md** examples, unless the file already + uses an established pattern (e.g. some `link:` or nav fields use **published** + paths without `manuals` or `.md` — **match the surrounding file**). +- Keep **CLAUDE.md** / **AGENTS.md** rules: internal ref targets under + `content/manuals/...` often use the full **`/manuals/...`** path; published + URLs omit the `manuals` segment—do not confuse the two when fixing links. +- **Link text (STYLE.md):** descriptive, ~**5 words**; no “click here” or + “learn more”; **no** end punctuation **inside** the link text; **no** bold/italic + on link text unless normal in the sentence. +- **Headings (STYLE):** **sentence case**; do not rename headings in passing + unless the migration requires it (heading changes break fragments). + +### Shortcodes and layouts (links not only in Markdown) + +- **Phase 2–3 scope includes** any **shortcode or layout partial** (under + **Modes**, search broadly for inbound links to the migration; **edits** follow + the same file-level rules as for Markdown) that emits links: e.g. `ref` / + `relref`, `link` fields in shortcode args, or hardcoded + `docs.docker.com` / path strings. Grep for old paths, slugs, and fragments + under `layouts/shortcodes/` (and `layouts/_default/` if partials build nav). +- Match each file’s existing pattern; do not rewrite working shortcode style + just to “clean up.” + +### Fragments / anchors (Phase 3) + +- List 1 / List 2: fragment-bearing **cross-references to old paths** are tracked + on **List 2** in Phase 0.5; do not bulk-rewrite them in the **List 1** pass + (Phase 2). See Phase 0.5 and Phase 2. +- **Valid `#fragment` values:** after the user supplies a new fragment, it should + match the **target** page’s **generated** heading ID (Hugo slugification; see + **CLAUDE.md** / **AGENTS.md**). The agent still **validates** (see Phase 3) and + must **not** “pick” a different id from the page to replace a bad answer—**No + guessing**. +- Same-page: `[Text](#section-id)`. +- Cross-page: when user-provided, `#fragment` must still be checked against the + **target** file. Validate fragments in shortcodes the same way as in body + Markdown. + +### External URLs (**AGENTS.md**) + +- Do not commit **guessed** replacement URLs. If a URL cannot be verified, + treat as blocked or drop the fragment per AGENTS guidance. See also **No + guessing** above; internal and external link targets are treated the same for + inference: **none** without user input or a verified source. + +### Special cases (**AGENTS.md**) + +- **Engine API version** pages: respect coordinated **`/latest/` `aliases`** + rules—never leave two version files both owning `/latest/`. +- **Vendored / generated** trees: read-only; see CLAUDE.md. Do not “fix” links + there if policy forbids. + +--- + +## Phase 0 — Discovery (read-only; may use whole repo) + +1. Read **hugo.yaml** (permalinks, `refLinksErrorLevel`, `disablePathToLower`). +2. From the branch (diff, renames), build a **mapping table**: + - old source path → new source path + - old published URL → new published URL (from permalink rules) +3. **Case:** with `disablePathToLower: true`, filesystem path **case** appears in + URLs—**directory and link casing must match** (e.g. `setup` vs `Setup`). +4. When planning **inbound link** fixes, treat old-path references as two + categories: **no fragment** vs **with `#fragment`**. That split feeds + **List 1** and **List 2** in Phase 0.5 and drives Phase 2 ordering (see + there). + +--- + +## Phase 0.5 — PR-scoped evaluation (required before edits in PR mode) + +1. **Set `PR_SCOPE_FILES` (Git scope for PR mode)** + - When the PR **targets `main`**, use the same triple-dot form as + **review-changes**: + `git diff --name-only main...HEAD` + - For a **different target branch** or a custom base, use the merge base: + `BASE=$(git merge-base <target-branch> HEAD)` + then: + `git diff --name-only "$BASE"...HEAD` + - Those paths define **what moved** in the branch; they are the primary input + to the **old → new** path/URL table. They are **not** a hard cap on *where + to search* for **inbound** links (see **Modes**): sweeps for links **to** old + paths usually cover all of `content/` (and other trees per Conventions). + - If project policy **limits edits** to the diff for a given PR, follow that + and **defer** link fixes in files outside the diff; note the exception in + the task if the user relaxes that policy. + +2. Build checklists (see **Modes** for sweep vs area-of-work): + - path/URL mapping this run must honor (old source path → new; old published + → new, from the **PR’s** moves in PR-scoped mode, or the **declared** full + migration in full-site mode) + - **List 1 — old path, no fragment:** every **inbound** reference, found on + the **sweep** surface, to a moved **old** path that does **not** include a + `#...` fragment (e.g. `…/banana.md` in the repo’s link style for that + file). + - **List 2 — old path with fragment:** every **inbound** reference, found on + the same sweep, to a moved **old** path that **includes** a `#...` fragment + (e.g. `…/banana.md#anchor` or the published-style equivalent in context). The + **same** old path string may appear on **both** List 1 and List 2 for + different links; duplication across the two lists is OK. + - **Matching rules:** when recording List 1 / List 2, use **one** consistent + path representation for comparison (e.g. relative `../path/banana.md` vs + root-anchored) **per the conventions in this doc** and the **surrounding + file’s** established pattern. Agents compare and skip List 2 links in the + List 1 pass using the **same** representation rules. +3. **Out of scope** for the lists: only include references whose **old** target + is in this run’s **mapping**. Do not build List 1/2 for unrelated **mango/** + (or other) problems unless those links also target an **old** path that this + migration renames. Defer those issues separately (see **Modes**). + +--- + +## Phase 1 — `aliases` (old published URLs) + +1. On each **new** canonical page, add or merge **`aliases`** for every **real** + former public URL. +2. Do not strip existing unrelated aliases. +3. **PR-scoped:** add aliases only where the canonical file is in scope or the + project requires it; otherwise list missing alias targets for follow-up. + +--- + +## Phase 2 — In-repo link reference updates + +1. **List 1 first (path only):** update references that belong to **List 1** + (old path, **no** fragment). Replace old source paths or old published URLs + with the **new** targets; preserve each file’s link pattern (relative vs + root-anchored `.md` paths). **Do not** apply the same bulk path replacement to + links that appear in **List 2** (old path **with** `#...`) during this + sub-step—**leave** every **List 2** link **unchanged** for now. +2. **After List 1 is complete:** **re-scan** the **same** **sweep** surface as + in Phase 0.5 (e.g. all of `content/` plus config) or **print** a clear list of + all **remaining** **List 2** entries. Those links should still point at the + **old** path and **old** fragment until Phase 3. +3. **Full-site (extra sweep):** after steps 1–2, still use **AGENTS “Page + deletion checklist”**-style thoroughness for **config / front matter** + `link:` and similar so nav and grids are not left on old slugs. Apply the + **List 1 / List 2** rules there too: path-only old references first; defer + fragment-bearing rewrites in line with **List 2** until Phase 3. +4. **PR-scoped (which files to change):** apply List 1 and later Phase 3 updates + to **every** file the **sweep** finds with a **migration-relevant** reference + (inbound to an **old** path in the mapping), including files **not** in + `PR_SCOPE_FILES`, per **Modes**. **Log** and **defer** (do not “fix”) + unrelated stragglers. If policy forbids out-of-PR file edits, defer per step 1 + of Phase 0.5. +5. Include **shortcodes and layout partials** (see Conventions and **Modes** for + sweep vs focus). + +--- + +## Phase 3 — List 2: interactive path and fragment resolution + +**Prerequisites:** Phase 2 has updated **List 1**; **List 2** still lists **old +path + `#...`** (unchanged) for this migration. See **Modes** for which files +may be edited; **No guessing** applies. + +1. **Print List 2** to the user: every remaining **old path** + `#anchor` (in the + agreed representation), so nothing is hidden before the loop. +2. **For each distinct** `old-path#oldAnchor` (or process in the order the user + prefers, one at a time): + - Ask: **What is the new path (and fragment, if any) for this content?** The + user may give a new source path, published URL, and/or `#newAnchor` per + project conventions. + - **Validate** the user’s answer: open the **target** page (or resolve the + target) and check that `#newAnchor` (if any) **exists** as a real heading + / generated id on that page, per **CLAUDE.md** / **AGENTS.md** (same rules + as the rest of the site). **Do not** replace the user’s fragment with a + “better” one from the file. + - If validation **fails** (unknown target file, or `#newAnchor` not found on + the page): **warn** clearly (what failed: path vs missing fragment), then + **ask again** for a corrected path and/or fragment. **Repeat** until + validation passes or the user **defers** / **drops** the fragment (per + **AGENTS.md**). **Never** guess a new fragment to fix the problem. + - When validation **passes:** update **all** in-repo references that match + that **same** `old-path#oldAnchor` to the user-approved `new-path#newAnchor` + (respect each file’s link style; include shortcodes/layouts on the same + **sweep** surface as Phase 2). +3. **Repeat** from step 1: **re-print** or **re-scan** for **List 2** until it is + **empty** or the user defers the remainder. +4. **PR-scoped / full-site:** the **loop** is the same. **Edits** follow **Modes**: + migration-relevant **inbound** links may live in any file on the sweep; do + not expand into **unrelated** link debt from other areas. Defer as in **Modes** + and Phase 0.5. + +--- + +## Optional: scripts helper + +This skill includes a small **scope helper** so agents do not re-derive Git +recipes. See [scripts/scope-pr-files.sh](scripts/scope-pr-files.sh) — it prints +paths in PR scope for a given target branch (default `main`). + +--- + +## Verification + +```bash +docker buildx bake validate +``` + +Use the **Definition of done** in **Agent: required procedure (do not skip)** +as the final bar: **validate** must pass, and the **sweep** must be clean for +**plain** and **`#fragment`** old-path references, **or** the remainder must be +**explicitly deferred** in **Phase 3** per **AGENTS.md** / the user. Mid-run, +**Phase 2** may still leave **List 2** links unchanged **until** Phase 3; that +intermediate state is **not** the finished migration. diff --git a/.agents/skills/migrate-content-ia/scripts/scope-pr-files.sh b/.agents/skills/migrate-content-ia/scripts/scope-pr-files.sh new file mode 100644 index 000000000000..d027ee3e47af --- /dev/null +++ b/.agents/skills/migrate-content-ia/scripts/scope-pr-files.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# List files changed on the current branch since merge-base with the target +# branch — suitable for PR_SCOPE_FILES in PR-scoped migrate-content-ia runs. +# +# Usage: +# ./scope-pr-files.sh [target-branch] +# Default target-branch: main +# +# Example (Bash / Git Bash, from repo root): +# bash .agents/skills/migrate-content-ia/scripts/scope-pr-files.sh +# Example (other base): +# bash .../scope-pr-files.sh upstream/main +set -euo pipefail + +target="${1:-main}" + +if ! base=$(git merge-base "$target" HEAD 2>/dev/null); then + echo "Error: could not merge-base with '$target'. Fetch remotes or pass a valid branch." >&2 + exit 1 +fi + +git diff --name-only "$base"...HEAD diff --git a/.agents/skills/research/SKILL.md b/.agents/skills/research/SKILL.md new file mode 100644 index 000000000000..db9f98c3ffa0 --- /dev/null +++ b/.agents/skills/research/SKILL.md @@ -0,0 +1,93 @@ +--- +name: research +description: > + Research a documentation topic — locate affected files, understand the + problem, identify what to change. Use when investigating an issue, a + question, or a topic before writing a fix. Triggers on: "research issue + 1234", "investigate what needs changing for #500", "what files are + affected by #200", "where is X documented", "is our docs page about Y + accurate", "look into how we document Z". +--- + +# Research + +Thoroughly investigate the topic at hand and produce a clear plan for +the fix. The goal is to identify exact files, named targets within those +files, and the verified content needed for the fix. + +## 1. Gather context + +If the input is a GitHub issue number, fetch it: + +```bash +gh issue view <number> --repo docker/docs \ + --json number,title,body,labels,comments +``` + +Otherwise, work from what was provided — a description, a URL, a question, +or prior conversation context. Identify the topic, affected feature, or +page to investigate. + +## 2. Locate affected files + +Search `content/` using the URL or topic from the issue. Remember the +`/manuals` prefix mapping when converting URLs to file paths. + +For each candidate file, read the relevant section to confirm it contains +the reported problem. + +## 3. Check vendored ownership + +Before planning any edit, verify the file is editable locally: + +- `_vendor/` — read-only, vendored via Hugo modules +- `data/cli/` — read-only, generated from upstream YAML +- `content/reference/cli/` — read-only, generated from `data/cli/` +- Everything else in `content/` — editable + +If the fix requires upstream changes, identify the upstream repo and note +it as out of scope. See the vendored content table in CLAUDE.md. + +## 4. Find related content + +Look for pages that may need updating alongside the primary fix: + +- Pages that link to the affected content +- Include files (`content/includes/`) referenced by the page +- Related pages in the same section describing the same feature + +## 5. Verify facts + +If the issue makes a factual claim about how a feature behaves, verify it. +Follow external links, read upstream source, check release notes. Do not +plan a fix based on an unverified claim. + +If the fix requires a replacement URL and that URL cannot be verified (e.g. +network restrictions), report it as a blocker rather than guessing. + +## 6. Check the live site (if needed) + +For URL or rendering issues, fetch the live page: + +``` +https://docs.docker.com/<path>/ +``` + +## 7. Report findings + +Summarize what you found — files to change, the specific problem in each, +what the fix should be, and any constraints. This context feeds directly +into the write step. + +Be specific: name the file, the section or element within it, and the +verified content needed. "Fix the broken link in networking.md" is not +specific enough. "In `compose/networking.md`, the 'Custom networks' section, +remove the note about `driver_opts` being ignored — this was fixed in +Compose 2.24" is. + +## Notes + +- Research quality bounds write quality. Vague research produces broad + changes; precise research produces minimal ones. +- Do not create standalone research files — findings stay in conversation + context for the write step. diff --git a/.agents/skills/review-changes/SKILL.md b/.agents/skills/review-changes/SKILL.md new file mode 100644 index 000000000000..f147883a44b2 --- /dev/null +++ b/.agents/skills/review-changes/SKILL.md @@ -0,0 +1,107 @@ +--- +name: review-changes +description: > + Review uncommitted or recently committed documentation changes for + correctness, coherence, and style compliance. Use before creating a PR + to catch issues. "review my changes", "review the diff", "check the fix + before submitting", "does this look right". +context: fork +model: opus +--- + +# Review Changes + +Evaluate whether the changes correctly and completely solve the stated +problem, without introducing new issues. Start with no assumptions — the +change may contain mistakes. Your job is to catch what the writer missed, +not to rubber-stamp the diff. + +## 1. Identify what changed + +Determine the scope of changes to review: + +```bash +# Uncommitted changes +git diff --name-only + +# Last commit +git diff --name-only HEAD~1 + +# Entire branch vs main +git diff --name-only main...HEAD +``` + +Pick the right comparison for what's being reviewed. If reviewing a branch, +use `main...HEAD` to see all changes since the branch diverged. + +## 2. Read each changed file in full + +Do not just read the diff. For every changed file, read the entire file to +understand the full context the change lives in. A diff can look correct in +isolation but contradict something earlier on the same page. + +Then read the diff for the detailed changes: + +```bash +# Adjust the comparison to match step 1 +git diff --unified=10 # uncommitted +git diff --unified=10 HEAD~1 # last commit +git diff --unified=10 main...HEAD # branch +``` + +## 3. Follow cross-references + +For each changed file, check what links to it and what it links to: + +- Search for other pages that reference the changed content (grep for the + filename, heading anchors, or key phrases) +- Read linked pages to verify the change doesn't create contradictions + across pages +- Check that anchor links in cross-references still match heading IDs + +A change that's correct on its own page can break the story told by a +related page. + +## 4. Verify factual accuracy + +Don't assume the change is factually correct just because it reads well. + +- If the change describes how a feature behaves, verify against upstream + docs or source code +- If the change includes a URL, check that it resolves +- If the change references a CLI flag, option, or API field, confirm it + exists + +## 5. Evaluate as a reader + +Consider someone landing on this page from a search result, with no prior +context: + +- Does the page make sense on its own? +- Is the changed section clear without having read the issue or diff? +- Would a reader be confused by anything the change introduces or leaves + out? + +## 6. Review code and template changes + +For non-Markdown changes (JS, HTML, CSS, Hugo templates): + +- Trace through the common execution path +- Trace through at least one edge case (no stored preference, Alpine fails + to load, first visit vs returning visitor) +- Ask whether the change could produce unexpected browser or runtime + behavior that no automated tool would catch + +## 7. Decision + +**Approve** if the change is correct, coherent, complete, and factually +accurate. + +**Request changes** if: +- The change does not correctly solve the stated problem +- There is a factual error or contradiction (on-page or cross-page) +- A cross-reference is broken or misleading +- A reader would be confused + +When requesting changes, be specific: quote the exact text that is wrong, +explain why, and suggest the correct fix. diff --git a/.agents/skills/review-pr/SKILL.md b/.agents/skills/review-pr/SKILL.md new file mode 100644 index 000000000000..7f5bfdb59b09 --- /dev/null +++ b/.agents/skills/review-pr/SKILL.md @@ -0,0 +1,205 @@ +--- +name: review-pr +description: > + Review one or more incoming Docker documentation pull requests as a + maintainer. Independently validate technical claims, assess editorial fit + and information architecture, choose a verdict, and draft exact inline or + PR-wide feedback behind a confirmation gate. Use for requests such as + "review PR 123", "is this PR correct?", "does this information belong + here?", "validate this PR", or "help review backlog PRs". Do not use to + maintain or fix a PR you own; use maintain-pr for that. +--- + +# Review PR + +Review incoming contributions for factual correctness and whether they make +the documentation better as a whole. Treat a technically true addition as +insufficient when it is misplaced, overemphasized, redundant, or unhelpful +to the page's intended reader. + +## Preserve the write boundary + +Perform the review in two phases: + +1. Research the PR, decide a verdict, and present the exact proposed + comment or review text. +2. Wait for explicit user confirmation, then post only the confirmed text. + +Before confirmation, do not post comments, submit a GitHub review, approve or +request changes, resolve threads, push commits, edit labels, or otherwise +mutate GitHub. A request to review or draft feedback is not confirmation to +post it. Ask `Post these comments?` and stop. Treat revisions to a draft as +unconfirmed until the user explicitly asks to post them. + +## 1. Gather the full context + +For each PR, inspect its metadata, body, commits, changed files, checks, +conversation, reviews, and linked issues. Always fetch inline comments +separately because `gh pr view --json reviews` omits them. + +```bash +gh pr view <PR> --repo docker/docs \ + --json number,title,url,state,author,body,baseRefName,headRefName,headRefOid,commits,files,comments,reviews,reviewDecision,statusCheckRollup +gh api repos/docker/docs/pulls/<PR>/comments \ + --jq '[.[] | {id, author: .user.login, body, path, line, side, commit_id}]' +gh pr diff <PR> --repo docker/docs +``` + +Read linked issues and relevant discussion. An issue is evidence that a +reader was confused, but it does not establish the reporter's diagnosis or +justify a new highlighted note by itself. Green CI establishes only that automated +checks passed, not that the content is correct. + +Fetch the PR head when local inspection is useful. Compare it with the +canonical upstream base rather than assuming the local branch is fresh. +Read each changed file in full, not only its diff. + +## 2. Research independently + +Verify every material claim against authoritative sources such as product +source code, upstream documentation, specifications, release notes, or safe +local reproduction. Do not accept the PR description, issue diagnosis, or +existing review feedback as fact. + +Search the documentation for related explanations and canonical pages. Read +`STYLE.md`, `COMPONENTS.md`, and applicable repository instructions. Check +whether a changed file is generated or maintained upstream and identify the correct +upstream repository instead of proposing a local edit. + +Distinguish among: + +- a wrong fact +- a correct fact expressed inaccurately +- a correct fact placed on the wrong page +- content already explained elsewhere +- a real discovery problem better addressed with a short signpost and link +- a request that needs no documentation change. + +If an external claim or replacement URL cannot be verified, report that +limitation instead of guessing. + +## 3. Assess editorial fit + +Apply these questions to each addition: + +- Does it change a reader's decision or next action on this page? +- Is this the canonical page for the concept? +- Is the fact general, or specific to this page, feature, or component? +- Is the information already documented elsewhere? +- Would a concise local signpost to canonical coverage solve the discovery + problem better than duplicating the explanation? +- Is the visual and textual weight proportional to the information's value? +- Does it preserve the page's scope, flow, and character? + +Prefer one coherent explanation in the canonical location. Add local context +only when it helps the reader complete the task at hand. Avoid stray notes, +callouts, and exhaustive edge cases whose prominence exceeds their value. + +## 4. Choose a decisive verdict + +Lead with one of these outcomes: + +- **Approve**: correct, useful, well placed, and ready to merge. +- **Approve with optional polish**: ready to merge; suggestions are genuinely + non-blocking. +- **Focused rewrite**: the underlying need is valid, but wording, scope, + placement, or structure should change before merge. +- **Close / no docs change**: incorrect, redundant, out of scope, or not a + documentation problem. + +Explain the verdict with evidence. When wording is the issue, provide exact +replacement text rather than a vague request to improve it. + +## 5. Place feedback deliberately + +Use an inline comment when the finding is anchored to a narrow changed line +or range and acting on it is local. Examples include an inaccurate sentence, +an ambiguous option description, a broken link, or a precise wording +replacement. + +Use a PR-wide comment for scope, information architecture, overall approach, +multiple intertwined edits, or a proposed replacement section. Do not attach +holistic feedback to an arbitrary line. + +Use both when appropriate: put the overall direction in the PR-wide comment +and line-specific corrections inline. Do not repeat the same point in both. +Consolidate related feedback so the author receives the fewest comments that +remain clear and actionable. + +For every proposed inline comment, resolve and display the current changed +file path and right-side diff line. If the target line is not part of the +current diff or cannot be identified reliably, use a PR-wide comment that +quotes the target text instead. Never guess a line number. + +End comments posted on the user's behalf with an accurate agent-disclosure +footer, such as `Generated by Codex`. + +## 6. Present drafts and stop + +Before any GitHub write, show the review in this form, omitting empty +sections: + +```markdown +## Verdict + +Focused rewrite + +## Findings + +- <finding and evidence> + +## Proposed inline comments + +1. `path/to/file.md:42` + > Exact comment text + +## Proposed PR-wide comment + +> Exact comment text + +Post these comments? +``` + +For multiple PRs, give each PR its own verdict and comment set. Make the +confirmation scope unambiguous. Do not interpret approval of one PR's drafts +as approval to post comments on the others. + +## 7. Post only confirmed feedback + +Immediately before posting, re-fetch the PR head SHA and diff. If either the +head or an inline target changed, stop and show the updated draft or +placement for confirmation. + +Post confirmed inline comments as a single comment-only review when +practical. Use the current head SHA and right-side diff lines: + +```bash +gh api repos/docker/docs/pulls/<PR>/reviews --method POST --input <payload> +``` + +The JSON payload contains `commit_id`, `event: "COMMENT"`, and a `comments` +array whose entries contain `path`, `line`, `side: "RIGHT"`, and `body`. +Submitting a review with `APPROVE` or `REQUEST_CHANGES` requires separate, +explicit user authorization; a verdict alone does not grant it. + +Post confirmed holistic feedback separately: + +```bash +gh pr comment <PR> --repo docker/docs --body-file <file> +``` + +Use a safely created temporary file or API input so Markdown, backticks, and +shell substitutions are preserved literally. Post exactly the confirmed +text. Verify the resulting review/comments and report their URLs and +placements. If GitHub rejects an inline location, do not silently fall back +to a PR-wide comment; report the failure and prepare a revised placement for +confirmation. + +## Definition of done + +- Verify technical claims with authoritative evidence. +- Evaluate usefulness, placement, duplication, and proportionality. +- Give a decisive verdict and exact actionable wording. +- Choose inline and PR-wide placement based on the feedback's scope. +- Show every exact draft and target before any GitHub mutation. +- Post only after explicit confirmation and verify what was posted. diff --git a/.agents/skills/review-pr/agents/openai.yaml b/.agents/skills/review-pr/agents/openai.yaml new file mode 100644 index 000000000000..05b429a0082d --- /dev/null +++ b/.agents/skills/review-pr/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Review PR" + short_description: "Validate incoming documentation pull requests" + default_prompt: "Use $review-pr to validate this incoming documentation PR and draft maintainer feedback." diff --git a/.agents/skills/testcontainers-guides-migrator/SKILL.md b/.agents/skills/testcontainers-guides-migrator/SKILL.md new file mode 100644 index 000000000000..b934d1af4d7d --- /dev/null +++ b/.agents/skills/testcontainers-guides-migrator/SKILL.md @@ -0,0 +1,401 @@ +--- +name: testcontainers-guide-migrator +description: > + Migrate a Testcontainers guide from testcontainers.com into the Docker docs site (docs.docker.com). + Converts AsciiDoc to Hugo Markdown, updates code to the latest Testcontainers API, splits into + chapters with stepper navigation, verifies code compiles and tests pass, and validates against + Docker docs style rules. Use when asked to migrate a testcontainers guide, add a TC guide, or + port content from testcontainers.com to Docker docs. +--- + +# Migrate a Testcontainers Guide + +You are migrating guides from https://testcontainers.com/guides/ into the Docker docs Hugo site. +Each guide lives in its own GitHub repo under `testcontainers/tc-guide-*`, written in AsciiDoc. +The source repos are listed in the testcontainers-site build.sh: +https://github.com/testcontainers/testcontainers-site/blob/main/build.sh#L23-L45 + +## Inputs + +The user provides one or more guides to migrate. Resolve these from the inventory below: + +- **REPO_NAME**: GitHub repo (e.g. `tc-guide-getting-started-with-testcontainers-for-java`) +- **SLUG**: guide slug inside `guide/` dir (e.g. `getting-started-with-testcontainers-for-java`) +- **LANG**: language identifier (go, java, dotnet, nodejs, python) +- **GUIDE_ID**: short kebab-case name (e.g. `getting-started`) + +## Guide inventory + +These are the 21 guides from testcontainers.com/guides/ and their source repos: + +| # | Title | Repo | Lang | GUIDE_ID | +|---|-------|------|------|----------| +| 1 | Introduction to Testcontainers | tc-guide-introducing-testcontainers | (none) | introducing | +| 2 | Getting started for Java | tc-guide-getting-started-with-testcontainers-for-java | java | getting-started | +| 3 | Testing Spring Boot REST API | tc-guide-testing-spring-boot-rest-api | java | spring-boot-rest-api | +| 4 | Testcontainers lifecycle (JUnit 5) | tc-guide-testcontainers-lifecycle | java | lifecycle | +| 5 | Configuration of services in container | tc-guide-configuration-of-services-running-in-container | java | service-configuration | +| 6 | Replace H2 with real database | tc-guide-replace-h2-with-real-database-for-testing | java | replace-h2 | +| 7 | Testing ASP.NET Core web app | tc-guide-testing-aspnet-core | dotnet | aspnet-core | +| 8 | Testing Spring Boot Kafka Listener | tc-guide-testing-spring-boot-kafka-listener | java | spring-boot-kafka | +| 9 | REST API integrations with MockServer | tc-guide-testing-rest-api-integrations-using-mockserver | java | mockserver | +| 10 | Getting started for .NET | tc-guide-getting-started-with-testcontainers-for-dotnet | dotnet | getting-started | +| 11 | AWS integrations with LocalStack | tc-guide-testing-aws-service-integrations-using-localstack | java | aws-localstack | +| 12 | Testcontainers in Quarkus apps | tc-guide-testcontainers-in-quarkus-applications | java | quarkus | +| 13 | Getting started for Go | tc-guide-getting-started-with-testcontainers-for-go | go | getting-started | +| 14 | jOOQ and Flyway with Testcontainers | tc-guide-working-with-jooq-flyway-using-testcontainers | java | jooq-flyway | +| 15 | Getting started for Node.js | tc-guide-getting-started-with-testcontainers-for-nodejs | nodejs | getting-started | +| 16 | REST API integrations with WireMock | tc-guide-testing-rest-api-integrations-using-wiremock | java | wiremock | +| 17 | Local dev with Testcontainers Desktop | tc-guide-simple-local-development-with-testcontainers-desktop | java | local-dev-desktop | +| 18 | Micronaut REST API with WireMock | tc-guide-testing-rest-api-integrations-in-micronaut-apps-using-wiremock | java | micronaut-wiremock | +| 19 | Micronaut Kafka Listener | tc-guide-testing-micronaut-kafka-listener | java | micronaut-kafka | +| 20 | Getting started for Python | tc-guide-getting-started-with-testcontainers-for-python | python | getting-started | +| 21 | Keycloak with Spring Boot | tc-guide-securing-spring-boot-microservice-using-keycloak-and-testcontainers | java | keycloak-spring-boot | + +Already migrated: **#2 (Java getting-started)**, **#13 (Go getting-started)**, **#20 (Python getting-started)** + +## Step 0: Pre-flight + +1. Confirm `testing-with-docker` tag exists in `data/tags.yaml`. If not, add: + ```yaml + testing-with-docker: + title: Testing with Docker + ``` +2. Check if new terms need adding to `_vale/config/vocabularies/Docker/accept.txt`. +3. Read `STYLE.md` and `COMPONENTS.md` to refresh on Docker docs conventions. + +## Step 1: Clone the guide repo + +Clone the guide repo to a temporary directory. This gives you all source files locally — no HTTP calls needed. + +```bash +git clone --depth 1 https://github.com/testcontainers/{REPO_NAME}.git <tmpdir>/{REPO_NAME} +``` + +Where `<tmpdir>` is a temporary directory on your system (e.g. the output of `mktemp -d`). + +The repo structure is: +- `<tmpdir>/{REPO_NAME}/guide/{SLUG}/index.adoc` — the AsciiDoc guide source +- `<tmpdir>/{REPO_NAME}/src/` — application source code (referenced by `include::` directives) +- `<tmpdir>/{REPO_NAME}/testdata/` — test data files (SQL scripts, configs, etc.) +- `<tmpdir>/{REPO_NAME}/pom.xml` or `go.mod` — build config + +1. Read `guide/{SLUG}/index.adoc` to get the guide content. +2. Find all `include::{codebase}/path/to/file[]` directives. The `{codebase}` attribute points to a remote URL, but since you have the repo cloned, read the files directly from disk instead (e.g. `include::{codebase}/src/main/java/Foo.java[]` → read `<tmpdir>/{REPO_NAME}/src/main/java/Foo.java`). +3. If includes have `[lines="X..Y"]`, extract only those lines from the local file. +4. Note the `[source,lang]` block preceding each include — that determines the code fence language. + +This cloned repo also serves as the base for Step 6 (code verification) — you can run the tests directly in it to confirm they pass before updating the code to the latest API. + +## Step 2: Convert AsciiDoc to Markdown + +| AsciiDoc | Markdown | +|---|---| +| `== Heading` | `## Heading` | +| `=== Heading` | `### Heading` | +| `*bold*` (AsciiDoc bold) | `**bold**` | +| `https://url[Link text]` | `[Link text](url)` | +| `[source,lang]\n----\ncode\n----` | `` ```lang\ncode\n``` `` | +| `[source,shell]` with `$` prompts | `` ```console `` | +| `[NOTE]\ntext` or `====\n[NOTE]\n...\n====` | `> [!NOTE]\n> text` | +| `[TIP]\ntext` | `> [!TIP]\n> text` | +| `:toc:`, `:toclevels:`, `:codebase:` | Remove entirely | +| `include::{codebase}/path[]` | Replace with fetched code in a code fence | +| YAML front matter (date, draft, repo) | Remove; transform to Docker docs format | + +## Step 3: Apply Docker docs style rules + +These are mandatory (from STYLE.md and AGENTS.md): + +- **No "we"**: "We are going to create" → "Create" or "Start by creating" +- **No "let us" / "let's"**: → imperative voice or "You can..." +- **No hedge words**: remove "simply", "easily", "just", "seamlessly" +- **No meta-commentary**: remove "it's worth noting", "it's important to understand" +- **No "allows you to" / "enables you to"**: → "lets you" or rephrase +- **No "click"**: → "select" +- **No bold for emphasis or product names**: only bold UI elements +- **No time-relative language**: remove "currently", "new", "recently", "now" +- **No exclamations**: remove "Voila!!!" etc. +- Use `console` language hint for interactive shell blocks with `$` prompts +- Use contractions: "it's", "you're", "don't" + +## Step 4: Update code to latest Testcontainers API + +Research the latest API version for the target language before writing code. + +**Best practices reference**: The Testcontainers team maintains Claude skills with up-to-date API patterns and best practices for each language at https://github.com/testcontainers/claude-skills/ — check the relevant language skill (testcontainers-go, testcontainers-node, testcontainers-dotnet) for current API signatures, cleanup patterns, wait strategies, and anti-patterns to avoid. + +For each language, check the cloned repo's existing code, then update to the latest API. Key patterns per language: + +**Go** (testcontainers-go v0.41.0): +- `postgres.RunContainer(ctx, opts...)` → `postgres.Run(ctx, "image", opts...)` +- `testcontainers.WithImage(...)` → image is now the 2nd positional param to `Run()` +- Manual `WithWaitStrategy(wait.ForLog(...))` → `postgres.BasicWaitStrategies()` +- `t.Cleanup(func() { ctr.Terminate(ctx) })` → `testcontainers.CleanupContainer(t, ctr)` +- `if err != nil { log.Fatal(err) }` → `require.NoError(t, err)` (use testify require/assert) +- Helper functions should accept `t *testing.T` as first param, call `t.Helper()` +- No `TearDownSuite()` needed if `CleanupContainer` is registered in the helper +- Go version prerequisite: 1.25+ + +**Java** (testcontainers-java 2.0.4): +- Artifacts renamed in 2.x: `org.testcontainers:postgresql` → `org.testcontainers:testcontainers-postgresql` +- Check the latest version at https://java.testcontainers.org/ +- Use `@Testcontainers` and `@Container` annotations for JUnit 5 lifecycle +- Prefer module-specific containers (e.g. `PostgreSQLContainer`) over `GenericContainer` +- Use `@DynamicPropertySource` for Spring Boot integration + +**.NET** (testcontainers-dotnet): +- Check the latest NuGet package version +- Use `IAsyncLifetime` for container lifecycle in xUnit +- Use builder pattern: `new PostgreSqlBuilder().Build()` + +**Node.js** (testcontainers-node): +- Check the latest npm version +- Use module-specific packages (e.g. `@testcontainers/postgresql`) +- Use `GenericContainer` for services without a dedicated module + +**Python** (testcontainers-python): +- Check the latest PyPI version +- Use context managers (`with PostgresContainer() as postgres:`) +- Use module-specific containers when available + +For all languages: consult the corresponding Testcontainers skill at https://github.com/testcontainers/claude-skills/ for current best practices and anti-patterns. + +## Step 5: Create guide directory structure + +Directory: `content/guides/testcontainers-{LANG}-{GUIDE_ID}/` + +Each guide is its own top-level entry under `/guides/`. Do NOT nest guides inside a shared parent section — otherwise they won't appear individually in the tag/language filters on the guides listing page. + +### _index.md (landing page) + +```yaml +--- +title: {Full guide title} +linkTitle: {Short title for guides listing} +description: {One-line description} +keywords: testcontainers, {lang}, testing, {technologies used} +summary: | + {2-3 line summary for the guides listing card} +toc_min: 1 +toc_max: 2 +tags: [testing-with-docker] +languages: [{lang}] +params: + time: {estimated} minutes +--- + +<!-- Source: https://github.com/testcontainers/{REPO_NAME} --> +``` + +Content: what you'll learn (bulleted list), prerequisites, and a NOTE linking to `https://testcontainers.com/getting-started/` for newcomers. + +### Sub-pages (chapters) + +Split the guide into logical chapters. Each sub-page: + +```yaml +--- +title: {Chapter title} +linkTitle: {Short title for stepper} +description: {One-line description} +weight: {10, 20, 30, ...} +--- +``` + +**No `tags`, `languages`, or `params` on sub-pages** — only on `_index.md`. + +Typical chapter breakdown: +| Weight | File | Content | +|--------|------|---------| +| 10 | `create-project.md` | Project setup, dependencies, business logic | +| 20 | `write-tests.md` | First test using testcontainers | +| 30 | `test-suites.md` | Reusing containers, test helpers, suites | +| 40 | `run-tests.md` | Running tests, summary, further reading | + +Adapt the split to the guide's content — some guides may need fewer or more chapters. + +## Step 6: Verify code compiles and tests pass + +This is CRITICAL. The code in the guide MUST compile and all tests MUST pass. Do not skip this step. + +### 6a: Use the cloned repo as the verification project + +The repo you cloned in Step 1 (`<tmpdir>/{REPO_NAME}`) already contains a working project with all source files, build config, and tests. Use it as the starting point: + +```bash +cd <tmpdir>/{REPO_NAME} +``` + +First, verify the **original** code compiles and tests pass before you change anything. This confirms a good baseline. + +### 6b: Update the code in the cloned repo + +After confirming the original works, apply the API updates (from Step 4) directly in the cloned repo's source files. This is the same code you're putting in the guide — keep them in sync. + +### 6c: Update dependencies and compile + +Run compilation inside a container for reproducibility — no need to install the language toolchain on the host. Use the appropriate language Docker image, mounting the cloned repo: + +```bash +docker run --rm -v "<tmpdir>/{REPO_NAME}":/app -w /app <language-image> sh -c "<compile command>" +``` + +Pick the right image for the language (e.g. `golang:1.25-alpine`, `maven:3-eclipse-temurin-21`, `gradle:jdk21`, `mcr.microsoft.com/dotnet/sdk:9.0`, `node:22-alpine`, `python:3.13-alpine`). Update dependencies to the latest Testcontainers version and compile. + +If compilation fails, fix the code and update the guide markdown to match. + +### 6d: Run tests in a container with Docker socket mounted + +Run tests in the same kind of container, but **mount the Docker socket** so Testcontainers can create sibling containers. + +#### macOS Docker Desktop workarounds + +When running on macOS with Docker Desktop, these environment variables and flags are **required**: + +- **`TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal`** — On macOS, containers can't reach sibling containers via the Docker bridge IP (`172.17.0.x`). This tells Testcontainers (including Ryuk) to connect via `host.docker.internal` instead. **Do NOT disable Ryuk** — it is a core Testcontainers feature and the guides must demonstrate proper usage. +- **`docker-java.properties`** with `api.version=1.47` — Docker Desktop's minimum API version is 1.44, but docker-java defaults to 1.24. Create this file in the project root and mount it to `/root/.docker-java.properties` inside Java containers. +- **`-Dspotless.check.skip=true`** — The Spotless Maven plugin in the source repos is incompatible with JDK 21. Skip it since it's a code formatter, not part of the test. +- **`-Dmicronaut.test.resources.enabled=false`** — Micronaut's Test Resources service starts a separate process that can't connect to Docker from inside a container. The guide tests use Testcontainers directly, not Test Resources. Only needed for Micronaut guides. +#### Java guide test command + +```bash +# Create docker-java.properties in the project root +echo "api.version=1.47" > <tmpdir>/{REPO_NAME}/docker-java.properties + +docker run --rm \ + -v "<tmpdir>/{REPO_NAME}":/app \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v "<tmpdir>/{REPO_NAME}/docker-java.properties":/root/.docker-java.properties \ + -e DOCKER_HOST=unix:///var/run/docker.sock \ + -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal \ + -w /app \ + maven:3.9-eclipse-temurin-21 \ + mvn -B test -Dspotless.check.skip=true -Dspotless.apply.skip=true +``` + +For Quarkus guides, use `maven:3.9-eclipse-temurin-17` instead (Quarkus 3.22.3 compiles for Java 17). + +#### Go guide test command + +```bash +docker run --rm \ + -v "<tmpdir>/{REPO_NAME}":/app \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DOCKER_HOST=unix:///var/run/docker.sock \ + -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal \ + -w /app \ + golang:1.25-alpine \ + sh -c "apk add --no-cache gcc musl-dev && go test -v -count=1 ./..." +``` + +#### Python guide test command + +```bash +docker run --rm \ + -v "<tmpdir>/{REPO_NAME}":/app \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DOCKER_HOST=unix:///var/run/docker.sock \ + -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal \ + -w /app \ + python:3.13-slim \ + sh -c "pip install -r requirements.txt && python -m pytest" +``` + +#### .NET guide test command + +```bash +docker run --rm \ + -v "<tmpdir>/{REPO_NAME}":/app \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DOCKER_HOST=unix:///var/run/docker.sock \ + -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal \ + -w /app \ + mcr.microsoft.com/dotnet/sdk:9.0 \ + dotnet test +``` + +#### Node.js guide test command + +```bash +docker run --rm \ + -v "<tmpdir>/{REPO_NAME}":/app \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -e DOCKER_HOST=unix:///var/run/docker.sock \ + -e TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal \ + -w /app \ + node:22-alpine \ + sh -c "npm install && npm test" +``` + +#### Important: run tests sequentially + +Run guide tests **one at a time**. Running multiple concurrent DinD or sibling-container tests can overwhelm Docker Desktop's containerd store and cause `meta.db: input/output error` corruption, requiring a Docker Desktop restart. + +### 6e: Fix until green + +If any test fails, debug and fix the code in both the temporary project AND the guide markdown. Re-run until all tests pass. Do not proceed until verified. + +## Step 7: Update cross-references + +1. **`content/manuals/testcontainers.md`**: Add a bullet under the `## Guides` section: + ```markdown + - [Guide title](/guides/testcontainers-{LANG}-{GUIDE_ID}/) + ``` +2. **Do NOT update** `content/guides/testcontainers-cloud/_index.md` — keep its external links. +3. Link to `https://testcontainers.com/getting-started/` for the Testcontainers overview. +4. Use internal paths for already-migrated guides; keep `testcontainers.com` links for unmigrated ones. + +## Step 8: Validate + +**IMPORTANT**: Run ALL validation locally before committing. Vale checks run on CI and will block the PR if they fail — fixing after push wastes CI cycles and review time. + +1. `npx --no-install rumdl fmt content/guides/testcontainers-{LANG}-{GUIDE_ID}/` +2. `npx --no-install rumdl fmt content/manuals/testcontainers.md` +3. `docker buildx bake lint` — must pass with no errors +4. `docker buildx bake vale` — then check for errors in the new files: + ```bash + grep -A2 "testcontainers-{LANG}-{GUIDE_ID}" tmp/vale.out + ``` + Fix ALL errors before proceeding. Common issues: + - **Vale.Spelling**: tech terms (library names, tools) not in the dictionary → add to `_vale/config/vocabularies/Docker/accept.txt` (alphabetical order) + - **Vale.Terms**: wrong casing (e.g. "python" → "Python") → fix in the markdown. Watch for package names like `testcontainers-python` triggering false positives — rephrase to "Testcontainers for Python" in prose. + - **Docker.Avoid**: hedge words like "very", "simply" → reword + - **Docker.We**: first-person plural → rewrite to "you" or imperative + - Info-level suggestions (e.g. "VS Code" → "versus") are not blocking but review them + + Re-run `docker buildx bake vale` after fixes until no errors remain in the new files. +5. Verify in local dev server (`HUGO_PORT=1314 docker compose watch`): + - Guide appears when filtering by its language + - Guide appears when filtering by `Testing with Docker` tag + - Stepper navigation works across chapters + - All links resolve (no 404s) +6. Verify all external URLs return 200: + ```bash + curl -s -o /dev/null -w "%{http_code}" -L "{url}" + ``` + +## Step 9: Commit + +One commit per guide. Message format: +``` +feat(guides): add testcontainers {lang} {guide-id} guide + +Migrated from https://github.com/testcontainers/{REPO_NAME} +Updated to testcontainers-{lang} v{version} API. +``` + +## Special cases + +- **introducing-testcontainers**: Language-agnostic, conceptual. May overlap with `content/manuals/testcontainers.md`. Review for deduplication before migrating. +- **local-dev-testcontainers-desktop**: About Testcontainers Desktop (now part of Docker Desktop). May need significant rewriting rather than mechanical migration. +- **Java guides**: Many share the same language. Each still gets its own `testcontainers-java-{GUIDE_ID}` directory. + +## Reference: completed migration (Go getting-started) + +Use `content/guides/testcontainers-go-getting-started/` as the reference implementation: +- `_index.md` — landing page with frontmatter, prerequisites, learning objectives +- `create-project.md` (weight: 10) — project setup and business logic +- `write-tests.md` (weight: 20) — first test with testcontainers-go +- `test-suites.md` (weight: 30) — container reuse with testify suites +- `run-tests.md` (weight: 40) — running tests, summary, further reading diff --git a/.agents/skills/triage-issue/SKILL.md b/.agents/skills/triage-issue/SKILL.md new file mode 100644 index 000000000000..c4fcf19bb855 --- /dev/null +++ b/.agents/skills/triage-issue/SKILL.md @@ -0,0 +1,150 @@ +--- +name: triage-issue +description: > + Analyze a single GitHub issue for docker/docs — check whether the problem + still exists, determine a verdict, and report findings. Use when asked to + triage, assess, or review an issue, even if the user doesn't say "triage" + explicitly: "triage issue 1234", "is issue 500 still valid", "should we + close #200", "look at this issue", "what's going on with #200". +argument-hint: "<issue-number>" +context: fork +--- + +# Triage Issue + +Given GitHub issue **$ARGUMENTS** from docker/docs, figure out whether +it's still a real problem and say what should happen next. + +## 1. Fetch the issue + +```bash +gh issue view $ARGUMENTS --repo docker/docs \ + --json number,title,body,state,labels,createdAt,updatedAt,closedAt,assignees,author,comments +``` + +## 2. Understand the problem + +Read the issue body and all comments. Identify: + +- What is the reported problem? +- What content, URL, or file does it reference? +- Has anyone already proposed a fix or workaround in the comments? + +Check for linked PRs in the issue timeline, not only in the issue body or +comments: + +```bash +gh api repos/docker/docs/issues/$ARGUMENTS/timeline --paginate \ + --jq '.[] | select(.event=="cross-referenced" or .event=="connected" or .event=="referenced") | {event, created_at, source: .source.issue.html_url, title: .source.issue.title, state: .source.issue.state}' +``` + +If an open PR already addresses the issue, don't open another PR. Review the +existing PR instead, and report that the issue already has an associated PR. A +merged PR is strong evidence the issue is fixed. A closed-without-merge PR means +the issue is likely still open. + +## 3. Follow URLs + +Find all `docs.docker.com` URLs in the issue body and comments. For each: + +- Fetch the URL to check if it still exists (404 = content removed or moved) +- Check whether the content still contains the problem described +- Note when the page was last updated relative to when the issue was filed + +For non-docs URLs (GitHub links, external references), fetch them too if +they are central to understanding the issue. + +## 4. Check the repository + +If the issue references specific files, content sections, or code: + +- Find and read the current version of that content +- Check whether the problem has been fixed, content moved, or file removed +- Remember the `/manuals` prefix mapping when looking up files + +## 5. Check for upstream ownership + +If the issue is about content in `_vendor/` or `data/cli/`, it cannot be +fixed here. Identify which upstream repo owns it (see the vendored content +table in CLAUDE.md). + +## 6. Decide and act + +After investigating, pick one of these verdicts and take the corresponding +action on the issue: + +- **Close it** — the problem is already fixed, the content no longer exists, + or the issue is too outdated to be useful. Close the issue with a comment + explaining why: + + ```bash + gh issue close $ARGUMENTS --repo docker/docs \ + --comment "Closing: <one-sentence reason>" + ``` + +- **Fix it** — the problem is real and fixable in this repo. Name the + file(s) and what needs to change. Label the issue `status/confirmed` and + remove `status/triage` if present: + + ```bash + gh api repos/docker/docs/issues/$ARGUMENTS/labels \ + --method POST --field 'labels[]=status/confirmed' + gh api repos/docker/docs/issues/$ARGUMENTS/labels/status%2Ftriage \ + --method DELETE || true + ``` + +- **Escalate upstream** — the problem is real but lives in vendored content. + Name the upstream repo. Label the issue `status/upstream` and remove + `status/triage` if present: + + ```bash + gh api repos/docker/docs/issues/$ARGUMENTS/labels \ + --method POST --field 'labels[]=status/upstream' + gh api repos/docker/docs/issues/$ARGUMENTS/labels/status%2Ftriage \ + --method DELETE || true + ``` + +- **Leave it open** — you can't determine the current state, or the issue + needs human judgment. Label the issue `status/needs-analysis`: + + ```bash + gh api repos/docker/docs/issues/$ARGUMENTS/labels \ + --method POST --field 'labels[]=status/needs-analysis' + gh api repos/docker/docs/issues/$ARGUMENTS/labels/status%2Ftriage \ + --method DELETE || true + ``` + +Don't overthink the classification. An old issue isn't stale if the problem +still exists. An upstream issue is still valid — it's just not fixable here. + +Also apply the most relevant `area/` label based on the content affected. +Available area labels: `area/accounts`, `area/admin`, `area/ai`, +`area/api`, `area/billing`, `area/build`, `area/build-cloud`, `area/cli`, +`area/compose`, `area/compose-spec`, `area/config`, `area/contrib`, +`area/copilot`, `area/desktop`, `area/dhi`, `area/engine`, +`area/enterprise`, `area/extensions`, `area/get-started`, `area/guides`, +`area/hub`, `area/install`, `area/networking`, `area/offload`, +`area/release-notes`, `area/samples`, `area/scout`, `area/security`, +`area/storage`, `area/subscription`, `area/swarm`, `area/ux`. Pick one +(or at most two if the issue clearly spans areas). Skip if none fit. + +```bash +gh api repos/docker/docs/issues/$ARGUMENTS/labels \ + --method POST --field 'labels[]=area/<name>' +``` + +## 7. Report + +Write a short summary: what the issue reports, what you found, and what +should happen next. Reference the specific files, URLs, or PRs that support +your conclusion. Skip metadata fields — the issue itself has the dates and +labels. Mention the action you took (closed, labeled, etc.). + +## Notes + +- Always check timeline cross-references before deciding to fix an issue +- Do not narrate your process — produce the final report +- End every issue comment with an accurate agent-disclosure footer that names + the active coding agent, for example `Generated by Codex` or `Generated by +Claude Code`. +. diff --git a/.agents/skills/write/SKILL.md b/.agents/skills/write/SKILL.md new file mode 100644 index 000000000000..1b6879aa7d84 --- /dev/null +++ b/.agents/skills/write/SKILL.md @@ -0,0 +1,87 @@ +--- +name: write +description: > + Write a documentation fix on a branch. Makes the minimal change, formats, + self-reviews, and commits. Use after research has identified what to change. + "write the fix", "make the changes", "implement the fix for #1234". +hooks: + PostToolUse: + - matcher: "Edit|Write" + hooks: + - type: command + command: "bash ${CLAUDE_SKILL_DIR}/scripts/post-edit.sh" +--- + +# Write + +Make the minimal change that resolves the issue. Research has already +identified what to change — this skill handles the edit, formatting, +self-review, and commit. + +## 1. Create a branch + +```bash +git checkout -b fix/issue-<number>-<short-desc> main +``` + +Use a short kebab-case description derived from the issue title (3-5 words). + +## 2. Read then edit + +Always read each file before modifying it. Make the minimal change that +fixes the issue. Do not improve surrounding content, add comments, or +address adjacent problems. + +Follow the writing guidelines in CLAUDE.md, STYLE.md, and COMPONENTS.md. + +## 3. Front matter check + +Every content page requires `title`, `description`, and `keywords` in its +front matter. If any are missing from a file you touch, add them. + +## 4. Validate + +rumdl runs automatically after each edit via the PostToolUse hook. +Run lint manually after all edits are complete: + +```bash +scripts/lint.sh <changed-files> +``` + +The lint script runs rumdl and Vale on only the files you pass it, +so the output is scoped to your changes. Fix any errors it reports. + +## 5. Self-review + +Re-read each changed file: right file, right lines, change is complete, +front matter is present. Run `git diff` and verify only intended changes +are present. + +## 6. Commit + +Stage only the changed files: + +```bash +git add <files> +git diff --cached --name-only # verify — no package-lock.json or other noise +git commit -m "$(cat <<'EOF' +docs: <short description under 72 chars> (fixes #NNNN) + +<What was wrong: one sentence citing the specific problem.> +<What was changed: one sentence describing the exact edit.> + +Co-Authored-By: Claude <noreply@anthropic.com> +EOF +)" +``` + +The commit body is mandatory. A reviewer reading only the commit should +understand the problem and the fix without opening the issue. + +## Notes + +- Never edit `_vendor/` or `data/cli/` — these are vendored +- If a file doesn't exist, check for renames: + `git log --all --full-history -- "**/filename.md"` +- If the fix requires a URL that cannot be verified, stop and report a + blocker rather than guessing diff --git a/.agents/skills/write/scripts/post-edit.sh b/.agents/skills/write/scripts/post-edit.sh new file mode 100755 index 000000000000..73ac30611824 --- /dev/null +++ b/.agents/skills/write/scripts/post-edit.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# PostToolUse hook for Edit/Write in the write skill. +# Auto-formats Markdown files with rumdl after each edit. +set -euo pipefail + +input=$(cat) +file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty') + +[ -z "$file_path" ] && exit 0 +[[ "$file_path" != *.md ]] && exit 0 + +npx --no-install rumdl fmt "$file_path" 2>/dev/null diff --git a/.claude b/.claude new file mode 120000 index 000000000000..c0ca46856636 --- /dev/null +++ b/.claude @@ -0,0 +1 @@ +.agents \ No newline at end of file diff --git a/.dockerignore b/.dockerignore index 24fffe8d3b34..ff3cf374b3bc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,6 +3,7 @@ .gitignore .idea .hugo_build.lock +hugo_stats.json _releaser CONTRIBUTING.md Dockerfile diff --git a/.gitattributes b/.gitattributes index 2929076bea1e..5d685b7d139e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,3 +3,11 @@ # Fine-tune GitHub's language detection content/**/*.md linguist-detectable + +# Mark generated and vendored content +# These files should not be edited directly in this repository + +# Vendored Hugo modules (from upstream repositories) +/_vendor/** linguist-generated=true +# Generated CLI reference data (vendored from upstream) +/data/cli/** linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7c8329fc10fc..9d959ab3647a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,9 +3,9 @@ # For more details, see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners -/content/manuals/build/ @crazy-max @aevesdocker +/content/manuals/build/ @dvdksn -/content/manuals/build-cloud/ @crazy-max @aevesdocker +/content/manuals/build-cloud/ @craig-osterhout /content/manuals/compose/ @aevesdocker @@ -19,26 +19,28 @@ /content/manuals/docker-hub/ @craig-osterhout -/content/manuals/engine/ @thaJeztah @aevesdocker +/content/manuals/engine/ @dvdksn -/content/reference/api/engine/ @thaJeztah @aevesdocker +/content/reference/api/engine/ @dvdksn -/content/reference/cli/ @thaJeztah @aevesdocker +/content/reference/cli/ @dvdksn /content/manuals/subscription/ @sarahsanders-docker /content/manuals/security/ @aevesdocker @sarahsanders-docker -/content/manuals/trusted-content/ @craig-osterhout - -/content/manuals/docker-hub/official_images/ @craig-osterhout - -/content/manuals/registry/ @craig-osterhout - /content/manuals/admin/ @sarahsanders-docker /content/manuals/billing/ @sarahsanders-docker /content/manuals/accounts/ @sarahsanders-docker -/_vendor @sarahsanders-docker +/content/manuals/ai/ @dvdksn + +/content/manuals/ai/sandboxes/governance/ @craig-osterhout + +/_vendor @dvdksn + +/content/manuals/offload/ @craig-osterhout + +/content/manuals/dhi/ @craig-osterhout diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 8762e0feb7a1..33e46038c05d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -6,15 +6,9 @@ contact_links: - name: Moby url: https://github.com/moby/moby/issues about: Bug reports for Docker Engine - - name: Docker Desktop for Windows - url: https://github.com/docker/for-win/issues - about: Bug reports for Docker Desktop for Windows - - name: Docker Desktop for Mac - url: https://github.com/docker/for-mac/issues - about: Bug reports for Docker Desktop for Mac - - name: Docker Desktop for Linux - url: https://github.com/docker/for-linux/issues - about: Bug reports for Docker Desktop for Linux + - name: Docker Desktop + url: https://github.com/docker/desktop-feedback + about: Bug reports for Docker Desktop - name: Docker Compose url: https://github.com/docker/compose/issues about: Bug reports for Docker Compose diff --git a/.github/agents/docs-scanner.yaml b/.github/agents/docs-scanner.yaml new file mode 100644 index 000000000000..88b660f64b4e --- /dev/null +++ b/.github/agents/docs-scanner.yaml @@ -0,0 +1,189 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/docker/docker-agent/refs/heads/main/cagent-schema.json +models: + claude-sonnet: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 8192 + temperature: 0.3 + +agents: + root: + model: claude-sonnet + description: Daily documentation quality scanner for Docker docs + add_prompt_files: + - STYLE.md + instruction: | + You are an experienced technical writer reviewing Docker documentation + (https://docs.docker.com/) for substantive quality problems. The docs + are maintained in this repository under content/. Your job is to read a + subsection of the docs, identify genuine problems a reader would notice, + and file GitHub issues only for the ones that are clearly worth fixing. + + ## Setup + + 1. Read `.cache/scan-history.json` using `read_file`. + This file tracks every previously scanned directory as a JSON object: + ```json + { + "scanned": { + "content/manuals/desktop/networking/": "2026-02-24", + "content/manuals/build/cache/": "2026-02-23" + } + } + ``` + If the file does not exist or is empty, treat it as `{"scanned": {}}`. + + 2. Call `get_memories` to load any learned patterns from previous scans + (false positives to skip, codebase context, human feedback). + + 3. Use `list_directory` to explore `content/manuals/` and find all leaf + directories (no subdirectories). Skip these top-level paths entirely: + content/reference/, content/languages/, content/tags/, + content/includes/. + + 4. Pick a leaf directory to scan: + - FIRST CHOICE: a directory that does NOT appear in scan-history.json + - FALLBACK: if every leaf directory has been scanned, pick the one + with the OLDEST date in scan-history.json + + 5. Call `directory_tree` on the selected leaf and read ALL its files. + Cross-referencing between files in the same directory is one of the + most valuable things you can do — read everything before drawing + conclusions. + + 6. Analyze the files, apply the self-check below, then file issues only + for what passes. **File only what is genuinely worth fixing.** If you + find one strong issue, file one. If you find nothing substantive, file + zero. A run with zero issues is a success, not a failure. Do not + search for issues to fill a quota. + + 7. After scanning, update `.cache/scan-history.json` using `write_file`. + Read the current content, add or update the scanned path with today's + date (YYYY-MM-DD), and write the full updated JSON back. + + 8. If you learn anything useful for future scans (false positive patterns, + codebase context), call `add_memory` to store it. Do NOT use + `add_memory` for scan tracking — that is what scan-history.json is for. + + ## What good issues look like + + Ask yourself: would a reader following this documentation be confused or + misled? The bar is high. File issues only when the answer is clearly yes. + + - **Cross-document contradictions**: two pages in the same directory give + conflicting information about the same feature or procedure — one says + the flag is required, another says it's optional; one gives different + default values than another + - **Completed transitions still framed as in-progress**: prose says "is + being migrated to", "will replace", "is rolling out", or "is in the + process of" for something that sibling pages or other context show has + already happened + - **Clearly wrong version framing**: a page treats a years-old release as + "new" or "recent" in a way that makes readers doubt whether the docs + reflect current reality (e.g. "Docker Engine 23.0 introduced this" where + 23.0 shipped in 2023 and the framing suggests it was recent) + - **Broken cross-reference context**: a link's surrounding prose describes + a destination that no longer matches what the linked page actually covers + (the URL may resolve, but the context is wrong) + - **Missing deprecation notice**: a page describes a feature that is + removed or deprecated with no notice pointing readers elsewhere + + ## Before filing — self-check + + Answer these four questions. If you can't answer 1 and 2 with yes, or if + 3 or 4 is yes, do not file the issue. + + 1. Can I quote the specific wrong text from the file? + 2. Would a reader following this documentation actually be confused or + misled — not just a style nitpick, but a real comprehension problem? + 3. Is this something already caught by automated tooling? + - Broken or missing links → htmltest catches these; do not file + - Time-relative words ("currently", "recently", "still", "yet", + "new") with no broader context problem → Vale catches these + - Formatting or style problems → rumdl/Vale catch these + 4. Is this a legitimate product feature gate? "Limited Access", "Contact + your Docker account team to request access", "available on paid plans", + "coming soon for Business subscribers" are product decisions, not stale + documentation — do not flag them. + + ## What not to file + + - **Broken links** — htmltest catches these; do not file. This includes + links to non-existent files within the repo ("broken cross-reference" + is still a broken link). Only file if the URL resolves but the + surrounding prose misdescribes the destination. + - **Single time-relative words** in otherwise accurate sentences — + "currently", "recently", "still", "yet", "usually" — Vale already flags + these; your job is to find problems Vale can't see + - **Feature gates and access tiers** — "Limited Access" badges, "Contact + sales", "request access" language — these are intentional product + decisions + - **Vague verification tasks** — "verify this diagram is up to date", + "check these links are still valid" — if you cannot identify the + specific problem from reading the file, don't file + - **Style and formatting** — Vale and rumdl handle these + - **Suspicions without evidence** — you must quote the specific wrong text + + ## Filing issues + + Check for duplicates first: + ```bash + FILE_PATH="path/to/file.md" + gh issue list --repo docker/docs --label "agent/generated" --state open --search "in:body \"$FILE_PATH\"" + ``` + + Then create: + ```bash + ISSUE_TITLE="[docs-scanner] Brief description" + cat << 'EOF' | gh issue create \ + --repo docker/docs \ + --title "$ISSUE_TITLE" \ + --label "agent/generated" \ + --body-file - + **File:** `path/to/file.md` + + ### Issue + + What's wrong, with an exact quote from the file: + + > quoted text + + ### Why this matters + + Explain how a reader would be confused or misled by this. + + ### Suggested fix + + What should change, with specific alternative wording where possible. + + --- + *Found by nightly documentation quality scanner* + EOF + ``` + + ## Output + + ``` + SCAN COMPLETE + Subsection: content/manuals/desktop/features/ + Files checked: N + Issues created: N (or "0 — nothing substantive found") + - #123: [docs-scanner] Issue title + ``` + + toolsets: + - type: filesystem + tools: + - read_file + - read_multiple_files + - write_file + - list_directory + - directory_tree + - type: memory + path: .cache/scanner-memory.db + - type: shell + +permissions: + allow: + - shell:cmd=gh issue list --* + - shell:cmd=gh issue create --* diff --git a/.github/agents/whats-new-examples/2026-07-13--2026-08-11.json b/.github/agents/whats-new-examples/2026-07-13--2026-08-11.json new file mode 100644 index 000000000000..0277ac5b85c3 --- /dev/null +++ b/.github/agents/whats-new-examples/2026-07-13--2026-08-11.json @@ -0,0 +1,96 @@ +{ + "period_start": "2026-07-13", + "period_end": "2026-08-11", + "items": [ + { + "product": "Docker Desktop", + "title": "Use Docker VMM on Mac and Windows", + "description": "Run Docker Desktop with Docker's container-optimized hypervisor on supported Mac and Windows systems.", + "url": "/desktop/features/vmm/", + "published": "2026-08-10", + "source_prs": [25702, 25726], + "featured": true + }, + { + "product": "Docker Sandboxes", + "title": "Connect sandboxes through an MCP gateway", + "description": "Register local or remote MCP servers on the host, reuse them across sandboxes, and govern server and tool access with Cedar policies.", + "url": "/ai/sandboxes/mcp-gateway/", + "published": "2026-08-06", + "source_prs": [25559, 25707], + "featured": true + }, + { + "product": "Docker Sandboxes", + "title": "Author version 2 sandbox kits", + "description": "Define kit setup, permissions, networking, and API key or OAuth credential requirements with the version 2 kit schema.", + "url": "/ai/sandboxes/customize/kit-reference/#schema-versions", + "published": "2026-08-06", + "source_prs": [25467, 25707], + "featured": false + }, + { + "product": "Docker Sandboxes", + "title": "Run Claude Code with local models", + "description": "Route Claude Code sandbox requests to the bundled local-model server or an existing Ollama installation.", + "url": "/ai/sandboxes/agents/claude-code/#use-a-local-model", + "published": "2026-08-06", + "source_prs": [25641, 25707], + "featured": false + }, + { + "product": "Docker AI Governance", + "title": "Search and forward audit events", + "description": "Search and export policy decisions from Docker Cloud, or forward events to Splunk, Dynatrace, and custom HTTPS endpoints.", + "url": "/ai/sandboxes/governance/audit/", + "published": "2026-08-03", + "source_prs": [25679, 25687], + "featured": true + }, + { + "product": "Docker Desktop", + "title": "Install from the Microsoft Store without administrator privileges", + "description": "Fresh Microsoft Store installations on Windows use per-user mode by default.", + "url": "/desktop/release-notes/#4850", + "published": "2026-08-03", + "source_prs": [25665], + "featured": false + }, + { + "product": "Docker Sandboxes", + "title": "Share agent skills across sandboxes", + "description": "Import skills from supported host agents into a persistent store that sandboxes can share.", + "url": "/ai/sandboxes/workflows/#share-agent-skills", + "published": "2026-07-24", + "source_prs": [25588], + "featured": false + }, + { + "product": "Docker Sandboxes", + "title": "Connect editors and desktop apps over SSH", + "description": "Use a sandbox from VS Code, Cursor, Claude Desktop, ChatGPT, or another SSH-capable tool.", + "url": "/ai/sandboxes/integrations/", + "published": "2026-07-24", + "source_prs": [25557], + "featured": true + }, + { + "product": "Docker Hardened Images", + "title": "Query the DHI catalog from AI assistants", + "description": "Search DHI repositories, inspect images, retrieve SBOMs, check CVEs, and manage mirrors through the DHI MCP server.", + "url": "/dhi/tools/mcp/", + "published": "2026-07-23", + "source_prs": [25589], + "featured": false + }, + { + "product": "Docker Enterprise", + "title": "Authenticate GitHub Actions with OIDC connections", + "description": "Exchange GitHub OIDC tokens for short-lived access to Docker resources without storing long-lived workflow credentials.", + "url": "/enterprise/security/oidc-connections/", + "published": "2026-07-21", + "source_prs": [25336], + "featured": true + } + ] +} diff --git a/.github/agents/whats-new-examples/2026-07-13--2026-08-11.yaml b/.github/agents/whats-new-examples/2026-07-13--2026-08-11.yaml new file mode 100644 index 000000000000..da5a56f64868 --- /dev/null +++ b/.github/agents/whats-new-examples/2026-07-13--2026-08-11.yaml @@ -0,0 +1,39 @@ +# Human-reviewed example and regression criteria for the curate-whats-new skill. +# This file is not loaded into the skill's runtime context. +period_start: 2026-07-13 +period_end: 2026-08-11 +example_output: 2026-07-13--2026-08-11.json + +expected_archive: + - Docker VMM on Mac and Windows + - Docker Sandboxes MCP gateway + - Docker Sandboxes kit schema version 2 + - Claude Code with local models + - Docker AI Governance audit search, export, and forwarding + - Microsoft Store per-user installation + - Shared agent skills across sandboxes + - Docker Sandboxes editor and app integrations + - Docker Hardened Images MCP server + - Enterprise OIDC connections + +featured_guidance: + strong: + - Docker VMM on Mac and Windows + - Docker AI Governance audit search, export, and forwarding + - Docker Sandboxes editor and app integrations + - Enterprise OIDC connections + either_is_reasonable: + - Docker Sandboxes MCP gateway + - Docker Sandboxes kit schema version 2 + +must_exclude: + - Gordon safety modes and custom rules + - Swarm direct server return networking + - Engine image mounts + - Unix sockets on Windows + - Narrow flags, command variants, protocol options, and compatibility switches + +notes: + - Do not require product diversity. + - Treat featured choices as editorial judgment, not an exact golden ordering. + - Reject lower-level or incremental changes even when they are technically new. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b34db2bb4014..4382b20c4501 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,26 @@ +--- version: 2 updates: - - package-ecosystem: "github-actions" + - package-ecosystem: github-actions + directory: / + cooldown: + default-days: 7 open-pull-requests-limit: 10 - directory: "/" schedule: - interval: "daily" + interval: daily + - package-ecosystem: npm + directory: / + schedule: + interval: daily + allow: + - dependency-name: '@docker/marlin-sdk-web-public' + open-pull-requests-limit: 1 + + - package-ecosystem: gomod + directory: / + cooldown: + default-days: 7 + ignore: + - dependency-name: '*' + schedule: + interval: weekly diff --git a/.github/labeler.yml b/.github/labeler.yml index 11cef0e77f6d..d7a4a910758e 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,3 +1,9 @@ +area/ai: + - changed-files: + - any-glob-to-any-file: + - content/manuals/ai/** + - content/reference/cli/model/** + area/release: - changed-files: - any-glob-to-any-file: @@ -26,7 +32,7 @@ area/tests: - changed-files: - any-glob-to-any-file: - .htmltest.yml - - .markdownlint.json + - .rumdl.toml - .vale.ini - _vale/** - hack/test/* @@ -44,6 +50,11 @@ area/build-cloud: - any-glob-to-any-file: - content/manuals/build-cloud/** +area/offload: + - changed-files: + - any-glob-to-any-file: + - content/manuals/offload/** + area/compose: - changed-files: - any-glob-to-any-file: @@ -56,6 +67,11 @@ area/desktop: - any-glob-to-any-file: - content/manuals/desktop/** +area/dhi: + - changed-files: + - any-glob-to-any-file: + - content/manuals/dhi/** + area/engine: - changed-files: - any-glob-to-any-file: @@ -165,6 +181,11 @@ area/copilot: - any-glob-to-any-file: - content/manuals/copilot/** +ci: + - changed-files: + - any-glob-to-any-file: + - .github/workflows/** + hugo: - changed-files: - any-glob-to-any-file: @@ -173,7 +194,6 @@ hugo: - hugo_stats.json - i18n/** - layouts/** - - postcss.config.js - static/** - tailwind.config.js diff --git a/.github/prompts/freshness-tier1.prompt.md b/.github/prompts/freshness-tier1.prompt.md new file mode 100644 index 000000000000..41a784ccb232 --- /dev/null +++ b/.github/prompts/freshness-tier1.prompt.md @@ -0,0 +1,17 @@ +--- +mode: 'edit' +--- + +Imagine you're an experienced technical writer. You need to review content for +how fresh and up to date it is. Apply the following: + +1. Fix spelling errors and typos +2. Verify whether the markdown structure conforms to common markdown standards +3. Ensure the content follows our [style guide file](../instructions/styleguide-instructions.md) as a guide. +4. Make sure the titles on the page provide better context about the content (for an improved search experience). +5. Ensure all the components formatted correctly. +6. Improve the SEO keywords. +7. If you find numbered lists, make sure their numbering only uses 1's. +8. Ensure each line is limited to 80 characters. + +Do your best and don't be lazy. \ No newline at end of file diff --git a/.github/prompts/freshness-tier2.prompt.md b/.github/prompts/freshness-tier2.prompt.md new file mode 100644 index 000000000000..e6cd05cba72e --- /dev/null +++ b/.github/prompts/freshness-tier2.prompt.md @@ -0,0 +1,23 @@ +--- +mode: 'edit' +--- + +Imagine you're an experienced technical writer. You need to review content for +how fresh and up to date it is. Apply the following: + +1. Improve the presentational layer - components, splitting up the page into smaller pages + Consider the following: + + 1. Can you use tabs to display multiple variants of the same steps? + 2. Can you make a key item of information stand out with a call-out? + 3. Can you reduce a large amount of text to a series of bullet points? + 4. Are there other code components you could use? +2. Check if any operating systems or package versions mentioned are still current and supported +3. Check the accuracy of the content +4. If appropriate, follow the document from start to finish to see if steps make sense in sequence +5. Try to add some helpful next steps to the end of the document, but only if there are no *Next steps* or *Related pages* section, already. +6. Try to clarify, shorten or improve the efficiency of some sentences. +7. Check for LLM readability. +8. Ensure each line is limited to 80 characters. + +Do your best and don't be lazy. diff --git a/.github/prompts/review.prompt.md b/.github/prompts/review.prompt.md new file mode 100644 index 000000000000..47a39e8e14c5 --- /dev/null +++ b/.github/prompts/review.prompt.md @@ -0,0 +1,7 @@ +--- +mode: edit +description: You are a technical writer reviewing an article for clarity, conciseness, and adherence to the documentation writing style guidelines. +--- +Review the article for clarity, conciseness, and adherence to our documentation [style guidelines](../instructions/styleguide-instructions.md). + +Provide concrete and practical suggestions for improvement. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b62404c71e05..f92187e766b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,20 +25,19 @@ jobs: steps: - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 with: version: ${{ env.SETUP_BUILDX_VERSION }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} - name: Build - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: files: | docker-bake.hcl - targets: releaser-build - set: | - *.cache-from=type=gha,scope=releaser - *.cache-to=type=gha,scope=releaser,mode=max + targets: | + releaser-build + releaser-test build: runs-on: ubuntu-24.04 @@ -47,24 +46,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 - name: Build - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: source: . files: | docker-bake.hcl targets: release - set: | - *.cache-from=type=gha,scope=build - *.cache-to=type=gha,scope=build,mode=max - name: Check Cloudfront config - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: source: . targets: aws-cloudfront-update @@ -74,17 +70,6 @@ jobs: AWS_CLOUDFRONT_ID: 0123456789ABCD AWS_LAMBDA_FUNCTION: DockerDocsRedirectFunction-dummy - vale: - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: errata-ai/vale-action@reviewdog - env: - PIP_BREAK_SYSTEM_PACKAGES: 1 - with: - files: content - validate: runs-on: ubuntu-24.04 strategy: @@ -92,24 +77,35 @@ jobs: matrix: target: - lint + - vale - test - unused-media - test-go-redirects - dockerfile-lint - - path-warnings + - validate-vendor steps: + - + name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 - name: Validate - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: + source: . files: | docker-bake.hcl targets: ${{ matrix.target }} - set: | - *.args.BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 - *.cache-to=type=gha,scope=validate-${{ matrix.target }},mode=max - *.cache-from=type=gha,scope=validate-${{ matrix.target }} - *.cache-from=type=gha,scope=build + - + name: Install reviewdog + if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }} + uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 + - + name: Run reviewdog for vale + if: ${{ matrix.target == 'vale' && github.event_name == 'pull_request' }} + run: | + cat ./tmp/vale.out | reviewdog -f=rdjsonl -name=vale -reporter=github-pr-annotations -fail-on-error=false -filter-mode=added -level=info -fail-level=warning + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8ce0b6285e80..4570805dc6af 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,5 @@ name: deploy - +# Deploys the Docker Docs website when merging to the `main` branch. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -8,9 +8,8 @@ on: workflow_dispatch: push: branches: - - lab - main - - published + - lab env: # Use edge release of buildx (latest RC, fallback to latest stable) @@ -22,88 +21,54 @@ permissions: id-token: write contents: read +# The `main` branch is deployed to the production environment. +# The `lab` branch is deployed to a separate environment for testing purposes. jobs: publish: runs-on: ubuntu-24.04 if: github.repository_owner == 'docker' steps: - - - name: Prepare - run: | - HUGO_ENV=development - DOCS_AWS_REGION=us-east-1 - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - HUGO_ENV=staging - DOCS_URL="https://docs-stage.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/stage-docs-docs.docker.com-20220818202135984800000001" - DOCS_S3_BUCKET="stage-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E1R7CSW3F0X4H8" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-stage" - DOCS_SLACK_MSG="Successfully deployed docs-stage from main branch. $DOCS_URL" - elif [ "${{ github.ref }}" = "refs/heads/published" ]; then - HUGO_ENV=production - DOCS_URL="https://docs.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/prod-docs-docs.docker.com-20220818202218674300000001" - DOCS_S3_BUCKET="prod-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E228TTN20HNU8F" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-prod" - DOCS_SLACK_MSG="Successfully deployed docs from published branch. $DOCS_URL" - elif [ "${{ github.ref }}" = "refs/heads/lab" ]; then - HUGO_ENV=lab - DOCS_URL="https://docs-labs.docker.com" - DOCS_AWS_IAM_ROLE="arn:aws:iam::710015040892:role/labs-docs-docs.docker.com-20220818202218402500000001" - DOCS_S3_BUCKET="labs-docs-docs.docker.com" - DOCS_S3_CONFIG="s3-config.json" - DOCS_CLOUDFRONT_ID="E1MYDYF65FW3HG" - DOCS_LAMBDA_FUNCTION_REDIRECTS="DockerDocsRedirectFunction-labs" - else - echo >&2 "ERROR: unknown branch ${{ github.ref }}" - exit 1 - fi - SEND_SLACK_MSG="true" - if [ -z "$DOCS_AWS_IAM_ROLE" ] || [ -z "$DOCS_S3_BUCKET" ] || [ -z "$DOCS_CLOUDFRONT_ID" ] || [ -z "$DOCS_SLACK_MSG" ]; then - SEND_SLACK_MSG="false" - fi - echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - echo "HUGO_ENV=$HUGO_ENV" >> $GITHUB_ENV - echo "DOCS_URL=$DOCS_URL" >> $GITHUB_ENV - echo "DOCS_AWS_REGION=$DOCS_AWS_REGION" >> $GITHUB_ENV - echo "DOCS_AWS_IAM_ROLE=$DOCS_AWS_IAM_ROLE" >> $GITHUB_ENV - echo "DOCS_S3_BUCKET=$DOCS_S3_BUCKET" >> $GITHUB_ENV - echo "DOCS_S3_CONFIG=$DOCS_S3_CONFIG" >> $GITHUB_ENV - echo "DOCS_CLOUDFRONT_ID=$DOCS_CLOUDFRONT_ID" >> $GITHUB_ENV - echo "DOCS_LAMBDA_FUNCTION_REDIRECTS=$DOCS_LAMBDA_FUNCTION_REDIRECTS" >> $GITHUB_ENV - echo "DOCS_SLACK_MSG=$DOCS_SLACK_MSG" >> $GITHUB_ENV - echo "SEND_SLACK_MSG=$SEND_SLACK_MSG" >> $GITHUB_ENV - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: fetch-depth: 0 + - + name: Set environment variables + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + env: + INPUT_GITHUB-REF: ${{ github.ref }} + with: + script: | + const fs = require('fs'); + const env = JSON.parse(fs.readFileSync('hack/releaser/env.json', 'utf8')); + const ref = core.getInput('github-ref'); + if (!env.hasOwnProperty(ref)) { + core.setFailed(`ERROR: unknown branch ${ref}`); + } + for (const [key, value] of Object.entries(env[ref])) { + core.exportVariable(key, value); + core.info(`${key}=${value}`); + } - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 with: version: ${{ env.SETUP_BUILDX_VERSION }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} - name: Build website - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: source: . files: | docker-bake.hcl targets: release - set: | - *.cache-from=type=gha,scope=deploy-${{ env.BRANCH_NAME }} - *.cache-to=type=gha,scope=deploy-${{ env.BRANCH_NAME }},mode=max provenance: false - name: Configure AWS Credentials if: ${{ env.DOCS_AWS_IAM_ROLE != '' }} - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1 with: role-to-assume: ${{ env.DOCS_AWS_IAM_ROLE }} aws-region: ${{ env.DOCS_AWS_REGION }} @@ -112,7 +77,6 @@ jobs: if: ${{ env.DOCS_S3_BUCKET != '' }} run: | aws --region ${{ env.DOCS_AWS_REGION }} s3 sync \ - --acl public-read \ --delete \ --exclude "*" \ --include "*.webp" \ @@ -121,29 +85,37 @@ jobs: --content-type="image/webp" \ public s3://${{ env.DOCS_S3_BUCKET }}/ aws --region ${{ env.DOCS_AWS_REGION }} s3 sync \ - --acl public-read \ --delete \ --exclude "*.webp" \ + --exclude "pagefind/*.pf_meta" \ + --exclude "pagefind/fragment/*.pf_fragment" \ public s3://${{ env.DOCS_S3_BUCKET }}/ - - name: Update S3 config - if: ${{ env.DOCS_S3_BUCKET != '' && env.DOCS_S3_CONFIG != '' }} - uses: docker/bake-action@v6 - with: - source: . - files: | - docker-bake.hcl - targets: aws-s3-update-config - set: | - *.cache-from=type=gha,scope=releaser - env: - AWS_REGION: ${{ env.DOCS_AWS_REGION }} - AWS_S3_BUCKET: ${{ env.DOCS_S3_BUCKET }} - AWS_S3_CONFIG: ${{ env.DOCS_S3_CONFIG }} + name: Upload pagefind files with compression headers + if: ${{ env.DOCS_S3_BUCKET != '' }} + run: | + aws --region ${{ env.DOCS_AWS_REGION }} s3 cp \ + --recursive \ + --content-encoding="gzip" \ + --content-type="application/octet-stream" \ + --metadata-directive="REPLACE" \ + public/pagefind/ s3://${{ env.DOCS_S3_BUCKET }}/pagefind/ \ + --exclude "*" \ + --include "*.pf_meta" \ + --include "*.pf_fragment" + - + name: Set markdown Content-Type on llms.txt + if: ${{ env.DOCS_S3_BUCKET != '' }} + run: | + aws --region ${{ env.DOCS_AWS_REGION }} s3 cp \ + s3://${{ env.DOCS_S3_BUCKET }}/llms.txt \ + s3://${{ env.DOCS_S3_BUCKET }}/llms.txt \ + --content-type="text/markdown" \ + --metadata-directive="REPLACE" - name: Update Cloudfront config if: ${{ env.DOCS_CLOUDFRONT_ID != '' }} - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: source: . files: | @@ -161,8 +133,3 @@ jobs: env: AWS_REGION: us-east-1 # cloudfront is only available in us-east-1 region AWS_MAX_ATTEMPTS: 5 - - - name: Send Slack notification - if: ${{ env.SEND_SLACK_MSG == 'true' }} - run: | - curl -X POST -H 'Content-type: application/json' --data '{"text":"${{ env.DOCS_SLACK_MSG }}"}' ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index bdaa6a0e52b2..f04373c54158 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,11 +1,11 @@ name: labeler concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true on: - pull_request_target: + pull_request_target: # zizmor: ignore[dangerous-triggers] safe here, this workflow only applies labels and never checks out or executes PR code jobs: labeler: @@ -16,4 +16,4 @@ jobs: steps: - name: Run - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0 + uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0 diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index 7b842d08e746..000000000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: merge - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# open or update publishing PR when there is a push to main -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - main-to-published: - runs-on: ubuntu-24.04 - if: github.repository_owner == 'docker' - steps: - - uses: actions/checkout@v4 - with: - ref: published - - name: Reset published branch - run: | - git fetch origin main:main - git reset --hard main - - name: Create Pull Request - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e - with: - delete-branch: false - branch: published-update - commit-message: publish updates from main - labels: area/release - title: publish updates from main - body: | - Automated pull request for publishing docs updates. diff --git a/.github/workflows/nightly-docs-scan.yml b/.github/workflows/nightly-docs-scan.yml new file mode 100644 index 000000000000..24022dda42fe --- /dev/null +++ b/.github/workflows/nightly-docs-scan.yml @@ -0,0 +1,86 @@ +name: Nightly Documentation Scan + +on: + schedule: + # Run every day at 3am UTC + - cron: "0 3 * * *" + workflow_dispatch: + inputs: + dry-run: + description: "Report issues but do not create them" + type: boolean + default: false + +permissions: + contents: read + issues: write + +concurrency: + group: nightly-docs-scan + cancel-in-progress: false + +jobs: + scan: + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + id-token: write + contents: read + issues: write + + steps: + - name: Checkout repository + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + fetch-depth: 1 + + - name: Ensure cache directory exists + run: mkdir -p "${{ github.workspace }}/.cache" + + - name: Restore scanner state + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: | + ${{ github.workspace }}/.cache/scanner-memory.db + ${{ github.workspace }}/.cache/scan-history.json + key: docs-scanner-state-${{ github.repository }}-${{ github.run_id }} + restore-keys: | + docs-scanner-state-${{ github.repository }}- + + - name: Configure AWS credentials + id: aws-credentials + continue-on-error: true + uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1 + with: + role-to-assume: arn:aws:iam::710015040892:role/docker-agent-action-20260409141318957000000001 + aws-region: us-east-1 + + - name: Fetch bot PAT + if: steps.aws-credentials.outcome == 'success' + run: | + PAT=$(aws secretsmanager get-secret-value \ + --secret-id docker-agent-action/github-app \ + --query SecretString \ + --output text | jq -r '.pat') + echo "::add-mask::$PAT" + echo "GITHUB_APP_TOKEN=$PAT" >> "$GITHUB_ENV" + + - name: Run documentation scan + uses: docker/docker-agent-action@e96a4bb40cac114f64358621e1d08346c8eadc8c # v2.0.1 + env: + GH_TOKEN: ${{ env.GITHUB_APP_TOKEN || github.token }} + with: + agent: ${{ github.workspace }}/.github/agents/docs-scanner.yaml + prompt: "${{ inputs.dry-run == true && 'DRY RUN MODE: Do not create any GitHub issues. Report what you would create but skip the gh issue create commands.' || 'Run the nightly documentation scan as described in your instructions.' }}" + anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }} + github-token: ${{ env.GITHUB_APP_TOKEN || github.token }} + timeout: 1200 + + - name: Save scanner state + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + if: always() + with: + path: | + ${{ github.workspace }}/.cache/scanner-memory.db + ${{ github.workspace }}/.cache/scan-history.json + key: docs-scanner-state-${{ github.repository }}-${{ github.run_id }} diff --git a/.github/workflows/notify-release-notes-pr.yml b/.github/workflows/notify-release-notes-pr.yml new file mode 100644 index 000000000000..81db118a51b1 --- /dev/null +++ b/.github/workflows/notify-release-notes-pr.yml @@ -0,0 +1,45 @@ +name: Notify Slack on Desktop Release Notes PR + +on: + workflow_run: + workflows: ["Release Notes PR Trigger"] + types: [completed] + +jobs: + notify: + runs-on: ubuntu-24.04 + if: github.repository_owner == 'docker' && github.event.workflow_run.conclusion == 'success' + steps: + - name: Download PR details + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: pr-details + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + + - name: Read PR details + id: pr + run: | + echo "url=$(jq -r .url pr-details.json)" >> "$GITHUB_OUTPUT" + echo "title=$(jq -r .title pr-details.json)" >> "$GITHUB_OUTPUT" + echo "author=$(jq -r .author pr-details.json)" >> "$GITHUB_OUTPUT" + + - name: Notify Slack + uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 + with: + method: chat.postMessage + token: ${{ secrets.SLACK_BOT_TOKEN }} + payload: | + { + "channel": "${{ secrets.SLACK_RELEASE_CHANNEL_ID }}", + "text": "Desktop release notes", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": ":memo: *Desktop release notes*:\n<${{ steps.pr.outputs.url }}|${{ steps.pr.outputs.title }}> by <https://github.com/${{ steps.pr.outputs.author }}|${{ steps.pr.outputs.author }}>" + } + } + ] + } diff --git a/.github/workflows/pr-review-trigger.yml b/.github/workflows/pr-review-trigger.yml new file mode 100644 index 000000000000..4606240577a2 --- /dev/null +++ b/.github/workflows/pr-review-trigger.yml @@ -0,0 +1,41 @@ +name: PR Review - Trigger +on: + pull_request: + types: [opened, review_requested] + pull_request_review_comment: + types: [created] + +permissions: {} + +jobs: + save-context: + if: > + github.event_name != 'pull_request' || + github.event.action != 'review_requested' || + github.event.requested_reviewer.login == 'docker-agent' + runs-on: ubuntu-latest + steps: + - name: Save event context + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + REQUESTED_REVIEWER: ${{ github.event.requested_reviewer.login }} + COMMENT_JSON: ${{ toJSON(github.event.comment) }} + run: | + mkdir -p context + printf '%s' "${{ github.event_name }}" > context/event_name.txt + printf '%s' "$PR_NUMBER" > context/pr_number.txt + printf '%s' "$PR_HEAD_SHA" > context/pr_head_sha.txt + if [ "${{ github.event_name }}" = "pull_request" ]; then + printf '%s' "$REQUESTED_REVIEWER" > context/requested_reviewer.txt + fi + if [ "${{ github.event_name }}" = "pull_request_review_comment" ]; then + printf '%s' "$COMMENT_JSON" > context/comment.json + fi + + - name: Upload context + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: pr-review-context + path: context/ + retention-days: 1 diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml new file mode 100644 index 000000000000..e91f1f3c99fc --- /dev/null +++ b/.github/workflows/pr-review.yml @@ -0,0 +1,93 @@ +name: PR Review +on: + issue_comment: + types: [created] + workflow_run: + workflows: ["PR Review - Trigger"] + types: [completed] + +permissions: + contents: read # Required at top-level to give `issue_comment` events access to the secrets below. + +jobs: + review: + uses: docker/docker-agent-action/.github/workflows/review-pr.yml@06e1767af06263c93d712449cbf859778d9392ee # v2.0.5 + # Scoped to the job so other jobs in this workflow aren't over-permissioned + permissions: + contents: read # Read repository files and PR diffs + pull-requests: write # Post review comments + issues: write # Create security incident issues if secrets detected + checks: write # (Optional) Show review progress as a check run + id-token: write # Required for OIDC authentication to AWS Secrets Manager + actions: write # Download artifacts from trigger workflow + with: + trigger-run-id: ${{ github.event_name == 'workflow_run' && format('{0}', github.event.workflow_run.id) || '' }} + add-prompt-files: STYLE.md,COMPONENTS.md + additional-prompt: | + ## Documentation Review Focus + + This is Docker's official documentation. + You are reviewing **DOCUMENTATION**, not code. Focus on documentation quality, not software bugs. + + **Style guides are available via prompt files (STYLE.md, COMPONENTS.md)** - reference them when evaluating changes. + + ## Priority Issues + + ### 1. Vendored/Generated Content (CRITICAL - Auto-reject) + Check for vendored or generated files before reviewing any changed content. + Treat these paths as vendored/generated: + - Any file in `_vendor/` directory (vendored from upstream repos) + - Any YAML file in `data/*/*.yaml` subdirectories (CLI reference data generated from upstream) + - Examples: `data/engine-cli/*.yaml`, `data/buildx/*.yaml`, `data/scout-cli/*.yaml` + - Exception: root-level data/ files are manually maintained (allow edits) + - `content/reference/api/ai-governance/api.yaml` (verbatim copy of the upstream OpenAPI spec, vendored from the private docker/governor-services repo via `hack/sync-governance-api.sh`) + + If all changed files are vendored/generated: + - Leave at most one PR-level review comment. + - Do not leave inline comments. + - Do not review style, wording, markdown, command accuracy, links, or content quality inside those files. + - Say only that the PR edits vendored/generated content, identify the affected path pattern, and direct the author to make the change upstream and sync it back. + + If a PR changes both vendored/generated files and hand-authored files: + - Leave one comment for the vendored/generated file issue. + - Review only the hand-authored files for the remaining priority issues below. + - Do not leave style, wording, markdown, command accuracy, link, or content-quality comments on vendored/generated files. + + ### 2. Missing Redirects When Removing/Moving Pages (HIGH) + When a PR removes or moves a page: + - Check if the PR adds an `aliases:` entry in the front matter of the target/replacement page + - Example: If `/old/path.md` is removed, there should be `aliases: ["/old/path/"]` in the new page + + ### 3. Markdown Formatting + - Poor markdown syntax (unclosed code blocks, broken lists, indentation issues, etc.) + + ### 4. AI-Generated Patterns (HIGH PRIORITY) + Flag AI-isms from STYLE.md: + - Hedge words: simply, just, easily, quickly, seamlessly + - Redundant phrases: "in order to", "allows you to" + - Meta-commentary: "it's worth noting that" + - Marketing speak: "robust", "powerful", "cutting-edge" + - Passive voice: "is used by" → "uses" + + ### 5. Scope Preservation + Does the change match existing document's length and tone? + Check STYLE.md "Scope preservation". + + ### 6. Content Accuracy + - Factually incorrect information (wrong commands, wrong API endpoints) + - Broken links or references + - Contradictory content + - Mismatched information (e.g., code example shows X but text says Y) + - Security issues in example code + + ### 7. Front Matter & Hugo Syntax + - Missing required fields: `title`, `description`, `keywords` + - Incorrect shortcode syntax (check COMPONENTS.md) + - Invalid component usage + + ## Severity + - **high**: Will mislead users or break things (incorrect commands, wrong APIs, security issues, editing vendored files, missing redirects) + - **medium**: Could confuse users or violates style guide (AI-isms, scope inflation, unclear instructions, markdown formatting) + - **low**: Minor suggestions (rarely report) + + Most issues should be MEDIUM. HIGH is for critical problems only. diff --git a/.github/workflows/release-notes-pr-trigger.yml b/.github/workflows/release-notes-pr-trigger.yml new file mode 100644 index 000000000000..1bd3b1c13b1b --- /dev/null +++ b/.github/workflows/release-notes-pr-trigger.yml @@ -0,0 +1,30 @@ +name: Release Notes PR Trigger + +on: + pull_request: + types: [opened] + paths: + - content/manuals/desktop/release-notes.md + +jobs: + trigger: + runs-on: ubuntu-24.04 + if: github.repository_owner == 'docker' + steps: + - name: Save PR details + env: + PR_URL: ${{ github.event.pull_request.html_url }} + PR_TITLE: ${{ github.event.pull_request.title }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} + run: | + jq -n \ + --arg url "$PR_URL" \ + --arg title "$PR_TITLE" \ + --arg author "$PR_AUTHOR" \ + '{url: $url, title: $title, author: $author}' > pr-details.json + + - name: Upload PR details + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 + with: + name: pr-details + path: pr-details.json diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000000..1a48cc3e3532 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,206 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# It also handles lifecycle slash commands for managing stale labels. +# For more information, see: https://github.com/actions/stale +# +# Security: Actions are pinned to full commit SHA to prevent supply chain attacks. +# To update, check releases and update both the SHA and version comment. +# +# Debug mode: +# - Lifecycle commands: Set DEBUG_ONLY to 'true' in the lifecycle-commands job env +# - Stale action: Set debug-only to true in the stale job configuration +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '30 1 * * *' # Daily at 1:30 AM UTC + issue_comment: + types: [created] + +jobs: + lifecycle-commands: + runs-on: ubuntu-latest + if: github.event_name == 'issue_comment' + permissions: + issues: write + pull-requests: write + + steps: + - name: Handle lifecycle commands + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + env: + # Set to 'true' to test without making actual changes + DEBUG_ONLY: 'false' + with: + script: | + const comment = context.payload.comment.body.toLowerCase().trim(); + const debugOnly = process.env.DEBUG_ONLY === 'true'; + + if (debugOnly) { + console.log('🔍 DEBUG MODE: No changes will be made'); + } + + // Define commands and their required permissions + const commands = { + '/lifecycle frozen': { label: 'lifecycle/frozen', requiresWrite: true }, + '/lifecycle stale': { label: 'lifecycle/stale', requiresWrite: true }, + '/lifecycle active': { action: 'remove-stale', requiresWrite: false }, + '/remove-lifecycle frozen': { action: 'remove-frozen', requiresWrite: true }, + '/remove-lifecycle stale': { action: 'remove-stale', requiresWrite: false } + }; + + // Check if comment contains a lifecycle command + const commandKey = Object.keys(commands).find(cmd => + comment === cmd || comment.startsWith(cmd + ' ') + ); + + if (!commandKey) { + console.log('No lifecycle command found in comment'); + return; + } + + const commandConfig = commands[commandKey]; + const issue_number = context.issue.number; + + // Check user permissions for restricted commands + if (commandConfig.requiresWrite) { + if (debugOnly) { + console.log(`Would check permissions for user ${context.payload.comment.user.login} for ${commandKey}`); + } else { + try { + const { data: userPermission } = await github.rest.repos.getCollaboratorPermissionLevel({ + owner: context.repo.owner, + repo: context.repo.repo, + username: context.payload.comment.user.login + }); + + const hasWriteAccess = ['admin', 'write', 'maintain'].includes(userPermission.permission); + + if (!hasWriteAccess) { + console.log(`User ${context.payload.comment.user.login} does not have permission for ${commandKey}`); + await github.rest.reactions.createForIssueComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: '-1' + }); + return; + } + console.log(`User ${context.payload.comment.user.login} has ${userPermission.permission} access`); + } catch (error) { + console.log('Error checking permissions:', error.message); + return; + } + } + } + + // Handle remove commands + if (commandConfig.action && commandConfig.action.startsWith('remove-')) { + const labelToRemove = commandConfig.action === 'remove-stale' ? 'lifecycle/stale' : 'lifecycle/frozen'; + + if (debugOnly) { + console.log(`Would remove ${labelToRemove} label from issue #${issue_number}`); + console.log('Would react with 👍 to comment'); + } else { + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + name: labelToRemove + }); + console.log(`Removed ${labelToRemove} label`); + + await github.rest.reactions.createForIssueComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: '+1' + }); + } catch (error) { + console.log(`Label ${labelToRemove} not found or already removed`); + } + } + } + // Handle add label commands + else if (commandConfig.label) { + if (debugOnly) { + console.log(`Would add ${commandConfig.label} label to issue #${issue_number}`); + console.log('Would react with 👍 to comment'); + } else { + try { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue_number, + labels: [commandConfig.label] + }); + console.log(`Added ${commandConfig.label} label`); + + await github.rest.reactions.createForIssueComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: '+1' + }); + } catch (error) { + console.log(`Error adding label: ${error.message}`); + } + } + } + + stale: + runs-on: ubuntu-latest + if: github.event_name == 'schedule' + permissions: + issues: write + pull-requests: write + actions: write # required for actions/stale to delete its state cache between runs + + steps: + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + with: + ascending: false + operations-per-run: 30 + + # Exempt labels - issues/PRs with these labels will never be marked stale + exempt-issue-labels: 'kind/help-wanted,status/need-more-info,status/needs-analysis,lifecycle/frozen' + exempt-pr-labels: 'kind/help-wanted,status/need-more-info,status/needs-analysis,lifecycle/frozen' + + # Use lifecycle/stale label to match existing convention + stale-issue-label: 'lifecycle/stale' + stale-pr-label: 'lifecycle/stale' + + # Stale messages + stale-issue-message: | + There hasn't been any activity on this issue for a long time. If the problem is still relevant, **add a comment** to keep it open. Otherwise, this issue will be automatically closed in 14 days. + + **To remove the stale label:** Comment `/lifecycle active` + **To freeze (requires write access):** Comment `/lifecycle frozen` + stale-pr-message: | + Thanks for the PR. We'd like to make our product docs better, but haven't been able to review all the suggestions. As our docs change often and quickly diverge, we do not have the bandwidth to review and rebase old PRs. + + If the updates are still relevant, please rebase your PR against the latest version of the docs and **add a comment** when it's ready. This helps our maintainers focus on active contributions. If there's no activity, this PR will be closed in 30 days. + + **To remove the stale label:** Comment `/lifecycle active` + **To freeze (requires write access):** Comment `/lifecycle frozen` + + # Close messages + close-issue-message: | + Closing this issue as there hasn't been any activity for a long time. + + If the problem is still relevant, please **open a new issue** and complete the issue template so we can capture the details required to investigate further. This helps our maintainers focus on active issues. + close-pr-message: | + Closing this PR as there hasn't been any activity for a long time. + + If the updates are still relevant, please review our [contribution guidelines](https://github.com/docker/docs/blob/main/CONTRIBUTING.md) and **create a new PR** against the latest version of our docs. + + # Timing configuration NOTE: If you change days-before-issue-close or + # days-before-pr-close, also update the hardcoded values in the + # stale-issue-message and stale-pr-message above to match. + days-before-issue-stale: 180 # 6 months + days-before-pr-stale: 180 # 6 months + days-before-issue-close: 14 # 2 weeks after stale + days-before-pr-close: 30 # 1 month after stale + + # Debug mode - set to true for dry-run testing (no actual changes) + debug-only: false diff --git a/.github/workflows/sync-cli-docs.yml b/.github/workflows/sync-cli-docs.yml new file mode 100644 index 000000000000..382a0f86fad5 --- /dev/null +++ b/.github/workflows/sync-cli-docs.yml @@ -0,0 +1,131 @@ +name: sync-cli-docs + +on: + schedule: + # Run daily at 02:00 UTC + - cron: '0 2 * * *' + workflow_dispatch: + inputs: + version: + description: "(optional) Docker CLI version - defaults to docker_ce_version in hugo.yaml" + required: false + default: "" + pull_request: + paths: + - '.github/workflows/sync-cli-docs.yml' + - 'hack/sync-cli-docs.sh' + +permissions: + contents: write + pull-requests: write + +env: + BRANCH_NAME: "bot/sync-cli-docs" + +jobs: + sync-cli-docs: + runs-on: ubuntu-24.04 + steps: + - + name: Checkout docs repo + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + fetch-depth: 0 + - + name: Get version from hugo.yaml + id: get-version + run: | + if [ -n "${{ inputs.version }}" ]; then + VERSION="${{ inputs.version }}" + else + VERSION=v$(grep "docker_ce_version:" hugo.yaml | awk '{print $2}' | tr -d '"') + fi + + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "Docker CLI version: **$VERSION**" | tee -a "$GITHUB_STEP_SUMMARY" + - + name: Checkout docker/cli repo + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + repository: docker/cli + path: cli-source + ref: ${{ steps.get-version.outputs.version }} + fetch-depth: 0 + - + name: Create update branch + id: create-branch + env: + BRANCH_NAME: ${{ env.BRANCH_NAME }} + run: | + git checkout -b "$BRANCH_NAME" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - + name: Run sync script + id: sync + run: | + set +e + ./hack/sync-cli-docs.sh HEAD cli-source + EXIT_CODE=$? + set -e + + if [ $EXIT_CODE -eq 0 ]; then + echo "changes=true" >> "$GITHUB_OUTPUT" + echo "Changes detected - syncing CLI docs" >> "$GITHUB_STEP_SUMMARY" + elif [ $EXIT_CODE -eq 100 ]; then + echo "changes=false" >> "$GITHUB_OUTPUT" + echo "No changes to sync - CLI docs are up to date" >> "$GITHUB_STEP_SUMMARY" + else + echo "::error::Script failed with exit code $EXIT_CODE" + exit $EXIT_CODE + fi + + - + name: Show PR + if: steps.sync.outputs.changes == 'true' + run: | + git show "${{ env.BRANCH_NAME }}" + - + name: Create or update Pull Request + if: steps.sync.outputs.changes == 'true' && github.event_name != 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + BRANCH_NAME: ${{ env.BRANCH_NAME }} + PR_TITLE: "cli: sync docs with cli ${{ steps.get-version.outputs.version }}" + PR_BODY: | + ## Summary + + Automated sync of CLI documentation from docker/cli repository. + + **CLI Version:** ${{ steps.get-version.outputs.version }} + + --- + + > [!IMPORTANT] + > **Reviewer:** Please close and reopen this PR to trigger CI checks. + > See: https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow + run: | + # Check for existing open PR from this branch + EXISTING_PR=$(gh pr list --state open --head "$BRANCH_NAME" --json url --jq ".[0].url // empty") + + if [ -n "$EXISTING_PR" ]; then + echo "Updating existing PR: $EXISTING_PR" >> "$GITHUB_STEP_SUMMARY" + git push -u origin "$BRANCH_NAME" --force + gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY" + else + # Check if a closed PR with the same title already exists + CLOSED_PR=$(gh pr list --state closed --search "$PR_TITLE in:title" --json url --jq ".[0].url // empty") + if [ -n "$CLOSED_PR" ]; then + echo "A closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY" + echo "Skipping PR creation." + exit 0 + fi + + echo "Creating new PR" >> "$GITHUB_STEP_SUMMARY" + git push -u origin "$BRANCH_NAME" + gh pr create \ + --title "$PR_TITLE" \ + --body "$PR_BODY" \ + --base main \ + --head "$BRANCH_NAME" + fi diff --git a/.github/workflows/sync-docker-agent-docs.yml b/.github/workflows/sync-docker-agent-docs.yml new file mode 100644 index 000000000000..3f24f332ca56 --- /dev/null +++ b/.github/workflows/sync-docker-agent-docs.yml @@ -0,0 +1,130 @@ +name: sync-docker-agent-docs + +on: + schedule: + # Run daily at 02:30 UTC, offset from sync-cli-docs + - cron: '30 2 * * *' + workflow_dispatch: + inputs: + version: + description: "(optional) docker-agent version - defaults to the latest release tag" + required: false + default: "" + pull_request: + paths: + - '.github/workflows/sync-docker-agent-docs.yml' + +permissions: + contents: write + pull-requests: write + +env: + BRANCH_NAME: "bot/sync-docker-agent-docs" + MODULE_NAME: "github.com/docker/docker-agent" + +jobs: + sync-docker-agent-docs: + runs-on: ubuntu-24.04 + steps: + - + name: Checkout docs repo + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 + with: + fetch-depth: 0 + - + name: Get target version + id: get-version + env: + GH_TOKEN: ${{ github.token }} + run: | + if [ -n "${{ inputs.version }}" ]; then + VERSION="${{ inputs.version }}" + else + VERSION=$(gh release view --repo docker/docker-agent --json tagName --jq .tagName) + fi + CURRENT=$(go list -m -f '{{ .Version }}' "$MODULE_NAME" || true) + + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "current=$CURRENT" >> "$GITHUB_OUTPUT" + echo "docker-agent version: **$VERSION** (currently pinned: **$CURRENT**)" | tee -a "$GITHUB_STEP_SUMMARY" + - + name: Set up Docker Buildx + if: steps.get-version.outputs.version != steps.get-version.outputs.current + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 + - + # go mod edit sets the version before plain make vendor: passing + # VENDOR_MODULE would run hugo mod get, which records docker-agent's + # full transitive graph as indirect requires in go.mod. + name: Update vendor + if: steps.get-version.outputs.version != steps.get-version.outputs.current + run: | + go mod edit -require "${MODULE_NAME}@${{ steps.get-version.outputs.version }}" + make vendor + - + name: Detect changes + id: changes + if: steps.get-version.outputs.version != steps.get-version.outputs.current + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "changes=true" >> "$GITHUB_OUTPUT" + echo "Changes detected - syncing Docker Agent docs" >> "$GITHUB_STEP_SUMMARY" + else + echo "changes=false" >> "$GITHUB_OUTPUT" + echo "No changes to sync - Docker Agent docs are up to date" >> "$GITHUB_STEP_SUMMARY" + fi + - + name: Commit changes + if: steps.changes.outputs.changes == 'true' + env: + BRANCH_NAME: ${{ env.BRANCH_NAME }} + VERSION: ${{ steps.get-version.outputs.version }} + run: | + git checkout -b "$BRANCH_NAME" + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add -A + git commit -m "docker-agent: sync docs with docker-agent $VERSION" + - + name: Create or update Pull Request + if: steps.changes.outputs.changes == 'true' && github.event_name != 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + BRANCH_NAME: ${{ env.BRANCH_NAME }} + PR_TITLE: "docker-agent: sync docs with docker-agent ${{ steps.get-version.outputs.version }}" + PR_BODY: | + ## Summary + + Automated sync of Docker Agent documentation from the docker/docker-agent repository. + + **docker-agent version:** ${{ steps.get-version.outputs.version }} + + --- + + > [!IMPORTANT] + > **Reviewer:** Please close and reopen this PR to trigger CI checks. + > See: https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow + run: | + # Check for existing open PR from this branch + EXISTING_PR=$(gh pr list --state open --head "$BRANCH_NAME" --json url --jq ".[0].url // empty") + + if [ -n "$EXISTING_PR" ]; then + echo "Updating existing PR: $EXISTING_PR" >> "$GITHUB_STEP_SUMMARY" + git push -u origin "$BRANCH_NAME" --force + gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY" + else + # Check if a closed PR with the same title already exists + CLOSED_PR=$(gh pr list --state closed --search "$PR_TITLE in:title" --json url --jq ".[0].url // empty") + if [ -n "$CLOSED_PR" ]; then + echo "A closed PR already exists for this version: $CLOSED_PR" >> "$GITHUB_STEP_SUMMARY" + echo "Skipping PR creation." + exit 0 + fi + + echo "Creating new PR" >> "$GITHUB_STEP_SUMMARY" + git push -u origin "$BRANCH_NAME" + gh pr create \ + --title "$PR_TITLE" \ + --body "$PR_BODY" \ + --base main \ + --head "$BRANCH_NAME" + fi diff --git a/.github/workflows/validate-upstream.yml b/.github/workflows/validate-upstream.yml index 0ac2645c76ad..727b552ea437 100644 --- a/.github/workflows/validate-upstream.yml +++ b/.github/workflows/validate-upstream.yml @@ -34,12 +34,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 with: repository: docker/docs - name: Download data files - uses: actions/download-artifact@v4 + uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5 if: ${{ inputs.data-files-id != '' && inputs.data-files-folder != '' }} with: name: ${{ inputs.data-files-id }} @@ -51,7 +51,7 @@ jobs: # that folder. If not, create a placeholder stub file for the data file. name: Copy data files if: ${{ inputs.data-files-id != '' && inputs.data-files-folder != '' }} - uses: actions/github-script@v7 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: script: | const fs = require('fs'); @@ -61,7 +61,7 @@ jobs: const yamlSrcFilename = path.basename(yamlSrcPath); const yamlSrcNoExt = yamlSrcPath.replace(".yaml", ""); const hasSubCommands = (await (await glob.create(yamlSrcNoExt)).glob()).length > 1; - const yamlDestPath = path.join('data', `${{ inputs.data-files-folder }}`, yamlSrcFilename); + const yamlDestPath = path.join('data', 'cli', `${{ inputs.data-files-folder }}`, yamlSrcFilename); let placeholderPath = path.join("content/reference/cli", yamlSrcFilename.replace('_', '/').replace(/\.yaml$/, '.md')); if (hasSubCommands) { placeholderPath = placeholderPath.replace('.md', '/_index.md'); @@ -84,22 +84,19 @@ jobs: } - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 with: version: ${{ env.SETUP_BUILDX_VERSION }} driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }} - name: Validate - uses: docker/bake-action@v6 + uses: docker/bake-action@82490499d2e5613fcead7e128237ef0b0ea210f7 # v7 with: source: . files: | docker-bake.hcl targets: validate-upstream provenance: false - set: | - *.cache-from=type=gha,scope=docs-upstream - *.cache-to=type=gha,scope=docs-upstream env: UPSTREAM_MODULE_NAME: ${{ inputs.module-name }} UPSTREAM_REPO: ${{ github.repository }} diff --git a/.gitignore b/.gitignore index 72f90137613a..7c450914435b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,19 @@ +.hugo_build.lock +hugo_stats.json +.idea/ +.vscode/mcp.json +.vscode/settings.json +.vscode/tasks.json **/.DS_Store **/desktop.ini -.vscode node_modules -.hugo_build.lock -resources public -tmp +resources static/pagefind -.idea/ +tmp +# Binary installed by cagent-action in CI +cagent +# cagent tmp files +.cagent +.pr-body.md +.validation.log diff --git a/.htmltest.yml b/.htmltest.yml index e7cb321e1bec..ea2330397f44 100644 --- a/.htmltest.yml +++ b/.htmltest.yml @@ -9,6 +9,8 @@ IgnoreDirectoryMissingTrailingSlash: true IgnoreURLs: - "^/reference/api/hub/.*$" - "^/reference/api/engine/v.+/#.*$" +- "^/reference/api/registry/.*$" +- "^/pagefind/.*$" IgnoreDirs: - "registry/configuration" - "compose/compose-file" # temporarily ignore until upstream is fixed diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index 58ab5995dd85..000000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "default": false, - "blanks-around-headings": true, - "hr-style": true, - "heading-start-left": true, - "single-h1": true, - "no-trailing-punctuation": true, - "no-missing-space-atx": true, - "no-multiple-space-atx": true, - "no-missing-space-closed-atx": true, - "no-multiple-space-closed-atx": true, - "no-space-in-emphasis": true, - "no-space-in-code": true, - "no-space-in-links": true, - "no-empty-links": true, - "ol-prefix": {"style": "ordered"}, - "no-reversed-links": true, - "reference-links-images": { - "shortcut_syntax": false - }, - "fenced-code-language": true, - "table-pipe-style": true, - "table-column-count": true -} diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000000..97b895e2f968 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +ignore-scripts=true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000000..de056073aff3 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +**/*.md diff --git a/.rumdl.toml b/.rumdl.toml new file mode 100644 index 000000000000..9ad17f216170 --- /dev/null +++ b/.rumdl.toml @@ -0,0 +1,44 @@ +[global] +flavor = "hugo" +enable = [ + "MD011", + "MD018", + "MD019", + "MD020", + "MD021", + "MD022", + "MD023", + "MD025", + "MD026", + "MD029", + "MD035", + "MD037", + "MD038", + "MD039", + "MD040", + "MD042", + "MD052", + "MD055", + "MD056", + "MD059", +] +exclude = [ + "content/manuals/desktop/previous-versions/*.md", + "content/manuals/engine/release-notes/*.md", +] + +[MD029] +style = "one_or_ordered" + +[MD052] +shortcut-syntax = false + +[MD059] +prohibited-texts = [ + "click here", + "here", + "link", + "more", + "learn more", + "find out more", +] diff --git a/.sbx/kits/hugo/spec.yaml b/.sbx/kits/hugo/spec.yaml new file mode 100644 index 000000000000..815ddac9f7d3 --- /dev/null +++ b/.sbx/kits/hugo/spec.yaml @@ -0,0 +1,52 @@ +schemaVersion: "2" +kind: mixin +name: hugo +displayName: Hugo +description: Installs the Hugo Extended static site generator from a pinned GitHub release. + +permissions: + network: + allow: + # Release tarball download (install time, one-shot). + # github.com 302-redirects to release-assets.githubusercontent.com for binary downloads. + - github.com + - release-assets.githubusercontent.com + +setup: + install: + - command: | + set -euo pipefail + # Keep in sync with ARG HUGO_VERSION in this repo's Dockerfile. + HUGO_VERSION=0.163.0 + ARCH=$(dpkg --print-architecture) + case "$ARCH" in + amd64) + TARBALL="hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz" + SHA256="6291775b7d012f9b10fb377ba914e5b1589c0b0d2531b695fa9029be14750111" + ;; + arm64) + TARBALL="hugo_extended_${HUGO_VERSION}_linux-arm64.tar.gz" + SHA256="ed50d3ec8c5b427013137e38718a5d398a90956ce9e3a8a3cb7ebf3fdd01072b" + ;; + *) + echo "unsupported arch: $ARCH" >&2 + exit 1 + ;; + esac + curl --proto '=https' --tlsv1.2 -fsSL \ + -o /tmp/hugo.tgz \ + "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${TARBALL}" + echo "${SHA256} /tmp/hugo.tgz" | sha256sum -c - + tar -C /usr/local/bin -xzf /tmp/hugo.tgz hugo + rm /tmp/hugo.tgz + hugo version + user: "0" + description: "Install pinned Hugo Extended CLI" + +agentInstructions: + content: | + ## Hugo static site generator + + The `hugo` CLI (extended edition, v0.163.0) is installed and available on + `PATH`. This repository builds https://docs.docker.com/ with Hugo. Run + `hugo version` to confirm, and `hugo server` to preview the site locally. diff --git a/.sbx/kits/rumdl/spec.yaml b/.sbx/kits/rumdl/spec.yaml new file mode 100644 index 000000000000..dfda7f855b88 --- /dev/null +++ b/.sbx/kits/rumdl/spec.yaml @@ -0,0 +1,52 @@ +schemaVersion: "2" +kind: mixin +name: rumdl +displayName: rumdl +description: Installs the rumdl Markdown linter/formatter from a pinned GitHub release, matching the version this repository uses. + +permissions: + network: + allow: + # Release tarball download (install time, one-shot). + # github.com 302-redirects to release-assets.githubusercontent.com for binary downloads. + - github.com + - release-assets.githubusercontent.com + +setup: + install: + - command: | + set -euo pipefail + # Keep in sync with the "rumdl" devDependency version in this repo's package.json. + RUMDL_VERSION=0.2.49 + ARCH=$(dpkg --print-architecture) + case "$ARCH" in + amd64) + TARBALL="rumdl-v${RUMDL_VERSION}-x86_64-unknown-linux-gnu.tar.gz" + SHA256="e208db27143592a18b26d9d42e6e76133a2dcdb8738d2ed0f8d3b44027b2d8d6" + ;; + arm64) + TARBALL="rumdl-v${RUMDL_VERSION}-aarch64-unknown-linux-gnu.tar.gz" + SHA256="b57cfdc83f4bbe0714c4a7642464107a5c64f258d5925d67bc9b3816dbe0701a" + ;; + *) + echo "unsupported arch: $ARCH" >&2 + exit 1 + ;; + esac + curl --proto '=https' --tlsv1.2 -fsSL \ + -o /tmp/rumdl.tgz \ + "https://github.com/rvben/rumdl/releases/download/v${RUMDL_VERSION}/${TARBALL}" + echo "${SHA256} /tmp/rumdl.tgz" | sha256sum -c - + tar -C /usr/local/bin -xzf /tmp/rumdl.tgz rumdl + rm /tmp/rumdl.tgz + rumdl --version + user: "0" + description: "Install pinned rumdl CLI" + +agentInstructions: + content: | + ## rumdl Markdown linter + + The `rumdl` CLI is installed and available on `PATH`. Format a Markdown + file with `rumdl fmt <file>` and lint it with `rumdl check <file>` (or + the project's `scripts/lint.sh <file>...`, which also runs Vale). diff --git a/.vale-rdjsonl.tmpl b/.vale-rdjsonl.tmpl new file mode 100644 index 000000000000..662f973385c2 --- /dev/null +++ b/.vale-rdjsonl.tmpl @@ -0,0 +1,31 @@ +{{- /* Range over the linted files */ -}} + +{{- range .Files}} + +{{- $path := .Path -}} + +{{- /* Range over the file's alerts */ -}} + +{{- range .Alerts -}} + +{{- $error := "" -}} +{{- if eq .Severity "error" -}} + {{- $error = "ERROR" -}} +{{- else if eq .Severity "warning" -}} + {{- $error = "WARNING" -}} +{{- else -}} + {{- $error = "INFO" -}} +{{- end}} + +{{- /* Variables setup */ -}} + +{{- $line := printf "%d" .Line -}} +{{- $col := printf "%d" (index .Span 0) -}} +{{- $check := printf "%s" .Check -}} +{{- $message := printf "%s" .Message -}} + +{{- /* Output */ -}} + +{"message": "[{{ $check }}] {{ $message | jsonEscape }}", "location": {"path": "{{ $path }}", "range": {"start": {"line": {{ $line }}, "column": {{ $col }}}}}, "severity": "{{ $error }}"} +{{end -}} +{{end -}} diff --git a/.vale.ini b/.vale.ini index 710e13b2ff2f..398c9a2fd843 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,17 +1,36 @@ StylesPath = _vale MinAlertLevel = suggestion - +IgnoredScopes = text.frontmatter, code, tt, b, strong, i, a Vocab = Docker -[*.md] -BasedOnStyles = Vale, Docker -# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}}) -TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \ -(\[.+\]\({{< .+ >}}\)), \ -[^\S\r\n]({{[%<] \w+ .+ [%>]}})\s, \ -[^\S\r\n]({{[%<](?:/\*) .* (?:\*/)[%>]}})\s, \ -(?sm)({{[%<] .*?\s[%>]}}) +# Generated reference content — disable rules that don't apply +[content/reference/**] +Docker.Capitalization = NO +Vale.Spelling = NO +Vale.Terms = NO -# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}` -BlockIgnores = (?sm)^({{[%<] \w+ [^{]*?\s[%>]}})\n$, \ -(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}}) +# Skip release notes and old desktop changelog content entirely +[{content/manuals/*/release-notes.md,content/manuals/*/release-notes/**,content/manuals/**/release-notes.md,content/manuals/desktop/previous-versions/**}] +Docker.Avoid = NO +Docker.Capitalization = NO +Docker.Exclamation = NO +Docker.Forbidden = NO +Docker.GenericCTA = NO +Docker.HeadingPunctuation = NO +Docker.ListComma = NO +Docker.OxfordComma = NO +Docker.RecommendedWords = NO +Docker.Spacing = NO +Docker.Terms = NO +Docker.URLFormat = NO +Docker.Units = NO +Docker.VersionText = NO +Docker.We = NO +Vale.Spelling = NO +Vale.Repetition = NO +Vale.Terms = NO + +[*.md] +BasedOnStyles = Docker, Vale +TokenIgnores = ({{[^}]+}}\S*) +BlockIgnores = (?m)^[ \t]*({{[^}]+}})[ \t]*$, (\[[^\]]*{{[^}]+}}[^\]]*\]\([^)]*\)), ({{<\s*file\s[^>]*>}}[\s\S]*?{{<\s*/\s*file\s*>}}) diff --git a/.vscode/docker.code-snippets b/.vscode/docker.code-snippets new file mode 100644 index 000000000000..1c2817d4183a --- /dev/null +++ b/.vscode/docker.code-snippets @@ -0,0 +1,67 @@ +{ + "Insert Hugo Note Admonition": { + "prefix": ["admonition", "note"], + "body": ["> [!NOTE]", "> $1"], + "description": "Insert a Hugo note admonition", + }, + "Insert Hugo Important Admonition": { + "prefix": ["admonition", "important"], + "body": ["> [!IMPORTANT]", "> $1"], + "description": "Insert a Hugo important admonition", + }, + "Insert Hugo Warning Admonition": { + "prefix": ["admonition", "warning"], + "body": ["> [!WARNING]", "> $1"], + "description": "Insert a Hugo warning admonition", + }, + "Insert Hugo Tip Admonition": { + "prefix": ["admonition", "tip"], + "body": ["> [!TIP]", "> $1"], + "description": "Insert a Hugo tip admonition", + }, + "Insert Hugo Tabs": { + "prefix": ["admonition", "tabs"], + "body": [ + "", + "{{< tabs group=\"$1\" >}}", + "{{< tab name=\"$2\">}}", + "", + "$3", + "", + "{{< /tab >}}", + "{{< tab name=\"$4\">}}", + "", + "$5", + "", + "{{< /tab >}}", + "{{</tabs >}}", + "", + ], + "description": "Insert a Hugo tabs block with two tabs and snippet stops for names and content", + }, + "Insert Hugo code block (no title)": { + "prefix": ["codeblock", "block"], + "body": ["```${1:json}", "$2", "```", ""], + "description": "Insert a Hugo code block with an optional title", + }, + "Insert Hugo code block (with title)": { + "prefix": ["codeblock", "codettl", "block"], + "body": ["```${1:json} {title=\"$2\"}", "$3", "```", ""], + "description": "Insert a Hugo code block with an optional title", + }, + "Insert a Button": { + "prefix": ["button"], + "body": ["{{< button url=\"$1\" text=\"$2\" >}}"], + "description": "Insert a Hugo button", + }, + "Insert Visual Studio Code": { + "prefix": ["vscode", "vs"], + "body": ["Visual Studio Code"], + "description": "Insert 'Visual Studio Code'", + }, + "Insert reusable snippet": { + "prefix": ["include","reuse"], + "body": ["{{% include \"$1\" %}}"], + "description": "Insert a reusable snippet stored in the `includes` folder", + } +} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000000..d335fddbe7ed --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,310 @@ +# AGENTS.md + +Instructions for AI agents working on Docker documentation. +This site builds https://docs.docker.com/ using Hugo. + +## Project structure + +```text +content/ # Documentation source (Markdown + Hugo front matter) +├── manuals/ # Product docs (Engine, Desktop, Hub, etc.) +├── guides/ # Task-oriented guides +├── reference/ # API and CLI reference +└── includes/ # Reusable snippets +layouts/ # Hugo templates and shortcodes +data/ # YAML data files (CLI reference, etc.) +assets/ # CSS (Tailwind v4) and JS (Alpine.js) +static/ # Images, fonts +_vendor/ # Vendored Hugo modules (read-only) +``` + +## URL prefix stripping + +The `/manuals` prefix is stripped from published URLs: +`content/manuals/desktop/install.md` becomes `/desktop/install/` on the live +site. + +When writing internal cross-references in source files, keep the `/manuals/` +prefix in the path — Hugo requires the full source path. The stripping only +affects the published URL, not the internal link target. Anchor links must +exactly match the generated heading ID (Hugo lowercases and slugifies +headings). + +## Vendored content (do not edit) + +Content in `_vendor/` and CLI reference data in `data/cli/` are vendored +from upstream repos. Content pages under `content/reference/cli/` are +generated from `data/cli/` YAML. Do not edit any of these files — changes +must go to the source repository: + +| Content | Source repo | +|---------|-------------| +| CLI reference (`docker`, `docker build`, etc.) | docker/cli | +| Buildx reference | docker/buildx | +| Compose reference | docker/compose | +| Model Runner reference | docker/model-runner | +| Dockerfile reference | moby/buildkit | +| Engine API reference | moby/moby | +| AI Governance API (`content/reference/api/ai-governance/api.yaml`) | docker/governor-services (private) | + +If a validation failure or broken link traces back to vendored content, note +the upstream repo that needs fixing. Do not attempt to fix it locally. + +`content/reference/api/ai-governance/api.yaml` is a verbatim copy of the +upstream `openapi.yaml` — do not edit it by hand. Re-vendor it with +`hack/sync-governance-api.sh`, which fetches the latest spec from the private +`docker/governor-services` repo (using your own `gh` auth). + +## Writing guidelines + +Read and follow [STYLE.md](STYLE.md) and [COMPONENTS.md](COMPONENTS.md). +These contain all style rules, shortcode syntax, and front matter requirements. + +### Style violations to avoid + +Every piece of writing must avoid these words and patterns (enforced by Vale): + +- Hedge words: "simply", "easily", "just", "seamlessly" +- Meta-commentary: "it's worth noting", "it's important to understand" +- "allows you to" or "enables you to" — use "lets you" or rephrase +- "we" — use "you" or "Docker" +- "click" — use "select" +- Bold for emphasis or product names — only bold UI elements +- Time-relative language: "currently", "new", "recently", "now" + +### Version-introduction notes + +Explicit version anchors ("Starting with Docker Desktop version X...") are +different from time-relative language — they mark when a feature was +introduced, which is permanently true. + +- Recent releases (~6 months): leave version callouts in place +- Old releases: consider removing if the callout adds little value +- When in doubt, keep the callout and flag for maintainer review + +### Vale gotchas + +- Use lowercase "config" in prose — `vale.Terms` flags a capital-C "Config" + +### Updating the vocabulary + +If Vale flags a legitimate tech term, product name, or compound identifier +as a misspelling, add it to `_vale/config/vocabularies/Docker/accept.txt`. +This is optional — only update when a real new term is missing, not to +silence individual violations. + +- Use the canonical form for case-sensitive product names (`PyTorch`, + `GitHub`, `Kubernetes`, `BuildKit`). `Vale.Terms` enforces that exact + case across the docs. +- Use `[Aa]bcd` character-class regex for words that legitimately appear + in multiple cases (e.g., sentence-starting capitalization, or a name + that's also a generic noun). This covers spelling without enforcing + a single canonical form. +- Avoid broad regex patterns — entries that match many words at once + (especially with `(?i)`) suppress other rule checks on every match. +- Don't add a wrong-cased entry to silence one false positive — it + cascades into `Vale.Terms` violations on every correct usage. + +## Alpine.js patterns + +Do not combine Alpine's `x-show` with the HTML `hidden` attribute on the +same element. `x-show` toggles inline `display` styles, but `hidden` applies +`display: none` via the user-agent stylesheet — the element stays hidden +regardless of `x-show` state. Use `x-cloak` for pre-Alpine hiding instead. +The site defines `[x-cloak=""] { display: none !important }` in `global.css`. + +## Front matter requirements + +Every content page under `content/` requires: + +- `title:` — page title +- `description:` — short description for SEO/previews +- `keywords:` — list of search keywords + +Additional common fields: + +- `linkTitle:` — sidebar label (keep under 30 chars) +- `weight:` — ordering within a section + +## Sidebar navigation + +The section sidebar is rendered by +`layouts/_partials/sidebar/sections.html`. It starts at `.FirstSection` and +recursively walks each section's `.Pages`. Page weight controls the default +order. Section front matter can group entries with `sidebar.groups`, reverse +their order with `sidebar.reverse`, override a link with `sidebar.goto`, and +add a badge with `sidebar.badge`. + +The sidebar expands the current page's ancestor sections and marks the current +page with `aria-current`. When changing the recursive templates, pass all +navigation state through both `renderChildren` and `renderList`. Keep the page +filter and the `$hasChildren` calculation aligned so an expand control never +points to an empty list or disappears for a rendered list. + +## Hidden pages + +Set `sitemap: false` to hide a page from site-wide discovery. This setting: + +- Excludes the page from `sitemap.xml`, `metadata.json`, and `llms-full.txt` +- Excludes the page body from the site search index +- Adds a `noindex` robots meta tag + +The page is still built and remains available through direct links. This is +not an access control mechanism. + +Hugo does not automatically apply `sitemap: false` from a section page to its +descendants. To hide an entire subtree, cascade the value from the section's +`_index.md`: + +```yaml +sitemap: false +cascade: + sitemap: false +``` + +## Hidden sections in the sidebar + +The sidebar uses `sitemap` as a navigation visibility filter. A hidden page is +absent from the sidebar outside its active navigation path. The current page +and its ancestors remain visible so direct links to hidden pages do not produce +an empty navigation path. + +When the active path enters a hidden section, `revealHidden` propagates down +that branch and renders the whole hidden subtree. This keeps the section's +navigation available while you are in it. The state must remain scoped to that +branch so unrelated hidden pages stay hidden. + +## Hugo shortcodes + +Shortcodes are defined in `layouts/shortcodes/`. Syntax reference is in +COMPONENTS.md. Wrong shortcode syntax fails silently during build but +produces broken HTML — always check COMPONENTS.md for correct syntax. + +## Commands + +```sh +npx --no-install rumdl fmt <file> # Format Markdown before committing +npx prettier --write <file> # Format non-Markdown files +scripts/lint.sh <file>... # Lint specific files (rumdl + Vale) +docker buildx bake validate # Run all validation checks +docker buildx bake lint # Markdown linting only +docker buildx bake vale # Style guide checks only +docker buildx bake test # HTML and link checking +``` + +For incremental work, prefer `scripts/lint.sh` over the `bake` targets — +it runs the same checks on just the files you pass, so the output stays +scoped to your changes instead of the whole repo. + +### Validation in git worktrees + +`docker buildx bake validate` fails in git worktrees because Hugo cannot +resolve the worktree path. Use `lint` and `vale` targets separately instead. +Never modify `hugo.yaml` to work around this. The `test`, `path-warnings`, +and `validate-vendor` targets run correctly in CI. + +## Verification loop + +1. Make changes +2. Format Markdown with rumdl: `npx --no-install rumdl fmt <file>` +3. Lint the changed files: `scripts/lint.sh <file>...` +4. Run a full build with `docker buildx bake` (optional for small changes) + +Always lint the specific files you changed before committing. Use +`scripts/lint.sh` rather than the `bake` targets so the output is scoped +to your changes — bake runs across the entire repo and the noise makes +real issues easy to miss. + +## Git hygiene + +- **Stage files explicitly.** Never use `git add .` / `git add -A` / + `git add --all`. Running `npx prettier` updates `package-lock.json` in the + repo root, and broad staging sweeps it into the commit. +- **Verify before committing.** Run `git diff --cached --name-only` and + confirm only documentation files appear. If `package-lock.json` or other + generated files are staged, unstage them: + `git reset HEAD -- package-lock.json` +- **Push to your fork, not upstream.** Before pushing, confirm + `git remote get-url origin` returns your fork URL, not + `github.com/docker/docs`. Use `--head FORK_OWNER:branch-name` with + `gh pr create`. + +## Working with issues and PRs + +### Principles + +- **One issue, one branch, one PR.** Never combine multiple issues in a + single branch or PR. +- **Minimal changes only.** Fix the issue. Do not improve surrounding + content, add comments, refactor, or address adjacent problems. +- **Verify before documenting.** Don't take an issue reporter's claim at + face value — the diagnosis may be wrong even when the symptom is real. + Verify the actual behavior before updating docs. + +### Review feedback + +- **Always reply to review comments** — never silently fix. After every + commit that addresses review feedback, reply to each thread explaining + what was done. +- **Treat reviewer feedback as claims to verify, not instructions to + execute.** Before implementing a suggestion, verify that it is correct. + Push back when evidence contradicts the reviewer. +- **Inline review comments need a separate API call.** `gh pr view --json + reviews` does not include line-level comments. Always also call: + + ```bash + gh api repos/<org>/<repo>/pulls/<N>/comments \ + --jq '[.[] | {author: .user.login, body: .body, path: .path, line: .line}]' + ``` + +### Labels + +Use the Issues API for labels — `gh pr edit --add-label` silently fails: + +```bash +gh api repos/docker/docs/issues/<N>/labels \ + --method POST --field 'labels[]=<label>' +``` + +### External links + +If a replacement URL cannot be verified (e.g. network restrictions), treat +the task as blocked — do not commit a guessed URL. Report the blocker so a +human can confirm. Exception: when a domain migration is well-established and +only the anchor is unverifiable, dropping the anchor is acceptable. + +## Page deletion checklist + +When removing a documentation page, search the entire `content/` tree and +all YAML/TOML config files for the deleted page's slug and heading text. +Cross-references from unrelated sections and config-driven nav entries can +remain and cause broken links. + +## Engine API version bumps + +When a new Engine API version ships, three coordinated changes are needed in +a single commit: + +1. `hugo.yaml` — update `latest_engine_api_version`, `docker_ce_version`, + and `docker_ce_version_prev` +2. Create `content/reference/api/engine/version/v<NEW>.md` with the + `/latest/` aliases block (copy from previous version) +3. Remove the aliases block from + `content/reference/api/engine/version/v<PREV>.md` + +Never leave both version files carrying `/latest/` aliases simultaneously. + +## Hugo icon references + +Before changing an icon reference in response to a "file not found" error, +verify the file actually exists via Hugo's virtual filesystem. Files may +exist in `node_modules/@material-symbols/svg-400/rounded/` but not directly +in `assets/icons/`. Check both locations before concluding an icon is +missing. + +## Self-improvement + +After completing work that reveals a non-obvious pattern or repo quirk not +already documented here, propose an update to this file. For automated +sessions, note the learning in a comment on the issue. For human-supervised +sessions, discuss with the user whether to update CLAUDE.md directly. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 000000000000..47dc3e3d863c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/COMPONENTS.md b/COMPONENTS.md new file mode 100644 index 000000000000..69eeef375181 --- /dev/null +++ b/COMPONENTS.md @@ -0,0 +1,632 @@ +# Docker Documentation Components Guide + +This guide explains how to use components, shortcodes, and special features +when writing Docker documentation. For writing style and grammar, see +[STYLE.md](STYLE.md). + +## Front matter + +Every documentation page requires front matter at the top of the file. + +### Required fields + +```yaml +--- +title: Install Docker Engine on Ubuntu +description: Instructions for installing Docker Engine on Ubuntu +keywords: requirements, apt, installation, ubuntu +--- +``` + +| Field | Description | +| ----------- | ------------------------------------------------------------ | +| title | Page title, used in `<h1>` and `<title>` tag | +| description | SEO description (150-160 characters), added to HTML metadata | +| keywords | Comma-separated keywords for SEO | + +### Optional fields + +| Field | Description | +| --------------- | ------------------------------------------------------------------ | +| linkTitle | Shorter title for navigation and sidebar (if different from title) | +| weight | Controls sort order in navigation (lower numbers appear first) | +| aliases | List of URLs that redirect to this page | +| toc_min | Minimum heading level in table of contents (default: 2) | +| toc_max | Maximum heading level in table of contents (default: 3) | +| notoc | Set to `true` to disable table of contents | +| sitemap | Set to `false` to exclude from search engine indexing | +| sidebar.badge | Add badge to sidebar (see [Badges](#badges)) | +| sidebar.reverse | Reverse sort order of pages in section | +| sidebar.goto | Override sidebar link URL | + +### Example with optional fields + +```yaml +--- +title: Install Docker Engine on Ubuntu +linkTitle: Install on Ubuntu +description: Instructions for installing Docker Engine on Ubuntu +keywords: requirements, apt, installation, ubuntu, install, uninstall +weight: 10 +aliases: + - /engine/installation/linux/ubuntu/ + - /install/linux/ubuntu/ +toc_max: 4 +params: + sidebar: + badge: + color: blue + text: Beta +--- +``` + +### Series (guide) pages + +Section pages under `content/guides/` automatically use the `series` layout +(via a Hugo cascade in `hugo.yaml`). Series pages support additional front +matter parameters for the metadata card: + +```yaml +--- +title: Getting started +description: Learn the basics of Docker +summary: | + A longer summary shown on the series landing page. +params: + proficiencyLevel: Beginner + time: 15 minutes + prerequisites: None +--- +``` + +| Field | Description | +| ---------------- | ---------------------------------------- | +| summary | Extended description for the series page | +| proficiencyLevel | Skill level (Beginner, Intermediate) | +| time | Estimated time to complete | +| prerequisites | Prerequisites or "None" | + +## Shortcodes + +Shortcodes are reusable components that add rich functionality to your +documentation. + +### Tabs + +Use tabs for platform-specific instructions or content variations. + +**Example:** + +{{< tabs >}} +{{< tab name="Linux" >}} + +```console +$ docker run hello-world +``` + +{{< /tab >}} +{{< tab name="macOS" >}} + +```console +$ docker run hello-world +``` + +{{< /tab >}} +{{< tab name="Windows" >}} + +```powershell +docker run hello-world +``` + +{{< /tab >}} +{{< /tabs >}} + +**Syntax:** + +```markdown +{{</* tabs */>}} +{{</* tab name="Linux" */>}} +Content for Linux +{{</* /tab */>}} +{{</* tab name="macOS" */>}} +Content for macOS +{{</* /tab */>}} +{{</* /tabs */>}} +``` + +**Tab groups (synchronized selection):** + +Use the `group` attribute to synchronize tab selection across multiple tab +sections: + +```markdown +{{</* tabs group="os" */>}} +{{</* tab name="Linux" */>}} +Linux content for first section +{{</* /tab */>}} +{{</* tab name="macOS" */>}} +macOS content for first section +{{</* /tab */>}} +{{</* /tabs */>}} + +{{</* tabs group="os" */>}} +{{</* tab name="Linux" */>}} +Linux content for second section +{{</* /tab */>}} +{{</* tab name="macOS" */>}} +macOS content for second section +{{</* /tab */>}} +{{</* /tabs */>}} +``` + +When a user selects "Linux" in the first section, all tabs in the "os" group +switch to "Linux". + +### Accordion + +Use accordions for collapsible content like optional steps or advanced +configuration. + +**Example:** + +{{< accordion title="Advanced configuration" >}} + +```yaml +version: "3.8" +services: + web: + build: . + ports: + - "8000:8000" +``` + +{{< /accordion >}} + +**Syntax:** + +```markdown +{{</* accordion title="Advanced configuration" */>}} +Content inside the accordion +{{</* /accordion */>}} +``` + +### Include + +Reuse content across multiple pages using the include shortcode. Include +files must be in the `content/includes/` directory. + +**Syntax:** + +```markdown +{{</* include "filename.md" */>}} +``` + +**Example:** + +```markdown +{{</* include "install-prerequisites.md" */>}} +``` + +### Badges + +Use badges to highlight new, beta, experimental, or deprecated content. + +**Example:** + +{{< badge color=blue text="Beta" >}} +{{< badge color=violet text="Experimental" >}} +{{< badge color=green text="New" >}} +{{< badge color=gray text="Deprecated" >}} + +**Syntax:** + +Inline badge: + +```markdown +{{</* badge color=blue text="Beta" */>}} +``` + +Badge as link: + +```markdown +[{{</* badge color=blue text="Beta feature" */>}}](link-to-page.md) +``` + +Sidebar badge (in front matter): + +```yaml +--- +title: Page title +params: + sidebar: + badge: + color: violet + text: Experimental +--- +``` + +**Color options:** + +- `blue` - Beta content +- `violet` - Experimental or early access +- `green` - New GA content +- `amber` - Warning or attention +- `red` - Critical +- `gray` - Deprecated + +**Usage guidelines:** + +- Use badges for no longer than 2 months post-release +- Use violet for experimental/early access features +- Use blue for beta features +- Use green for new GA features +- Use gray for deprecated features + +### Summary bars + +Summary bars indicate subscription requirements, version requirements, or +administrator-only features at the top of a page. + +**Example:** + +{{< summary-bar feature_name="Docker Scout" >}} + +**Setup:** + +1. Add feature to `/data/summary.yaml`: + +```yaml +features: + Docker Scout: + subscription: Business + availability: GA + requires: "Docker Desktop 4.17 or later" +``` + +2. Add shortcode to page: + +```markdown +{{</* summary-bar feature_name="Docker Scout" */>}} +``` + +**Attributes in summary.yaml:** + +| Attribute | Description | Values | +| ------------ | ------------------------------------- | ------------------------------------------------- | +| subscription | Subscription tier required | All, Personal, Pro, Team, Business | +| availability | Product development stage | Experimental, Beta, Early Access, GA, Retired | +| requires | Minimum version requirement | String describing version (link to release notes) | +| for | Indicates administrator-only features | Administrators | + +### Buttons + +Create styled buttons for calls to action. + +**Syntax:** + +```markdown +{{</* button text="Download Docker Desktop" url="/get-docker/" */>}} +``` + +### Cards + +Create card layouts for organizing content. + +**Syntax:** + +```markdown +{{</* card + title="Get started" + description="Learn Docker basics" + link="/get-started/" +*/>}} +``` + +### Icons + +Use Material Symbols icons in your content. + +**Syntax:** + +```markdown +{{</* icon name="check_circle" */>}} +``` + +Browse available icons at +[Material Symbols](https://fonts.google.com/icons). + +## Callouts + +Use GitHub-style callouts to emphasize important information. Use sparingly - +only when information truly deserves special emphasis. + +**Syntax:** + +```markdown +> [!NOTE] +> This is a note with helpful context. + +> [!TIP] +> This is a helpful suggestion or best practice. + +> [!IMPORTANT] +> This is critical information users must understand. + +> [!WARNING] +> This warns about potential issues or consequences. + +> [!CAUTION] +> This is for dangerous operations requiring extreme care. +``` + +**When to use each type:** + +| Type | Use for | Color | +| --------- | -------------------------------------------------------------- | ------ | +| Note | Information that may not apply to all readers or is tangential | Blue | +| Tip | Helpful suggestions or best practices | Green | +| Important | Issues of moderate magnitude | Yellow | +| Warning | Actions that may cause damage or data loss | Red | +| Caution | Serious risks | Red | + +## Code blocks + +Format code with syntax highlighting using triple backticks and language +hints. + +### Language hints + +Common language hints: + +- `console` - Interactive shell with `$` prompt +- `bash` - Bash scripts +- `dockerfile` - Dockerfiles +- `yaml` - YAML files +- `json` - JSON data +- `go`, `python`, `javascript` - Programming languages +- `powershell` - PowerShell commands + +**Interactive shell example:** + +````markdown +```console +$ docker run hello-world +``` +```` + +**Bash script example:** + +````markdown +```bash +#!/usr/bin/bash +echo "Hello from Docker" +``` +```` + +### Variables in code + +Use `<VARIABLE_NAME>` format for placeholder values: + +````markdown +```console +$ docker tag <IMAGE_NAME> <REGISTRY>/<IMAGE_NAME>:<TAG> +``` +```` + +This syntax renders variables in a special color and font style. + +### Highlighting lines + +Highlight specific lines with `hl_lines`: + +````markdown +```go {hl_lines=[3,4]} +func main() { + fmt.Println("Hello") + fmt.Println("This line is highlighted") + fmt.Println("This line is highlighted") +} +``` +```` + +### Collapsible code blocks + +Make long code blocks collapsible: + +````markdown +```dockerfile {collapse=true} +# syntax=docker/dockerfile:1 +FROM golang:1.21-alpine +RUN apk add --no-cache git +# ... more lines +``` +```` + +## Images + +Add images using standard Markdown syntax with optional query parameters for +sizing and borders. + +**Basic syntax:** + +```markdown +![Alt text description](/assets/images/image.png) +``` + +**With size parameters:** + +```markdown +![Alt text](/assets/images/image.png?w=600&h=400) +``` + +**With border:** + +```markdown +![Alt text](/assets/images/image.png?border=true) +``` + +**Combined parameters:** + +```markdown +![Alt text](/assets/images/image.png?w=600&h=400&border=true) +``` + +**Best practices:** + +- Store images in `/static/assets/images/` +- Use descriptive alt text for accessibility +- Compress images before adding to repository +- Capture only relevant UI, avoid unnecessary whitespace +- Use realistic text, not lorem ipsum +- Remove unused images from repository + +## Videos + +Embed videos using HTML video tags or platform-specific embeds. + +**Local video:** + +```html +<video controls width="100%"> + <source src="/assets/videos/demo.mp4" type="video/mp4" /> +</video> +``` + +**YouTube embed:** + +```html +<iframe + width="560" + height="315" + src="https://www.youtube.com/embed/VIDEO_ID" + frameborder="0" + allow="autoplay; encrypted-media" + allowfullscreen +> +</iframe> +``` + +## Links + +Use standard Markdown link syntax. For internal links, use relative paths +with source filenames. + +**External link:** + +```markdown +[Docker Hub](https://hub.docker.com/) +``` + +**Internal link (same section):** + +```markdown +[Installation guide](install.md) +``` + +**Internal link (different section):** + +```markdown +[Get started](/get-started/overview.md) +``` + +**Link to heading:** + +```markdown +[Prerequisites](#prerequisites) +``` + +**Best practices:** + +- Use descriptive link text (around 5 words) +- Front-load important terms +- Avoid generic text like "click here" or "learn more" +- Don't include end punctuation in link text +- Use relative paths for internal links + +## Lists + +### Unordered lists + +```markdown +- First item +- Second item +- Third item + - Nested item + - Another nested item +``` + +### Ordered lists + +```markdown +1. First step +2. Second step +3. Third step + 1. Nested step + 2. Another nested step +``` + +### Best practices + +- Limit bulleted lists to 5 items when possible +- Don't add commas or semicolons to list item ends +- Capitalize list items for ease of scanning +- Make all list items parallel in structure +- For nested sequential lists, use lowercase letters (a, b, c) + +## Tables + +Use standard Markdown table syntax with sentence case for headings. + +**Example:** + +```markdown +| Feature | Description | Availability | +| -------------- | ------------------------------- | ------------ | +| Docker Compose | Multi-container orchestration | All | +| Docker Scout | Security vulnerability scanning | Business | +| Build Cloud | Remote build service | Pro, Team | +``` + +**Best practices:** + +- Use sentence case for table headings +- Don't leave cells empty - use "N/A" or "None" +- Align decimals on the decimal point +- Keep tables scannable - avoid dense content + +## Quick reference + +### File structure + +```plaintext +content/ +├── manuals/ # Product documentation +│ ├── docker-desktop/ +│ ├── docker-hub/ +│ └── ... +├── guides/ # Learning guides +├── reference/ # API and CLI reference +└── includes/ # Reusable content snippets +``` + +### Common patterns + +**Platform-specific instructions:** + +Use tabs with consistent names: Linux, macOS, Windows + +**Optional content:** + +Use accordions for advanced or optional information + +**Version/subscription indicators:** + +Use badges or summary bars + +**Important warnings:** + +Use callouts (NOTE, WARNING, CAUTION) + +**Code examples:** + +Use `console` for interactive shells, appropriate language hints for code diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ce05f85a896..22766bb85dd1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,11 +3,14 @@ We value documentation contributions from the Docker community. We'd like to make it as easy as possible for you to work in this repository. -Our style guide and instructions on using our page templates and components is -available in the [contribution section](https://docs.docker.com/contribute/) on -the website. +Before contributing, review our documentation standards: -The following guidelines describe the ways in which you can contribute to the +- [STYLE.md](STYLE.md) - Writing style, voice, grammar, and formatting + guidelines +- [COMPONENTS.md](COMPONENTS.md) - How to use Hugo shortcodes, front matter, + and components + +The following guidelines describe how to contribute to the Docker documentation at <https://docs.docker.com/>, and how to get started. ## Reporting issues @@ -91,6 +94,9 @@ To stop the development server: 1. In your terminal, press `<Ctrl+C>` to exit the file watch mode of Compose. 2. Stop the Compose service with the `docker compose down` command. +> [!NOTE] +> Alternatively, if you have installed Hugo, you can build with `hugo serve`. + ### Testing Before you push your changes and open a pull request, we recommend that you @@ -105,13 +111,17 @@ If this command doesn't result in any errors, you're good to go! ## Content not edited here -CLI reference documentation is maintained in upstream repositories. It's -partially generated from code, and is only vendored here for publishing. To -update the CLI reference docs, refer to the corresponding repository: +CLI reference documentation is maintained in upstream repositories and +generated from YAML data files in `data/cli/`. A Hugo content adapter +(`content/reference/cli/_content.gotmpl`) turns these data files into pages +automatically. To update the CLI reference docs, refer to the corresponding +repository: - [docker/cli](https://github.com/docker/cli) - [docker/buildx](https://github.com/docker/buildx) - [docker/compose](https://github.com/docker/compose) +- [docker/model-runner](https://github.com/docker/model-runner) +- [docker/mcp-gateway](https://github.com/docker/mcp-gateway) Feel free to raise an issue on this repository if you're not sure how to proceed, and we'll help out. diff --git a/Dockerfile b/Dockerfile index c7e22db80cc7..b0ab6a5993cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ # syntax=docker/dockerfile:1 # check=skip=InvalidBaseImagePlatform -ARG ALPINE_VERSION=3.21 -ARG GO_VERSION=1.23.8 +ARG ALPINE_VERSION=3.23 +ARG GO_VERSION=1.26 ARG HTMLTEST_VERSION=0.17.0 -ARG HUGO_VERSION=0.141.0 -ARG NODE_VERSION=22 -ARG PAGEFIND_VERSION=1.3.0 +ARG VALE_VERSION=3.17.0 +ARG HUGO_VERSION=0.163.0 +ARG NODE_VERSION=24 +ARG PAGEFIND_VERSION=1.5.2 # base defines the generic base stage FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base @@ -14,7 +15,8 @@ RUN apk add --no-cache \ git \ nodejs \ npm \ - gcompat + gcompat \ + rsync # npm downloads Node.js dependencies FROM base AS npm @@ -48,16 +50,19 @@ ARG HUGO_ENV="development" ARG DOCS_URL="https://docs.docker.com" ENV HUGO_CACHEDIR="/tmp/hugo_cache" RUN --mount=type=cache,target=/tmp/hugo_cache \ - hugo --gc --minify -e $HUGO_ENV -b $DOCS_URL + hugo \ + --gc \ + --minify \ + --panicOnWarning \ + --printPathWarnings \ + --printUnusedTemplates \ + -b $DOCS_URL \ + -e $HUGO_ENV +RUN ./hack/flatten-and-resolve.js public # lint lints markdown files -FROM davidanson/markdownlint-cli2:v0.14.0 AS lint -USER root -RUN --mount=type=bind,target=. \ - /usr/local/bin/markdownlint-cli2 \ - "content/**/*.md" \ - "#content/manuals/engine/release-notes/*.md" \ - "#content/manuals/desktop/previous-versions/*.md" +FROM ghcr.io/rvben/rumdl:0.2.49-alpine AS lint +RUN --mount=type=bind,target=. rumdl check content # test validates HTML output and checks for broken links FROM wjdp/htmltest:v${HTMLTEST_VERSION} AS test @@ -66,6 +71,23 @@ COPY --from=build /project/public ./public ADD .htmltest.yml .htmltest.yml RUN htmltest +# vale +FROM jdkato/vale:v${VALE_VERSION} AS vale-run +WORKDIR /src +ARG GITHUB_ACTIONS +RUN --mount=type=bind,target=.,rw <<EOT + set -e + mkdir /out + args="" + [ "$GITHUB_ACTIONS" = "true" ] && args="--output=.vale-rdjsonl.tmpl" + set -x + vale sync + vale $args content/ | tee /out/vale.out +EOT + +FROM scratch AS vale +COPY --from=vale-run /out/vale.out / + # update-modules downloads and vendors Hugo modules FROM build-base AS update-modules # MODULE is the Go module path and version of the module to update @@ -74,8 +96,6 @@ RUN <<"EOT" set -ex if [ -n "$MODULE" ]; then hugo mod get ${MODULE} - RESOLVED=$(cat go.mod | grep -m 1 "${MODULE/@*/}" | awk '{print $1 "@" $2}') - go mod edit -replace "${MODULE/@*/}=${RESOLVED}"; else echo "no module set"; fi @@ -87,6 +107,22 @@ FROM scratch AS vendor COPY --from=update-modules /project/_vendor /_vendor COPY --from=update-modules /project/go.* / +FROM base AS validate-vendor +RUN --mount=target=/context \ + --mount=type=bind,from=vendor,target=/out \ + --mount=target=.,type=tmpfs <<EOT +set -e +rsync -a /context/. . +git add -A +rm -rf _vendor +cp -rf /out/* . +if [ -n "$(git status --porcelain -- go.mod go.sum _vendor)" ]; then + echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make vendor"' + git status --porcelain -- go.mod go.sum _vendor + exit 1 +fi +EOT + # build-upstream builds an upstream project with a replacement module FROM build-base AS build-upstream # UPSTREAM_MODULE_NAME is the canonical upstream repository name and namespace (e.g. moby/buildkit) @@ -112,18 +148,6 @@ RUN apk add --no-cache fd ripgrep WORKDIR /test RUN --mount=type=bind,target=. ./hack/test/unused_media -# path-warnings checks for duplicate target paths -FROM build-base AS path-warnings -RUN hugo --printPathWarnings > ./path-warnings.txt -RUN <<EOT -DUPLICATE_TARGETS=$(grep "Duplicate target paths" ./path-warnings.txt) -if [ ! -z "$DUPLICATE_TARGETS" ]; then - echo "$DUPLICATE_TARGETS" - echo "You probably have a duplicate alias defined. Please check your aliases." - exit 1 -fi -EOT - # pagefind installs the Pagefind runtime FROM base AS pagefind ARG PAGEFIND_VERSION diff --git a/README.md b/README.md index 39500fb38823..13f534ebbc64 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,40 @@ # Docs @ Docker -<img src="static/assets/images/docker-docs.png" alt="Welcome to Docker Documentation" style="max-width: 50%;"> +<div align="center"> +<img src="static/assets/images/docker-docs.svg" alt="Welcome to Docker Documentation"> +</div> +<br/> +<br/> -Welcome to the Docker Documentation repository. This is the source for -[https://docs.docker.com/](https://docs.docker.com/). +Welcome to the Docker Documentation repository. This is the source for the [Docker Docs Website](https://docs.docker.com/). -Feel free to send us pull requests and file issues. Our docs are completely -open source, and we deeply appreciate contributions from the Docker community! +Feel free to open pull requests or issues. Our docs are completely open source, and we deeply appreciate contributions from the Docker community! ## Provide feedback -We’d love to hear your feedback. Please file documentation issues only in the -Docs GitHub repository. You can file a new issue to suggest improvements or if -you see any errors in the existing documentation. +We’d love to hear your feedback! To submit feedback: -Before submitting a new issue, check whether the issue has already been -reported. You can join the discussion using an emoji, or by adding a comment to -an existing issue. If possible, we recommend that you suggest a fix to the issue -by creating a pull request. +- Click **[New issue](https://github.com/docker/docs/issues/new)** on the docs repository, or +- Click **Request changes** in the right column of every page on + [docs.docker.com](https://docs.docker.com/), or +- Click **Give feedback** on every page in the docs. -You can ask general questions and get community support through the [Docker -Community Slack](https://dockr.ly/comm-slack). Personalized support is available +To get community support, use the [Docker Community Slack](https://dockr.ly/comm-slack). Personalized support is available through the Docker Pro, Team, and Business subscriptions. See [Docker -Pricing](https://www.docker.com/pricing) for details. +Pricing](https://www.docker.com/pricing?ref=Docs&refAction=DocsReadme) for details. If you have an idea for a new feature or behavior change in a specific aspect of -Docker or have found a product bug, file that issue in the project's code +Docker or have found a product bug, file an issue in the project's repository. -We've made it easy for you to file new issues. - -- Click **[New issue](https://github.com/docker/docs/issues/new)** on the docs repository and fill in the details, or -- Click **Request docs changes** in the right column of every page on - [docs.docker.com](https://docs.docker.com/) and add the details, or - - ![Request changes link](/static/assets/images/docs-site-feedback.png) - -- Click the **Give feedback** link on the side of every page in the docs. - - ![Docs feedback on each page](/static/assets/images/feedback-widget.png) - ## Contribute to Docker docs -We value your contribution. We want to make it as easy as possible to submit -your contributions to the Docker docs repository. Changes to the docs are -handled through pull requests against the `main` branch. To learn how to -contribute, see [CONTRIBUTING.md](CONTRIBUTING.md). +We welcome contributions! To get started: + +- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution workflow and setup +- [STYLE.md](STYLE.md) - Writing style and content guidelines +- [COMPONENTS.md](COMPONENTS.md) - Component and shortcode usage ## Copyright and license -Copyright 2013-2025 Docker, Inc., released under the <a href="https://github.com/docker/docs/blob/main/LICENSE">Apache 2.0 license</a> . +Copyright 2013-2026 Docker, Inc., released under the [Apache 2.0 license](https://github.com/docker/docs/blob/main/LICENSE). diff --git a/STYLE.md b/STYLE.md new file mode 100644 index 000000000000..6909b4b28a4c --- /dev/null +++ b/STYLE.md @@ -0,0 +1,643 @@ +# Docker Documentation Style Guide + +This guide consolidates voice, grammar, formatting, and terminology +standards for Docker documentation. Follow these guidelines to create +clear, consistent, and helpful content. For instructions on how to use +components, shortcodes, and other features, see [COMPONENTS.md](COMPONENTS.md). + +## Voice and tone + +Write like a knowledgeable colleague explaining something useful. We're +developers writing for developers. + +### Core principles: The 4Cs + +1. **Correct** - Information is accurate +2. **Concise** - Succinct without unnecessary words +3. **Complete** - Includes enough detail to complete the task +4. **Clear** - Easy to understand + +### Writing approach + +- **Be honest.** Give all the facts. Don't use misdirection or + ambiguous statements. +- **Be concise.** Don't bulk up communication with fluffy words or + complex metaphors. Get to the point. +- **Be relaxed.** Casual but not lazy, smart but not arrogant, focused + but not cold. Be welcoming and warm. +- **Be inclusive.** Every person is part of our community, regardless + of experience level. + +### Tone guidelines + +- Use a natural, friendly, and respectful tone +- Use contractions to sound conversational (it's, you're, don't) +- Avoid overdoing politeness - skip "please" in most technical documentation +- Be clear over comical +- Use positive language - emphasize what users can do, not what they can't + +**Positive language example:** + +Instead of: "Features such as Single Sign-on (SSO), Image Access +Management, Registry Access Management are not available in Docker Team +subscription." + +Use: "Features such as Single Sign-on (SSO), Image Access Management, +Registry Access Management are available in Docker Business subscription." + +### Avoiding marketing language + +Documentation should be factual and direct, not promotional. + +**Avoid hedge words** that overstate ease or capability: + +- ❌ simply, just, easily, seamlessly (implies ease when it may not be + easy) +- ❌ robust, powerful (marketing language) +- ✅ Instead: describe what it actually does + +**Avoid excessive enthusiasm:** + +- ❌ "powerful feature", "game-changing", "revolutionary", "amazing" +- ✅ Instead: describe the feature and its benefits factually + +**Avoid meta-commentary:** + +These phrases add no value - state the fact directly: + +- ❌ "It's worth noting that..." +- ❌ "It's important to understand that..." +- ❌ "Keep in mind that..." +- ✅ Instead: state the information directly + +### Voice and perspective + +- **Use "you" not "we"**: Focus on what the user can do, not what "we" + created + - ❌ "We provide a feature that helps you deploy" + - ✅ "Deploy your applications with..." +- **Avoid "please"**: Don't use in normal explanations or "please note" + phrases +- **Write timelessly**: Avoid "currently" or "as of this writing" - the + documentation describes the product as it is today + +### Explain technical behavior + +Explain behavior from the reader's perspective. Lead with the observable +outcome, then add the implementation details needed to explain it. + +Prefer: + +> Changes made by the agent stay inside the sandbox until you fetch them. The +> agent works in a separate Git clone inside the sandbox. + +Avoid: + +> A session that works directly in the sandbox clone still can't modify your +> host repository. + +The preferred version tells readers where changes happen and when they become +visible. The second version makes readers reconstruct the relationship between +the session, sandbox clone, and host repository. + +Separate guarantees from variable behavior. Don't present behavior controlled +by another tool as a product default or guarantee. When behavior varies, +structure the explanation in this order: + +1. State what always happens +2. State what the product doesn't control +3. Tell the reader what to do + +For example: + +> The `--clone` flag creates the clone, but it doesn't separate one task from +> another. To keep parallel tasks isolated, instruct your agent tool to create +> a separate branch or worktree for each task. + +Avoid chains of qualifications such as "may," "can," and "depends" that leave +the reader without a conclusion. Keep qualifiers that are needed for accuracy. +State what controls the behavior and what the reader should do. + +### Scope preservation + +When updating existing documentation, resist the urge to expand +unnecessarily. Users value brevity. + +**Understand the current document:** +Read it fully to grasp its scope, length, and character. Is it a minimal +how-to or a comprehensive reference? + +**Match the existing character:** +If the document is brief and direct (90 lines), keep it that way. Don't +transform a focused guide into an exhaustive tutorial. + +**Add only what's genuinely missing:** +Fill gaps, don't elaborate. If the document already covers a topic +adequately, don't expand it. + +**Value brevity:** +Say what needs to be said, then stop. Not every topic needs +prerequisites, troubleshooting, best practices, and examples sections. + +**Respect the original intent:** +The document exists in its current form for a reason. Improve it, don't +remake it. + +Good additions fill genuine gaps. Bad additions change the document's +character. When in doubt, add less rather than more. + +Include caveats, failure scenarios, and fallback behavior only when they affect +a decision or action. Don't turn a clarification into a catalog of edge +cases. + +## Grammar and style + +Write in US English with US grammar. + +### Acronyms and initialisms + +- Spell out lesser-known acronyms on first use, then follow with the + acronym in parentheses: "single sign-on (SSO)" +- Don't spell out common acronyms like URL, HTML, API +- Use all caps for file type acronyms: JPEG, PNG +- Don't use apostrophes for plurals: URLs not URL's +- Avoid introducing acronyms in headings - introduce them in the body + text that follows + +### Capitalization + +Use sentence case for almost everything: headings, titles, links, buttons, +navigation labels. + +- Capitalize Docker solutions: Docker Desktop, Docker Hub, Docker Extensions +- Capitalize job titles only when they immediately precede a name: + "Chief Executive Officer Scott Johnston" but "Scott Johnston, chief + executive officer" +- Follow company capitalization preferences: DISH, bluecrux +- Match UI capitalization when referring to specific interface elements + +### Contractions + +Use contractions to maintain a conversational tone, but don't overdo it. + +- Stay consistent - don't switch between "you are" and "you're" in the + same content +- Avoid negative contractions when possible (can't, don't, won't) - + rewrite to be positive +- Never contract a noun with a verb (your container is ready, not your + container's ready) + +### Clear subjects and modifiers + +Name the actor when a system includes multiple tools or components. Repeat the +noun instead of using an ambiguous pronoun. For example, distinguish between +what a CLI creates, what an agent edits, and what remains on the host. + +Avoid unclear subjects: + +- ❌ After enabling auto-log-out, your users are logged out +- ✅ When you enable auto-log-out, your users are logged out + +### Dates and numbers + +- Use US date format: June 26, 2021 or Jun. 26, 2021 +- Spell out numbers one through nine, except in units: 4 MB +- Use numerals for 10 and above: 10, 625, 1000 +- Use decimals instead of fractions: 0.5 not ½ +- For numbers with five or more digits, use spaces instead of commas: + 14 586 not 14,586 +- For version numbers: version 4.8.2, v1.0, Docker Hub API v2 + +### Punctuation + +- **Commas:** Use the Oxford comma (serial comma) in lists +- **Colons:** Use to introduce lists or provide explanations +- **Semicolons:** Don't use - write two sentences instead +- **Em dashes:** Use sparingly with spaces on either side: "text - like + this - text" +- **Hyphens:** Use for compound adjectives before nouns: + "up-to-date documentation" +- **Exclamation marks:** Avoid +- **Parentheses:** Avoid in technical documentation - they reduce + readability + +### Conciseness and redundant phrases + +Remove unnecessary words to make documentation clearer and more direct. + +Keep an adjective or qualifier only when it changes how readers understand the +behavior or complete the task. If removing it doesn't change an outcome, +decision, or next step, remove it. Apply the same test to implementation +details. + +**Eliminate redundant phrases:** + +- ❌ "in order to" → ✅ "to" +- ❌ "serves the purpose of" → ✅ state what it does directly +- ❌ "allows you to" → ✅ "lets you" or state what it does +- ❌ "enables you to" → ✅ "lets you" or state what it does + +### Bold and italics + +Use bold **only** for UI elements (buttons, menus, field labels). Never +use bold for emphasis, product names, or feature names. + +- ✅ Select **Save** (UI button - use bold) +- ✅ Docker Hub provides storage (product name - no bold) +- ✅ This is important to understand (emphasis - no bold) +- ❌ **Docker Desktop** is a tool (product name - don't bold) +- ❌ This is **very important** (emphasis - don't bold) +- ❌ The **build** command (command name - don't bold) + +**Italics:** +Use italics sparingly, as this formatting can be difficult to read in +digital experiences. Notable exceptions are titles of articles, blog +posts, or specification documents. + +## Formatting + +### Content types and detail balance + +Different content types require different writing approaches. Match your +style and detail level to the content type. + +**Getting Started / Tutorials:** + +- Step-by-step instructions +- Assume beginner knowledge +- Explain _why_ at each step +- Include more context and explanation + +**How-to Guides:** + +- Task-focused and goal-oriented +- Assume intermediate knowledge +- Focus on _how_ efficiently +- Less explanation, more direct steps + +**Reference Documentation:** + +- Comprehensive and exhaustive +- Assume advanced knowledge +- Focus on _what_ precisely +- Complete parameter lists and options + +**Concept Explanations:** + +- Educational and foundational +- Any skill level +- Focus on _understanding_ over doing +- Theory before practice + +**Match detail to context:** + +- **First mention** of a concept: explain it +- **Subsequent mentions**: link to the explanation or use the term + directly if recently explained +- **Common knowledge** (to your audience): state it, don't explain it +- **Edge cases**: mention them but don't let them dominate the main flow + +### Headings + +- Keep headings short (no more than eight words) +- Front-load the most important words +- Use descriptive, action-oriented language +- Skip leading articles (a, the) +- Avoid puns, teasers, and cultural references +- Page titles should be action-oriented: "Install Docker Desktop", + "Enable SCIM" + +### Page structure and flow + +Every page should answer two questions in the first paragraph: + +1. **What will I learn?** - State what the page covers +2. **Why does this matter?** - Explain the benefit or use case + +**Good opening:** + +```markdown +Docker Compose Watch automatically updates your running containers when +you change code. This eliminates the manual rebuild-restart cycle during +development. +``` + +**Weak opening:** + +```markdown +Docker Compose Watch is a powerful feature that enables developers to +streamline their development workflow by providing automatic +synchronization capabilities. +``` + +**Transitions and flow:** +Connect ideas naturally. Each section should flow logically from the +previous one. Save detailed discussions for after showing basic usage - +don't front-load complexity. + +**Good flow:** + +1. Prerequisites +2. Basic usage (show the simple case first) +3. Advanced options (add complexity after basics are clear) + +**Jarring flow:** + +1. Prerequisites +2. Overview of all capabilities (too much before seeing it work) +3. Basic usage + +**Avoid structural problems:** + +- Don't start multiple sentences or sections with the same structure + (varies pacing and improves readability) +- Don't over-explain obvious things (trust the reader's competence) +- Don't use "**Bold:** format" for subsection labels (use plain text + with colon) + +### Guide structure + +Guides are single-page - don't split a guide into multiple sub-pages +(for example, separate "overview", "configure", and "deploy" pages for +one guide). Cover the full task on one page and use headings to +organize sections. + +Store each guide as a single Markdown file directly under +`content/guides/` (for example, `content/guides/django.md`), not +wrapped in its own directory with an `index.md`. Guide images belong in +the shared `content/guides/images/` folder, prefixed with the guide's +slug, not in a per-guide directory - see [Images](STYLE.md#images). + +### Lists + +- Limit bulleted lists to five items when possible +- Don't add commas or semicolons to list item ends +- Capitalize list items for ease of scanning +- Make all list items parallel in structure +- Start each item with a capital letter unless it's a parameter or + command +- For nested sequential lists, use lowercase letters: 1. Top level, + a. Child step + +**Avoid marketing-style list formatting:** + +Don't use "**Term** - Description" format, which reads like marketing +copy: + +❌ **Bad example:** + +- **Build** - Creates images from Dockerfiles +- **Run** - Starts containers from images +- **Push** - Uploads images to registries + +✅ **Good alternatives:** + +Use simple descriptive bullets: + +- Build images from Dockerfiles +- Start containers from images +- Upload images to registries + +Or use proper prose when appropriate: +"Docker lets you build images from Dockerfiles, start containers from +images, and upload images to registries." + +### Code and commands + +Format Docker commands, instructions, filenames, and package names as +inline code using backticks: `docker build` + +**Code example pattern:** + +Follow this three-step pattern for code examples: + +1. **State** what you're doing (brief) +2. **Show** the command or code +3. **Explain** the result or key parts (if not obvious) + +**Example:** + +````markdown +Build your image: + +```console +$ docker build -t my-app . +``` + +This creates an image tagged `my-app` using the Dockerfile in the +current directory. +```` + +**When to show command output:** + +- Show output when it helps understanding +- Show output when users need to verify results +- Don't show output for commands with obvious results +- Don't show output when it's not relevant to the point + +For code block syntax, language hints, variables, and advanced features +(line highlighting, collapsible blocks), see +[COMPONENTS.md](COMPONENTS.md#code-blocks). + +### Links + +- Use plain, descriptive language (around five words) +- Front-load important terms at the beginning +- Avoid generic calls to action like "click here" or "find out more" +- Don't include end punctuation in link text +- Use relative links with source filenames for internal links +- Don't make link text bold or italic unless it would be in normal + body copy + +### Images + +**Best practices:** + +- Capture only relevant UI - don't include unnecessary white space +- Use realistic text, not lorem ipsum +- Keep images small and focused +- Compress images before adding to repository +- Remove unused images from repository + +**File organization:** + +- Store guide images in the shared `content/guides/images/` folder, + not in a per-guide directory +- Prefix filenames with the guide's slug to avoid collisions (for + example, `kafka-architecture.webp`) + +For image syntax and parameters (sizing, borders), see +[COMPONENTS.md](COMPONENTS.md#images). + +### Callouts + +Use callouts sparingly to emphasize important information. Use them only +when information truly deserves special emphasis - for warnings, critical +notes, or important context that affects how users approach a task. + +Callout types: Note (informational), Tip (helpful suggestion), Important +(moderate issue), Warning (potential damage/loss), Caution (serious risk). + +For syntax and detailed usage guidelines, see +[COMPONENTS.md](COMPONENTS.md#callouts). + +### Tables + +- Use sentence case for table headings +- Don't leave cells empty - use "N/A" or "None" if needed +- Align decimals on the decimal point + +### Navigation instructions + +- Use location, then action: "From the **Visibility** drop-down list, select Public" +- Be brief and specific: "Select **Save**" +- Start with the reason if a step needs one: "To view changes, select the link" + +### Optional steps + +Start optional steps with "Optional." followed by the instruction: + +_1. Optional. Enter a description for the job._ + +### File types and units + +- Use formal file type names: "a PNG file" not "a .png file" +- Use abbreviated units with spaces: "10 GB" not "10GB" or + "10 gigabytes" + +## Word list + +### Recommended terms + +| Use | Don't use | +| ------------------------------------- | ---------------------- | +| lets | allows | +| turn on, toggle on | enable | +| turn off, toggle off | disable | +| select | click | +| following | below | +| previous | above | +| checkbox | check box | +| username | account name | +| sign in | sign on, log in, login | +| sign up, create account | register | +| for example, such as | e.g. | +| run | execute | +| want | wish | +| Kubernetes | K8s | +| repository | repo | +| administrator (first use), admin (UI) | - | +| and | & (ampersand) | +| move through, navigate to | scroll | +| (be more precise) | respectively | +| versus | vs, vs. | +| use | utilize | +| help | facilitate | + +Use "turn on" and "turn off" for UI toggles, switches, and settings a user +flips in the interface. In general prose, "enable" and "disable" are +acceptable when describing a feature or capability becoming available — for +example, "When you enable auto-log-out, your users are logged out." Don't +treat every "enable" or "disable" as a violation. + +### Version numbers + +- Use "earlier" not "lower": Docker Desktop 4.1 and earlier +- Use "later" not "higher" or "above": Docker Desktop 4.1 and later + +### Quick transformations + +Common phrases to transform for clearer, more direct writing: + +| Instead of... | Write... | +| ------------------------ | ---------------------------- | +| In order to build | To build | +| This allows you to build | This lets you build / Build | +| Simply run the command | Run the command | +| We provide a feature | Docker provides / You can | +| Utilize the API | Use the API | +| This facilitates testing | This helps test / This tests | +| Click the button | Select the button | +| It's worth noting that X | X (state it directly) | + +### UI elements + +- **tab vs view** - Use "view" for major UI sections, "tab" for + sub-sections +- **toggle** - You "turn on" or "turn off" a toggle + +## Docker terminology + +### Products and features + +- **Docker Compose** - The application or all functionality associated + with it +- **`docker compose`** - Use code formatting for commands +- **Docker Compose CLI** - The family of Compose commands from + Docker CLI +- **Compose plugin** - The add-on for Docker CLI that can be + enabled/disabled +- **compose.yaml** - Current designation for the Compose file (use + code formatting) + +### Technical terms + +- **Digest** - Long string automatically created when you push an + image +- **Member** - A user of Docker Hub who is part of an organization +- **Namespace** - Organization or user name; every image needs a + namespace +- **Node** - Physical or virtual machine running Docker Engine in + swarm mode + - Manager nodes: Perform swarm management and orchestration + - Worker nodes: Execute tasks +- **Registry** - Online storage for Docker images +- **Repository** - Lets users share container images with team, + customers, or community + +### Platform terminology + +- **Multi-platform** - Broad: Mac/Linux/Windows; Narrow: Linux/amd64 + and Linux/arm64 +- **Multi-architecture (multi-arch)** - CPU architecture or + hardware-architecture-based; don't use as synonym for multi-platform + +## Quick reference + +### Voice checklist + +- ✅ Direct and practical +- ✅ Conversational with active voice +- ✅ Specific and actionable +- ✅ Lead with observable outcomes +- ❌ Corporate-speak +- ❌ Condescending +- ❌ Overly formal + +### Structure checklist + +- ✅ Answer "What will I learn?" in the first paragraph +- ✅ Answer "Why does this matter?" in the first paragraph +- ✅ Front-load important information in headings and lists +- ✅ Connect ideas naturally between sections +- ✅ Use examples to clarify concepts +- ✅ Match content type (tutorial vs how-to vs reference vs concept) +- ✅ Follow code example pattern: state → show → explain +- ✅ Preserve document scope (don't unnecessarily expand) + +### Common mistakes + +- ❌ Using "click" instead of "select" +- ❌ Using "below" instead of "following" +- ❌ Starting sentences with numbers (recast the sentence) +- ❌ Using apostrophes in plural acronyms +- ❌ Leaving table cells empty +- ❌ Using commas in large numbers (use spaces) +- ❌ Referring to file types by extension (.png file) +- ❌ Using bold for product names or emphasis (only for UI elements) +- ❌ Using "**Term** - Description" format in lists +- ❌ Using hedge words (simply, easily, just, seamlessly) +- ❌ Using meta-commentary (it's worth noting that...) +- ❌ Using "we" instead of "you" or "Docker" +- ❌ Showing command output when it's not needed +- ❌ Not explaining what users will learn in first paragraph diff --git a/_vale/.vale-config/0-Hugo.ini b/_vale/.vale-config/0-Hugo.ini deleted file mode 100644 index 4347ca9e902a..000000000000 --- a/_vale/.vale-config/0-Hugo.ini +++ /dev/null @@ -1,10 +0,0 @@ -[*.md] -# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}}) -TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \ -(\[.+\]\({{< .+ >}}\)), \ -[^\S\r\n]({{[%<] \w+ .+ [%>]}})\s, \ -[^\S\r\n]({{[%<](?:/\*) .* (?:\*/)[%>]}})\s - -# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}` -BlockIgnores = (?sm)^({{[%<] \w+ [^{]*?\s[%>]}})\n$, \ -(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}}) diff --git a/_vale/Docker/Acronyms.yml b/_vale/Docker/Acronyms.yml deleted file mode 100644 index 476d8937d5b9..000000000000 --- a/_vale/Docker/Acronyms.yml +++ /dev/null @@ -1,164 +0,0 @@ -extends: conditional -message: "'%s' has no definition." -link: https://docs.docker.com/contribute/style/grammar/#acronyms-and-initialisms -level: warning -ignorecase: false -# Ensures that the existence of 'first' implies the existence of 'second'. -first: '\b([A-Z]{2,5})\b' -second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{2,5})s?\)' -# ... with the exception of these: -exceptions: - - ACH - - AGPL - - AI - - API - - ARM - - ARP - - ASP - - AUFS - - AWS - - BIOS - - BPF - - BSD - - CFS - - CI - - CIDR - - CISA - - CLI - - CNCF - - CORS - - CPU - - CSS - - CSV - - CUDA - - CVE - - DAD - - DCT - - DEBUG - - DHCP - - DNS - - DOM - - DPI - - DSOS - - DVP - - ECI - - ELK - - FAQ - - FPM - - FUSE - - GB - - GCC - - GDB - - GET - - GHSA - - GNOME - - GNU - - GPG - - GPL - - GPU - - GRUB - - GTK - - GUI - - GUID - - HEAD - - HTML - - HTTP - - HTTPS - - IAM - - IBM - - ID - - IDE - - IP - - IPAM - - IPC - - IT - - JAR - - JIT - - JSON - - JSX - - KDE - - LESS - - LLDB - - LLM - - LTS - - MAC - - MATE - - MCP - - mcp - - MDM - - MDN - - MSI - - NAT - - NET - - NFS - - NOTE - - NTFS - - NTLM - - NUMA - - NVDA - - OCI - - OS - - OSI - - OSS - - PATH - - PDF - - PEM - - PID - - PHP - - POSIX - - POST - - QA - - QEMU - - RAM - - REPL - - REST - - RFC - - RHEL - - RPM - - RSA - - SAML - - SARIF - - SBOM - - SCIM - - SCM - - SCSS - - SCTP - - SDK - - SLES - - SLSA - - SOCKS - - SPDX - - SQL - - SSD - - SSH - - SSL - - SSO - - SVG - - TBD - - TCP - - TCP - - TIP - - TLS - - TODO - - TTY - - TXT - - UDP - - URI - - URL - - USB - - USD - - UTF - - UTS - - UUID - - VAT - - VDI - - VIP - - VLAN - - VM - - VPN - - WSL - - XML - - XSS - - YAML - - ZFS - - ZIP diff --git a/_vale/Docker/Capitalization.yml b/_vale/Docker/Capitalization.yml index 0b6ed0bb563e..ab22a9d32f13 100644 --- a/_vale/Docker/Capitalization.yml +++ b/_vale/Docker/Capitalization.yml @@ -7,4 +7,4 @@ action: params: - Docker tokens: - - '[^\[/]docker[^/]' + - '[^\[/\-.]docker[^/\-.\w]' diff --git a/_vale/Docker/Exclamation.yml b/_vale/Docker/Exclamation.yml index 6059a42870b1..53c606a3fc67 100644 --- a/_vale/Docker/Exclamation.yml +++ b/_vale/Docker/Exclamation.yml @@ -7,5 +7,10 @@ action: params: - trim_right - "!" +# Product names that legitimately end in an exclamation point. List the +# name without the trailing "!" — the exception is matched against the +# word that precedes the exclamation point. +exceptions: + - 'SDKMAN' tokens: - '\w+!(?:\s|$)' diff --git a/_vale/Docker/Forbidden.yml b/_vale/Docker/Forbidden.yml new file mode 100644 index 000000000000..d8b7a37ae8c9 --- /dev/null +++ b/_vale/Docker/Forbidden.yml @@ -0,0 +1,6 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +level: error +ignorecase: false +swap: + Docker CE: Docker Engine diff --git a/_vale/Docker/HeadingLength.yml b/_vale/Docker/HeadingLength.yml deleted file mode 100644 index 270ccf80aed1..000000000000 --- a/_vale/Docker/HeadingLength.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: occurrence -message: "Try to keep headings short (< 8 words)." -link: https://docs.docker.com/contribute/style/formatting/#headings-and-subheadings -scope: heading -level: suggestion -max: 8 -token: \b(\w+)\b diff --git a/_vale/Docker/HeadingSentenceCase.yml b/_vale/Docker/HeadingSentenceCase.yml deleted file mode 100644 index b5edebee1b24..000000000000 --- a/_vale/Docker/HeadingSentenceCase.yml +++ /dev/null @@ -1,8 +0,0 @@ -extends: capitalization -message: "Use sentence case for headings: '%s'." -level: warning -scope: heading -match: $sentence -threshold: 0.4 -indicators: - - ":" diff --git a/_vale/Docker/RecommendedWords.yml b/_vale/Docker/RecommendedWords.yml index 2721e0881fb1..8a37d58f0e1f 100644 --- a/_vale/Docker/RecommendedWords.yml +++ b/_vale/Docker/RecommendedWords.yml @@ -10,14 +10,11 @@ swap: '\b(?:ie|i\.e\.)[\s,]': that is (?:account name|accountname|user name): username (?:drop down|dropdown): drop-down - (?:log out|logout): sign out - (?:sign on|log on|log in|logon|login): sign in - above: previous + \blog out\b: sign out + \b(?:sign on|log on|log in)\b: sign in adaptor: adapter - admin(?! console): administrator administrate: administer afterwards: afterward - allow: let allows: lets alphabetic: alphabetical alphanumerical: alphanumeric @@ -27,7 +24,6 @@ swap: anti-virus: antivirus appendixes: appendices assembler: assembly - below: following check box: checkbox check boxes: checkboxes click: select @@ -39,5 +35,5 @@ swap: repo: repository scroll: navigate url: URL - vs: versus + '\bvs\b(?!\.|\s+Code)': versus wish: want diff --git a/_vale/Docker/SentenceLength.yml b/_vale/Docker/SentenceLength.yml deleted file mode 100644 index 41bcdd12603f..000000000000 --- a/_vale/Docker/SentenceLength.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: occurrence -message: "Write short, concise sentences. (<=40 words)" -scope: sentence -link: https://docs.docker.com/contribute/checklist/ -level: warning -max: 40 -token: \b(\w+)\b diff --git a/_vale/Docker/Units.yml b/_vale/Docker/Units.yml index cc9134fe5456..4e67c1ac2799 100644 --- a/_vale/Docker/Units.yml +++ b/_vale/Docker/Units.yml @@ -3,8 +3,8 @@ message: "Use '%s' instead of '%s'" link: https://docs.docker.com/contribute/style/recommended-words/ level: error swap: - (?:kilobytes?|KB): kB + kilobytes?: kB gigabytes?: GB megabytes?: MB petabytes?: PB - terrabytes?: TB + terabytes?: TB diff --git a/_vale/Docker/VersionText.yml b/_vale/Docker/VersionText.yml index 3210997efce1..37061de8da20 100644 --- a/_vale/Docker/VersionText.yml +++ b/_vale/Docker/VersionText.yml @@ -4,9 +4,9 @@ link: https://docs.docker.com/contribute/style/recommended-words/#later scope: raw raw: - '\bv?' - - '(?P<major>0|[1-9]\d*)\.?' - - '(?P<minor>0|[1-9]\d*)?\.?' - - '(?P<patch>0|[1-9]\d*)?' + - '(?P<major>0|[1-9]\d*)\.' + - '(?P<minor>0|[1-9]\d*)' + - '(?:\.(?P<patch>0|[1-9]\d*))?' - '(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?' - '(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?' - '\b (and|or) (higher|above)' diff --git a/_vale/Docker/We.yml b/_vale/Docker/We.yml index 331d477bea2e..bc94d6da743a 100644 --- a/_vale/Docker/We.yml +++ b/_vale/Docker/We.yml @@ -1,10 +1,11 @@ extends: existence message: "Avoid using first-person plural like '%s'." level: warning -ignorecase: true +ignorecase: false tokens: - - we - - we'(?:ve|re) - - ours? + - '[Ww]e' + - "[Ww]e'(?:ve|re)" + - '[Oo]urs?' - us - - let's + - Us + - "[Ll]et's" diff --git a/_vale/config/vocabularies/Docker/accept.txt b/_vale/config/vocabularies/Docker/accept.txt index f2621ae38394..48cfd4c6fdd2 100644 --- a/_vale/config/vocabularies/Docker/accept.txt +++ b/_vale/config/vocabularies/Docker/accept.txt @@ -1,128 +1,311 @@ (?i)[A-Z]{2,}'?s +jq +zstd +Zstandard +untracked +ripgrep +exfiltration +sandboxing +Adreno +Aleksandrov +Awaitility Amazon Anchore +Ansible Apple Artifactory +armhf +[Aa]uditability +auditable +[Aa]utoconfiguration +autolock +[Aa]llowlist(ing)? Azure +Azure AD +[Bb]ackport +[Bb]enchmarked +bootup +Bitnami Btrfs +Bugsnag BuildKit +buildkitd BusyBox +cagent +CD CentOS Ceph +cgroup Chrome Chrome DevTools +CI +CI/CD Citrix +classpath +cli +CLI CloudFront +composable Codefresh Codespaces -CouchDB +config +containerd Couchbase +CouchDB +CrowdStrike +[Cc]ybersecurity +datacenter +datasource Datadog +DBeaver Ddosify Debootstrap +denylist +deprovisioning +deserialization +deserialize[d]? Dev -Dex Dev Environments? +Dex +displayName Django +DMR Docker Build Cloud Docker Business -Docker Dasboard +Docker Dashboard Docker Desktop Docker Engine Docker Extension Docker Hub Docker Scout Docker Team -Docker's Docker-Sponsored Open Source +Docker's Dockerfile +dockerignore Dockerize +Dockerized Dockerizing +Dependabot +DuckDuckGo +Dynatrace Entra +EPERM +ESXi Ethernet +[Ee]xploitability +[Ff]ailover Fargate Fedora +Filebeat +firewalld Flink +Fluentd +g?libc GeoNetwork +GGUF Git -GitHub( Actions)? +Gitea +GitHub +GitHub Actions Google +Gradle Grafana Gravatar +gRPC +Groq +Grype +Gunicorn HyperKit -IPv[46] -IPvlan +inferencing +initializer +Initializr +inotify Intel Intune -JFrog +IPsec +iptables +IPv[46] +IPvlan +isort Jamf +JavaScript JetBrains +JFrog JUnit +Kata +Keycloak Kerberos +Kiro Kitematic Kubeadm +kubectl +kubefwd +kubelet Kubernetes -Laravel Laradock +Laravel +libseccomp Linux +Liquibase LinuxKit +logback +Loggly Logstash -Mac +lookup +macOS +macvlan Mail(chimp|gun) +mfsymlinks +Micronaut Microsoft +minikube +misconfiguration +[Mm]ixins? +monorepos? +musl MySQL -NFSv\d +nameserver +namespaced? +namespacing +Neovim +Npgsql +netfilter +netlabel +netlink Netplan +NFSv\d Nginx +npm +nvm Nutanix Nuxeo +NVIDIA OAuth +Okta Ollama +osquery +osxfs OTel -Okta -PKG Paketo +PAT +perl +pgAdmin +pgx +PKG +plaintext +plist +pluggable Postgres +psycopg +pytest PowerShell Python +Qualcomm +Quickview +rebalance +reimplement +reloader +repinning +Rego +Rekor +ROCm +rollback +rootful +rqt +runc +RViz Ryuk S3 -SQLite +scrollable +SELinux Slack +snapshotters? +Sigstore Snyk Solr SonarQube +Sonoma +Splunk +SQLite +stargz +stdin +stdout +subfolder +sudo +[Ss]ubvolume Syft +syntaxes Sysbox +sysctl +sysctls Sysdig +systemd +teleop Testcontainers +tmpfs Traefik +Trivy Trixie +Turtlesim +typesafe Ubuntu +ufw +uv +umask +[Uu]ncaptured +unconfigured +undeterminable Unix +unmarshalling +unmanaged +upsert +Visual Studio Code VMware +VPNKit +vSphere +Vulkan +Vue Wasm +Wasmtime Windows +windowsfilter WireMock +workdir +WORKDIR +[Ww]orktrees? +[Pp]assthrough +[Pp]reconfigured Xdebug +xUnit +XQuartz +youki +Yubikey Zscaler Zsh [Aa]nonymized? [Aa]utobuild [Aa]llowlist +[Aa]gentic [Aa]utobuilds? [Aa]utotests? +[Aa]utoscaling [Bb]uildx [Bb]uildpack(s)? [Bb]uildx [Cc]odenames? [Cc]ompose [Cc]onfigs +[dD]eduplicate +[Dd]enylist +[Dd]ev +[Dd]iscoverability [Dd]istroless [Ff]ilepaths? [Ff]iletypes? [GgCc]oroutine [Hh]ealthcheck +[Hh]eredoc [Hh]ostname [Ii]nfosec [Ii]nline @@ -138,8 +321,11 @@ Zsh [Pp]rocfs [Pp]roxied [Pp]roxying +[pP]yright +README [Rr]eal-time [Rr]egex(es)? +[Rr]uleset(s)? [Rr]untimes? [Ss]andbox(ed)? [Ss]eccomp @@ -153,6 +339,9 @@ Zsh [Ss]warm [Ss]yscalls? [Ss]ysfs +[Tt]eardown +[Tt]echnographic +[Tt]odo [Tt]oolchains? [Uu]narchived? [Uu]ngated @@ -162,54 +351,100 @@ Zsh [Vv]irtiofs [Vv]irtualize [Ww]alkthrough -bootup -cgroup -config -containerd -datacenter -deprovisioning -deserialization -deserialize -displayName -dockerignore -firewalld -g?libc -gRPC -inotify -iptables -kubectl -kubefwd -kubelet -lookup -macOS -macvlan -mfsymlinks -minikube -monorepos? -musl -nameserver -namespace -namespacing -netfilter -netlabel -npm -osquery -osxfs -pgAdmin -rollback -rootful -runc -snapshotters? -stdin -stdout -syntaxes -sysctls -systemd -tmpfs -ufw -uid -umask -unmanaged -vSphere -vpnkit -windowsfilter +[Tt]oolsets? +[Rr]eachability +[Rr]erank(ing|ed)? +[Ee]vals? +[Ll]abspaces? +[Uu]nsloth +AppArmor +[Aa]utolocking +[Bb]oolean +[Bb]reakpoint +CMD +[Dd]eno +[Dd]evicemapper +[Dd]ockerbot +[Dd]ockerd +docker_ce_version +[Ee]nv +ESLint +gzip +HAProxy +[Ii]nlined +journald +JSON +keypair +Kustomize +latest_engine_api_version +[Mm]iddleware +[Nn]onroot +param +[Pp]erformant +Pinecone +Qdrant +[Rr]outable +[Ss]emver +setuid +SHA +spaCy +src +stderr +Streamlit +[Ss]ubcommand +syslog +TCP +thinpool +[Tt]runked +UID +[Uu]nencrypted +[Uu]nmount +URL +VM +Vite +Vitest +Wolfi +[Aa]utoextend +[Bb]ackoff +[Bb]crypt +[Bb]undler +copy_up +[Dd]eclaratively +[Dd]eduplication +dnf +docker_gwbridge +[Gg]lobbing +GPG +KVM +[Mm]ulticast +[Mm]isconfigured +oldstable +OpenSSL +[Ss]tringified +SwarmKit +[Uu]ncomment +bootloader +Buildkite +crypto +Graylog +Heartbleed +Kubuntu +Libnetwork +lockfile +Lubuntu +multimodal +multithreading +Log4Shell +NLP +Nodemon +oldoldstable +parallelizable +PHPUnit +pnpm +PyTorch +Shellshock +Spring4Shell +superset +tokenization +WebGL +Xubuntu diff --git a/_vendor/github.com/docker/buildx/docs/bake-reference.md b/_vendor/github.com/docker/buildx/docs/bake-reference.md index d658d891edd8..635fd96188a1 100644 --- a/_vendor/github.com/docker/buildx/docs/bake-reference.md +++ b/_vendor/github.com/docker/buildx/docs/bake-reference.md @@ -43,7 +43,7 @@ The following attributes are overridden by the last occurrence: - `target.cache-to` - `target.dockerfile-inline` - `target.dockerfile` -- `target.outputs` +- `target.output` - `target.platforms` - `target.pull` - `target.tags` @@ -227,6 +227,8 @@ The following table shows the complete list of attributes that you can assign to | [`description`](#targetdescription) | String | Description of a target | | [`dockerfile-inline`](#targetdockerfile-inline) | String | Inline Dockerfile string | | [`dockerfile`](#targetdockerfile) | String | Dockerfile location | +| [`entitlements`](#targetentitlements) | List | Permissions that the build process requires to run | +| [`extra-hosts`](#targetextra-hosts) | List | Customs host-to-IP mapping | | [`inherits`](#targetinherits) | List | Inherit attributes from other targets | | [`labels`](#targetlabels) | Map | Metadata for images | | [`matrix`](#targetmatrix) | Map | Define a set of variables that forks a target into multiple targets. | @@ -234,8 +236,10 @@ The following table shows the complete list of attributes that you can assign to | [`no-cache-filter`](#targetno-cache-filter) | List | Disable build cache for specific stages | | [`no-cache`](#targetno-cache) | Boolean | Disable build cache completely | | [`output`](#targetoutput) | List | Output destinations | +| [`policy`](#targetpolicy) | List | Policies to validate build sources and metadata | | [`platforms`](#targetplatforms) | List | Target platforms | | [`pull`](#targetpull) | Boolean | Always pull images | +| [`resources`](#targetresources) | Map | Resource limits for build containers | | [`secret`](#targetsecret) | List | Secrets to expose to the build | | [`shm-size`](#targetshm-size) | List | Size of `/dev/shm` | | [`ssh`](#targetssh) | List | SSH agent sockets or keys to expose to the build | @@ -297,7 +301,12 @@ example adds annotations to both the image index and manifests. ```hcl target "default" { - output = [{ type = "image", name = "foo" }] + output = [ + { + type = "image" + name = "foo" + } + ] annotations = ["index,manifest:org.opencontainers.image.authors=dvdksn"] } ``` @@ -314,11 +323,11 @@ This attribute accepts the long-form CSV version of attestation parameters. target "default" { attest = [ { - type = "provenance", - mode = "max", + type = "provenance" + mode = "max" }, { - type = "sbom", + type = "sbom" } ] } @@ -336,12 +345,12 @@ This takes a list value, so you can specify multiple cache sources. target "app" { cache-from = [ { - type = "s3", - region = "eu-west-1", + type = "s3" + region = "eu-west-1" bucket = "mybucket" }, { - type = "registry", + type = "registry" ref = "user/repo:cache" } ] @@ -360,12 +369,12 @@ This takes a list value, so you can specify multiple cache export targets. target "app" { cache-to = [ { - type = "s3", - region = "eu-west-1", + type = "s3" + region = "eu-west-1" bucket = "mybucket" }, { - type = "inline", + type = "inline" } ] } @@ -407,6 +416,11 @@ target "app" { ``` This resolves to the current working directory (`"."`) by default. +Set `BUILDX_BAKE_FILE_RELATIVE_PATHS=1` to resolve local directory paths in +`target.context` and `target.contexts` relative to the Bake file that defines +each path. Compose files use the first Compose file directory as the base, which +matches Compose project directory semantics. Use `cwd://` for paths that should +remain relative to the current working directory when this opt-in is enabled. ```console $ docker buildx bake --print -f - <<< 'target "default" {}' @@ -445,9 +459,9 @@ a context based on the pattern of the context value. ```hcl # docker-bake.hcl target "app" { - contexts = { - alpine = "docker-image://alpine:3.13" - } + contexts = { + alpine = "docker-image://alpine:3.13" + } } ``` @@ -462,9 +476,9 @@ RUN echo "Hello world" ```hcl # docker-bake.hcl target "app" { - contexts = { - src = "../path/to/source" - } + contexts = { + src = "../path/to/source" + } } ``` @@ -485,12 +499,13 @@ COPY --from=src . . ```hcl # docker-bake.hcl target "base" { - dockerfile = "baseapp.Dockerfile" + dockerfile = "baseapp.Dockerfile" } + target "app" { - contexts = { - baseapp = "target:base" - } + contexts = { + baseapp = "target:base" + } } ``` @@ -507,11 +522,11 @@ functionality. ```hcl target "lint" { - description = "Runs golangci-lint to detect style errors" - args = { - GOLANGCI_LINT_VERSION = null - } - dockerfile = "lint.Dockerfile" + description = "Runs golangci-lint to detect style errors" + args = { + GOLANGCI_LINT_VERSION = null + } + dockerfile = "lint.Dockerfile" } ``` @@ -577,6 +592,20 @@ target "integration-tests" { Entitlements are enabled with a two-step process. First, a target must declare the entitlements it requires. Secondly, when invoking the `bake` command, the user must grant the entitlements by passing the `--allow` flag or confirming the entitlements when prompted in an interactive terminal. This is to ensure that the user is aware of the possibly insecure permissions they are granting to the build process. +### `target.extra-hosts` + +Use the `extra-hosts` attribute to define customs host-to-IP mapping for the +target. This has the same effect as passing a [`--add-host`][add-host] flag to +the build command. + +```hcl +target "default" { + extra-hosts = { + my_hostname = "8.8.8.8" + } +} +``` + ### `target.inherits` A target can inherit attributes from other targets. @@ -861,7 +890,7 @@ This is the same as the `--no-cache` flag for `docker build`. ```hcl target "default" { - no-cache = 1 + no-cache = true } ``` @@ -877,6 +906,25 @@ target "default" { } ``` +> [!NOTE] +> Local outputs with `mode=delete` require granting `--allow=buildx.local.delete` +> when invoking `docker buildx bake`. + +### `target.policy` + +Policies to validate build sources and metadata. Each entry uses the same keys +as the `--policy` flag for `docker buildx build` (`filename`, `reset`, +`disabled`, `strict`, `log-level`). Bake also automatically loads +`Dockerfile.rego` alongside the target Dockerfile when present. + +```hcl +target "default" { + policy = [ + { filename = "extra.rego" }, + ] +} +``` + ### `target.platforms` Set target platforms for the build target. @@ -901,6 +949,29 @@ target "default" { } ``` +### `target.resources` + +Sets cgroup resource limits for the containers that run `RUN` instructions +during the build. The supported keys are `memory`, `memory-swap`, `cpu-shares`, +`cpu-period`, `cpu-quota`, `cpuset-cpus`, and `cpuset-mems`. These map to the +equivalent `docker build` flags and to the +[`--resource`](https://docs.docker.com/reference/cli/docker/buildx/build/#resource) +flag for `docker buildx build`. + +```hcl +target "default" { + resources = { + memory = "2g" + memory-swap = "4g" + cpu-quota = 50000 + } +} +``` + +> [!NOTE] +> These limits require a BuildKit daemon that supports per-step resource limits +> and only take effect on Linux. They don't affect the build cache key. + ### `target.secret` Defines secrets to expose to the build target. @@ -913,8 +984,15 @@ variable "HOME" { target "default" { secret = [ - { type = "env", id = "KUBECONFIG" }, - { type = "file", id = "aws", src = "${HOME}/.aws/credentials" }, + { + type = "env" + id = "KUBECONFIG" + }, + { + type = "file" + id = "aws" + src = "${HOME}/.aws/credentials" + } ] } ``` @@ -928,6 +1006,14 @@ RUN --mount=type=secret,id=KUBECONFIG,env=KUBECONFIG \ helm upgrade --install ``` +You can override the source for an existing secret without changing the target's +secret IDs. The secret must already be declared by the target. + +```console +$ docker buildx bake --set default.secret.aws=env=AWS_CREDENTIALS +$ docker buildx bake --set default.secret.KUBECONFIG=src=/path/to/kubeconfig +``` + ### `target.shm-size` Sets the size of the shared memory allocated for build containers when using @@ -971,6 +1057,12 @@ RUN --mount=type=ssh \ && git clone git@github.com:user/my-private-repo.git ``` +> [!NOTE] +> When overriding `ssh` from the command line with `--set`, use the inline +> `id=path` string form rather than the object form shown above, for example +> `docker buildx bake --set "*.ssh=default=$HOME/.ssh/id_ed25519"`. Separate +> multiple paths with commas. See [`bake --set`][set] for details. + ### `target.tags` Image names and tags to use for the build target. @@ -1068,7 +1160,9 @@ or interpolate them in attribute values in your Bake file. ```hcl variable "TAG" { + type = string default = "latest" + description = "Tag to use for build" } target "webapp-dev" { @@ -1081,6 +1175,8 @@ You can assign a default value for a variable in the Bake file, or assign a `null` value to it. If you assign a `null` value, Buildx uses the default value from the Dockerfile instead. +You can also add a description of the variable's purpose with the `description` field. This attribute is useful when combined with the `docker buildx bake --list=variables` option, providing a more informative output when listing the available variables in a Bake file. + You can override variable defaults set in the Bake file using environment variables. The following example sets the `TAG` variable to `dev`, overriding the default `latest` value shown in the previous example. @@ -1089,6 +1185,206 @@ overriding the default `latest` value shown in the previous example. $ TAG=dev docker buildx bake webapp-dev ``` +Variables can also be assigned an explicit type. +If provided, it will be used to validate the default value (if set), as well as any overrides. +This is particularly useful when using complex types which are intended to be overridden. +The previous example could be expanded to apply an arbitrary series of tags. +```hcl +variable "TAGS" { + default = ["latest"] + type = list(string) +} + +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = [for tag in TAGS: "docker.io/username/webapp:${tag}"] +} +``` + +This example shows how to generate three tags without changing the file +or using custom functions/parsing: +```console +$ TAGS=dev,latest,2 docker buildx bake webapp-dev +``` + +### Variable typing + +The following primitive types are available: +* `string` +* `number` +* `bool` + +The type is expressed like a keyword; it must be expressed as a literal: +```hcl +variable "OK" { + type = string +} + +# cannot be an actual string +variable "BAD" { + type = "string" +} + +# cannot be the result of an expression +variable "ALSO_BAD" { + type = lower("string") +} +``` +Specifying primitive types can be valuable to show intent (especially when a default is not provided), +but bake will generally behave as expected without explicit typing. + +Complex types are expressed with "type constructors"; they are: +* `tuple([<type>,...])` +* `list(<type>)` +* `set(<type>)` +* `map(<type>)` +* `object({<attr>=<type>},...})` + +The following are examples of each of those, as well as how the (optional) default value would be expressed: +```hcl +# structured way to express "1.2.3-alpha" +variable "MY_VERSION" { + type = tuple([number, number, number, string]) + default = [1, 2, 3, "alpha"] +} + +# JDK versions used in a matrix build +variable "JDK_VERSIONS" { + type = list(number) + default = [11, 17, 21] +} + +# better way to express the previous example; this will also +# enforce set semantics and allow use of set-based functions +variable "JDK_VERSIONS" { + type = set(number) + default = [11, 17, 21] +} + +# with the help of lookup(), translate a 'feature' to a tag +variable "FEATURE_TO_NAME" { + type = map(string) + default = {featureA = "slim", featureB = "tiny"} +} + +# map a branch name to a registry location +variable "PUSH_DESTINATION" { + type = object({branch = string, registry = string}) + default = {branch = "main", registry = "prod-registry.invalid.com"} +} + +# make the previous example more useful with composition +variable "PUSH_DESTINATIONS" { + type = list(object({branch = string, registry = string})) + default = [ + {branch = "develop", registry = "test-registry.invalid.com"}, + {branch = "main", registry = "prod-registry.invalid.com"}, + ] +} +``` +Note that in each example, the default value would be valid even if typing was not present. +If typing was omitted, the first three would all be considered `tuple`; +you would be restricted to functions that operate on `tuple` and, for example, not be able to add elements. +Similarly, the third and fourth would both be considered `object`, with the limits and semantics of that type. +In short, in the absence of a type, any value delimited with `[]` is a `tuple` +and value delimited with `{}` is an `object`. +Explicit typing for complex types not only opens up the ability to use functions applicable to that specialized type, +but is also a precondition for providing overrides. + +> [!NOTE] +> See [HCL Type Expressions][typeexpr] page for more details. + +### Overriding variables + +As mentioned in the [intro to variables](#variable), primitive types (`string`, `number`, and `bool`) +can be overridden without typing and will generally behave as expected. +(When explicit typing is not provided, a variable is assumed to be primitive when the default value lacks `{}` or `[]` delimiters; +a variable with neither typing nor a default value is treated as `string`.) +Naturally, these same overrides can be used alongside explicit typing too; +they may help in edge cases where you want `VAR=true` to be a `string`, where without typing, +it may be a `string` or a `bool` depending on how/where it's used. +Overriding a variable with a complex type can only be done when the type is provided. +This is still done via environment variables, but the values can be provided via CSV or JSON. + +#### CSV overrides + +This is considered the canonical method and is well suited to interactive usage. +It is assumed that `list` and `set` will be the most common complex type, +as well as the most common complex type designed to be overridden. +Thus, there is full CSV support for `list` and `set` +(and `tuple`; despite being considered a structural type, it is more like a collection type in this regard). + + +There is limited support for `map` and `object` and no support for composite types; +for these advanced cases, an alternative mechanism [using JSON](#json-overrides) is available. + +#### JSON overrides + +Overrides can also be provided via JSON. +This is the only method available for providing some complex types and may be convenient if overrides are already JSON +(for example, if they come from a JSON API). +It can also be used when dealing with values are difficult or impossible to specify using CSV (e.g., values containing quotes or commas). +To use JSON, simply append `_JSON` to the variable name. +In this contrived example, CSV cannot handle the second value; despite being a supported CSV type, JSON must be used: +```hcl +variable "VALS" { + type = list(string) + default = ["some", "list"] +} +``` +```console +$ cat data.json +["hello","with,comma","with\"quote"] +$ VALS_JSON=$(< data.json) docker buildx bake + +# CSV equivalent, though the second value cannot be expressed at all +$ VALS='hello,"with""quote"' docker buildx bake +``` + +This example illustrates some precedence and usage rules: +```hcl +variable "FOO" { + type = string + default = "foo" +} + +variable "FOO_JSON" { + type = string + default = "foo" +} +``` + +The variable `FOO` can *only* be overridden using CSV because `FOO_JSON`, which would typically used for a JSON override, +is already a defined variable. +Since `FOO_JSON` is an actual variable, setting that environment variable would be expected to a CSV value. +A JSON override *is* possible for this variable, using environment variable `FOO_JSON_JSON`. + +```Console +# These three are all equivalent, setting variable FOO=bar +$ FOO=bar docker buildx bake <...> +$ FOO='bar' docker buildx bake <...> +$ FOO="bar" docker buildx bake <...> + +# Sets *only* variable FOO_JSON; FOO is untouched +$ FOO_JSON=bar docker buildx bake <...> + +# This also sets FOO_JSON, but will fail due to not being valid JSON +$ FOO_JSON_JSON=bar docker buildx bake <...> + +# These are all equivalent +$ cat data.json +"bar" +$ FOO_JSON_JSON=$(< data.json) docker buildx bake <...> +$ FOO_JSON_JSON='"bar"' docker buildx bake <...> +$ FOO_JSON=bar docker buildx bake <...> + +# This results in setting two different variables, both specified as CSV (FOO=bar and FOO_JSON="baz") +$ FOO=bar FOO_JSON='"baz"' docker buildx bake <...> + +# These refer to the same variable with FOO_JSON_JSON having precedence and read as JSON (FOO_JSON=baz) +$ FOO_JSON=bar FOO_JSON_JSON='"baz"' docker buildx bake <...> +``` + ### Built-in variables The following variables are built-ins that you can use with Bake without having @@ -1101,11 +1397,17 @@ to define them. ### Use environment variable as default -You can set a Bake variable to use the value of an environment variable as a default value: +If an environment variable exists with the same name as a declared Bake +variable, Bake uses that environment variable value instead of the declared +default. + +To disable this environment-based variable lookup, set +`BUILDX_BAKE_DISABLE_VARS_ENV_LOOKUP=1`. + ```hcl variable "HOME" { - default = "$HOME" + default = "/root" } ``` @@ -1169,8 +1471,7 @@ $ docker buildx bake ## Function -A [set of general-purpose functions][bake_stdlib] -provided by [go-cty][go-cty] +A [set of general-purpose functions][bake_stdlib] provided by [go-cty][go-cty] are available for use in HCL files: ```hcl @@ -1208,8 +1509,9 @@ target "webapp-dev" { <!-- external links --> +[add-host]: https://docs.docker.com/reference/cli/docker/buildx/build/#add-host [attestations]: https://docs.docker.com/build/attestations/ -[bake_stdlib]: https://github.com/docker/buildx/blob/master/bake/hclparser/stdlib.go +[bake_stdlib]: https://github.com/docker/buildx/blob/master/docs/bake-stdlib.md [build-arg]: https://docs.docker.com/reference/cli/docker/image/build/#build-arg [build-context]: https://docs.docker.com/reference/cli/docker/buildx/build/#build-context [cache-backends]: https://docs.docker.com/build/cache/backends/ @@ -1223,7 +1525,9 @@ target "webapp-dev" { [platform]: https://docs.docker.com/reference/cli/docker/buildx/build/#platform [run_mount_secret]: https://docs.docker.com/reference/dockerfile/#run---mounttypesecret [secret]: https://docs.docker.com/reference/cli/docker/buildx/build/#secret +[set]: https://docs.docker.com/reference/cli/docker/buildx/bake/#set [ssh]: https://docs.docker.com/reference/cli/docker/buildx/build/#ssh [tag]: https://docs.docker.com/reference/cli/docker/image/build/#tag [target]: https://docs.docker.com/reference/cli/docker/image/build/#target +[typeexpr]: https://github.com/hashicorp/hcl/tree/main/ext/typeexpr [userfunc]: https://github.com/hashicorp/hcl/tree/main/ext/userfunc diff --git a/_vendor/github.com/docker/buildx/docs/bake-stdlib.md b/_vendor/github.com/docker/buildx/docs/bake-stdlib.md new file mode 100644 index 000000000000..569b072bd305 --- /dev/null +++ b/_vendor/github.com/docker/buildx/docs/bake-stdlib.md @@ -0,0 +1,1554 @@ +--- +title: Bake standard library functions +--- + +<!---MARKER_STDLIB_START--> + +| Name | Description | +|:----------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [`absolute`](#absolute) | If the given number is negative then returns its positive equivalent, or otherwise returns the given number unchanged. | +| [`add`](#add) | Returns the sum of the two given numbers. | +| [`and`](#and) | Applies the logical AND operation to the given boolean values. | +| [`base64decode`](#base64decode) | Decodes a string containing a base64 sequence. | +| [`base64encode`](#base64encode) | Encodes a string to a base64 sequence. | +| [`basename`](#basename) | Returns the last element of a path. | +| [`bcrypt`](#bcrypt) | Computes a hash of the given string using the Blowfish cipher. | +| [`byteslen`](#byteslen) | Returns the total number of bytes in the given buffer. | +| [`bytesslice`](#bytesslice) | Extracts a subslice from the given buffer. | +| [`can`](#can) | Tries to evaluate the expression given in its first argument. | +| [`ceil`](#ceil) | Returns the smallest whole number that is greater than or equal to the given value. | +| [`chomp`](#chomp) | Removes one or more newline characters from the end of the given string. | +| [`chunklist`](#chunklist) | Splits a single list into multiple lists where each has at most the given number of elements. | +| [`cidrhost`](#cidrhost) | Calculates a full host IP address within a given IP network address prefix. | +| [`cidrnetmask`](#cidrnetmask) | Converts an IPv4 address prefix given in CIDR notation into a subnet mask address. | +| [`cidrsubnet`](#cidrsubnet) | Calculates a subnet address within a given IP network address prefix. | +| [`cidrsubnets`](#cidrsubnets) | Calculates many consecutive subnet addresses at once, rather than just a single subnet extension. | +| [`coalesce`](#coalesce) | Returns the first of the given arguments that isn't null, or raises an error if there are no non-null arguments. | +| [`coalescelist`](#coalescelist) | Returns the first of the given sequences that has a length greater than zero. | +| [`compact`](#compact) | Removes all empty string elements from the given list of strings. | +| [`concat`](#concat) | Concatenates together all of the given lists or tuples into a single sequence, preserving the input order. | +| [`contains`](#contains) | Returns true if the given value is a value in the given list, tuple, or set, or false otherwise. | +| [`convert`](#convert) | Converts a value to a specified type constraint, using HCL's customdecode extension for type expression support. | +| [`csvdecode`](#csvdecode) | Parses the given string as Comma Separated Values (as defined by RFC 4180) and returns a map of objects representing the table of data, using the first row as a header row to define the object attributes. | +| [`dirname`](#dirname) | Returns the directory of a path. | +| [`distinct`](#distinct) | Removes any duplicate values from the given list, preserving the order of remaining elements. | +| [`divide`](#divide) | Divides the first given number by the second. | +| [`element`](#element) | Returns the element with the given index from the given list or tuple, applying the modulo operation to the given index if it's greater than the number of elements. | +| [`equal`](#equal) | Returns true if the two given values are equal, or false otherwise. | +| [`flatten`](#flatten) | Transforms a list, set, or tuple value into a tuple by replacing any given elements that are themselves sequences with a flattened tuple of all of the nested elements concatenated together. | +| [`floor`](#floor) | Returns the greatest whole number that is less than or equal to the given value. | +| [`format`](#format) | Constructs a string by applying formatting verbs to a series of arguments, using a similar syntax to the C function \"printf\". | +| [`formatdate`](#formatdate) | Deprecated: use formattimestamp instead. Formats a timestamp given in RFC 3339 syntax into another timestamp in some other machine-oriented time syntax, as described in the format string. | +| [`formatlist`](#formatlist) | Constructs a list of strings by applying formatting verbs to a series of arguments, using a similar syntax to the C function \"printf\". | +| [`formattimestamp`](#formattimestamp) | Formats a timestamp string in RFC 3339 syntax or a unix timestamp integer into another timestamp in some other machine-oriented time syntax, as described in the format string. The special format string "X" returns the unix timestamp in seconds. | +| [`greaterthan`](#greaterthan) | Returns true if and only if the second number is greater than the first. | +| [`greaterthanorequalto`](#greaterthanorequalto) | Returns true if and only if the second number is greater than or equal to the first. | +| [`hasindex`](#hasindex) | Returns true if if the given collection can be indexed with the given key without producing an error, or false otherwise. | +| [`homedir`](#homedir) | Returns the current user's home directory. | +| [`indent`](#indent) | Adds a given number of spaces after each newline character in the given string. | +| [`index`](#index) | Returns the element with the given key from the given collection, or raises an error if there is no such element. | +| [`indexof`](#indexof) | Finds the element index for a given value in a list. | +| [`int`](#int) | Discards any fractional portion of the given number. | +| [`join`](#join) | Concatenates together the elements of all given lists with a delimiter, producing a single string. | +| [`jsondecode`](#jsondecode) | Parses the given string as JSON and returns a value corresponding to what the JSON document describes. | +| [`jsonencode`](#jsonencode) | Returns a string containing a JSON representation of the given value. | +| [`keys`](#keys) | Returns a list of the keys of the given map in lexicographical order. | +| [`length`](#length) | Returns the number of elements in the given collection. | +| [`lessthan`](#lessthan) | Returns true if and only if the second number is less than the first. | +| [`lessthanorequalto`](#lessthanorequalto) | Returns true if and only if the second number is less than or equal to the first. | +| [`log`](#log) | Returns the logarithm of the given number in the given base. | +| [`lookup`](#lookup) | Returns the value of the element with the given key from the given map, or returns the default value if there is no such element. | +| [`lower`](#lower) | Returns the given string with all Unicode letters translated to their lowercase equivalents. | +| [`max`](#max) | Returns the numerically greatest of all of the given numbers. | +| [`md5`](#md5) | Computes the MD5 hash of a given string and encodes it with hexadecimal digits. | +| [`merge`](#merge) | Merges all of the elements from the given maps into a single map, or the attributes from given objects into a single object. | +| [`min`](#min) | Returns the numerically smallest of all of the given numbers. | +| [`modulo`](#modulo) | Divides the first given number by the second and then returns the remainder. | +| [`multiply`](#multiply) | Returns the product of the two given numbers. | +| [`negate`](#negate) | Multiplies the given number by -1. | +| [`not`](#not) | Applies the logical NOT operation to the given boolean value. | +| [`notequal`](#notequal) | Returns false if the two given values are equal, or true otherwise. | +| [`or`](#or) | Applies the logical OR operation to the given boolean values. | +| [`parseint`](#parseint) | Parses the given string as a number of the given base, or raises an error if the string contains invalid characters. | +| [`pow`](#pow) | Returns the given number raised to the given power (exponentiation). | +| [`range`](#range) | Returns a list of numbers spread evenly over a particular range. | +| [`regex`](#regex) | Applies the given regular expression pattern to the given string and returns information about a single match, or raises an error if there is no match. | +| [`regex_replace`](#regex_replace) | Applies the given regular expression pattern to the given string and replaces all matches with the given replacement string. | +| [`regexall`](#regexall) | Applies the given regular expression pattern to the given string and returns a list of information about all non-overlapping matches, or an empty list if there are no matches. | +| [`replace`](#replace) | Replaces all instances of the given substring in the given string with the given replacement string. | +| [`reverse`](#reverse) | Returns the given string with all of its Unicode characters in reverse order. | +| [`reverselist`](#reverselist) | Returns the given list with its elements in reverse order. | +| [`rsadecrypt`](#rsadecrypt) | Decrypts an RSA-encrypted ciphertext. | +| [`sanitize`](#sanitize) | Replaces all non-alphanumeric characters with a underscore, leaving only characters that are valid for a Bake target name. | +| [`semvercmp`](#semvercmp) | Returns true if version satisfies a constraint. | +| [`sethaselement`](#sethaselement) | Returns true if the given set contains the given element, or false otherwise. | +| [`setintersection`](#setintersection) | Returns the intersection of all given sets. | +| [`setproduct`](#setproduct) | Calculates the cartesian product of two or more sets. | +| [`setsubtract`](#setsubtract) | Returns the relative complement of the two given sets. | +| [`setsymmetricdifference`](#setsymmetricdifference) | Returns the symmetric difference of the two given sets. | +| [`setunion`](#setunion) | Returns the union of all given sets. | +| [`sha1`](#sha1) | Computes the SHA1 hash of a given string and encodes it with hexadecimal digits. | +| [`sha256`](#sha256) | Computes the SHA256 hash of a given string and encodes it with hexadecimal digits. | +| [`sha512`](#sha512) | Computes the SHA512 hash of a given string and encodes it with hexadecimal digits. | +| [`signum`](#signum) | Returns 0 if the given number is zero, 1 if the given number is positive, or -1 if the given number is negative. | +| [`slice`](#slice) | Extracts a subslice of the given list or tuple value. | +| [`sort`](#sort) | Applies a lexicographic sort to the elements of the given list. | +| [`split`](#split) | Produces a list of one or more strings by splitting the given string at all instances of a given separator substring. | +| [`strlen`](#strlen) | Returns the number of Unicode characters (technically: grapheme clusters) in the given string. | +| [`substr`](#substr) | Extracts a substring from the given string. | +| [`subtract`](#subtract) | Returns the difference between the two given numbers. | +| [`timeadd`](#timeadd) | Adds the duration represented by the given duration string to the given RFC 3339 timestamp string, returning another RFC 3339 timestamp. | +| [`timestamp`](#timestamp) | Returns a string representation of the current date and time. | +| [`title`](#title) | Replaces one letter after each non-letter and non-digit character with its uppercase equivalent. | +| [`trim`](#trim) | Removes consecutive sequences of characters in "cutset" from the start and end of the given string. | +| [`trimprefix`](#trimprefix) | Removes the given prefix from the start of the given string, if present. | +| [`trimspace`](#trimspace) | Removes any consecutive space characters (as defined by Unicode) from the start and end of the given string. | +| [`trimsuffix`](#trimsuffix) | Removes the given suffix from the start of the given string, if present. | +| [`try`](#try) | Variadic function that tries to evaluate all of is arguments in sequence until one succeeds, in which case it returns that result, or returns an error if none of them succeed. | +| [`unixtimestampparse`](#unixtimestampparse) | Given a unix timestamp integer, will parse and return an object representation of that date and time. A unix timestamp is the number of seconds elapsed since January 1, 1970 UTC. | +| [`upper`](#upper) | Returns the given string with all Unicode letters translated to their uppercase equivalents. | +| [`urlencode`](#urlencode) | Applies URL encoding to a given string. | +| [`uuidv4`](#uuidv4) | Generates and returns a Type-4 UUID in the standard hexadecimal string format. | +| [`uuidv5`](#uuidv5) | Generates and returns a Type-5 UUID in the standard hexadecimal string format. | +| [`values`](#values) | Returns the values of elements of a given map, or the values of attributes of a given object, in lexicographic order by key or attribute name. | +| [`zipmap`](#zipmap) | Constructs a map from a list of keys and a corresponding list of values, which must both be of the same length. | + + +<!---MARKER_STDLIB_END--> + +## `absolute` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + val = "${absolute(-42)}" # => 42 + } +} +``` + +## `add` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${add(123, 1)}" # => 124 + } +} +``` + +## `and` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${and(true, false)}" # => false + } +} +``` + +## `base64decode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + decoded = "${base64decode("SGVsbG8=")}" # => "Hello" + } +} +``` + +## `base64encode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + encoded = "${base64encode("Hello")}" # => "SGVsbG8=" + } +} +``` + +## `basename` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + file = "${basename("/usr/local/bin/docker")}" # => "docker" + } +} +``` + +## `bcrypt` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + hash = "${bcrypt("mypassword")}" # => "$2a$10$..." + } +} +``` + +## `byteslen` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + length = "${byteslen("Docker")}" # => 6 + } +} +``` + +## `bytesslice` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + part = "${bytesslice("Docker", 0, 3)}" # => "Doc" + } +} +``` + +## `can` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + safe = "${can(parseint("123", 10))}" # => true + } +} +``` + +## `ceil` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + rounded = "${ceil(3.14)}" # => 4" + } +} +``` + +## `chomp` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${chomp("Hello\n\n")}" # => "Hello" + } +} +``` + +## `chunklist` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${chunklist([1,2,3,4,5], 2)}" # => [[1,2],[3,4],[5]] + } +} +``` + +## `cidrhost` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${cidrhost("10.0.0.0/16", 5)}" # => "10.0.0.5" + } +} +``` + +## `cidrnetmask` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + mask = "${cidrnetmask("10.0.0.0/16")}" # => "255.255.0.0" + } +} +``` + +## `cidrsubnet` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + subnet = "${cidrsubnet("10.0.0.0/16", 4, 2)}" # => "10.0.32.0/20" + } +} +``` + +## `cidrsubnets` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + subs = "${cidrsubnets("10.0.0.0/16", 4, 4)}" # => ["10.0.0.0/20","10.0.16.0/20",...] + } +} +``` + +## `coalesce` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + first = "${coalesce(null, "", "docker")}" # => "docker" + } +} +``` + +## `coalescelist` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + first = "${coalescelist([], [1,2], [3])}" # => [1,2] + } +} +``` + +## `compact` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + list = "${compact(["a", "", "b", ""])}" # => ["a","b"] + } +} +``` + +## `concat` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + list = "${concat([1,2],[3,4])}" # => [1,2,3,4] + } +} +``` + +## `contains` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + check = "${contains([1,2,3], 2)}" # => true + } +} +``` + +## `convert` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${convert("42", number)}" # => 42 + } +} +``` + +## `csvdecode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + data = "${csvdecode("name,age\nAlice,30\nBob,40")}" # => [{"name":"Alice","age":"30"},{"name":"Bob","age":"40"}] + } +} +``` + +## `dirname` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + dir = "${dirname("/usr/local/bin/docker")}" # => "/usr/local/bin" + } +} +``` + +## `distinct` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${distinct([1,2,2,3,3,3])}" # => [1,2,3] + } +} +``` + +## `divide` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${divide(10, 2)}" # => 5 + } +} +``` + +## `element` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + val = "${element(["a","b","c"], 1)}" # => "b" + } +} +``` + +## `equal` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + check = "${equal(2, 2)}" # => true + } +} +``` + +## `flatten` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + flat = "${flatten([[1,2],[3,4],[5]])}" # => [1,2,3,4,5] + } +} +``` + +## `floor` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${floor(3.99)}" # => 3 + } +} +``` + +## `format` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${format("Hello, %s!", "World")}" # => "Hello, World!" + } +} +``` + +## `formatdate` + +> [!WARNING] +> Deprecated: use `formattimestamp` instead. `formatdate` only accepts RFC3339 +> timestamp strings. + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + date = "${formatdate("YYYY-MM-DD", "2025-09-16T12:00:00Z")}" # => "2025-09-16" + } +} +``` + +## `formattimestamp` + +Formats either an RFC3339 timestamp string or a unix timestamp integer. +The special format `X` returns the unix timestamp in seconds. + +```hcl +# docker-bake.hcl +variable "SOURCE_DATE_EPOCH" { + type = number + default = formattimestamp("X", "2015-10-21T00:00:00Z") # => 1445385600 +} + +target "default" { + dockerfile = "Dockerfile" + labels = { + "org.opencontainers.image.created" = formattimestamp("YYYY-MM-DD'T'hh:mm:ssZ", SOURCE_DATE_EPOCH) # => "2015-10-21T00:00:00Z" + } + args = { + build_date = formattimestamp("YYYY-MM-DD", "2025-09-16T12:00:00Z") # => "2025-09-16" + } +} +``` + +## `formatlist` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + list = "${formatlist("Hi %s", ["Alice", "Bob"])}" # => ["Hi Alice","Hi Bob"] + } +} +``` + +## `greaterthan` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${greaterthan(2, 5)}" # => true + } +} +``` + +## `greaterthanorequalto` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${greaterthanorequalto(5, 5)}" # => true + } +} +``` + +## `hasindex` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + exists = "${hasindex([10, 20, 30], 1)}" # => true + missing = "${hasindex([10, 20, 30], 5)}" # => false + } +} +``` + +## `homedir` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + home = "${homedir()}" # => e.g., "/home/user" + } +} +``` + +## `indent` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + text = "${indent(4, "Hello\nWorld")}" + # => " Hello\n World" + } +} +``` + +## `index` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + val = "${index({foo = "bar", baz = "qux"}, "baz")}" # => "qux" + } +} +``` + +## `indexof` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + pos = "${indexof(["a","b","c"], "b")}" # => 1 + } +} +``` + +## `int` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + number = "${int(3.75)}" # => 3 + } +} +``` + +## `join` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + csv = "${join(",", ["a","b","c"])}" # => "a,b,c" + } +} +``` + +## `jsondecode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + obj = "${jsondecode("{\"name\":\"Docker\",\"stars\":5}")}" # => {"name":"Docker","stars":5} + } +} +``` + +## `jsonencode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + str = "${jsonencode({name="Docker", stars=5})}" # => "{\"name\":\"Docker\",\"stars\":5}" + } +} +``` + +## `keys` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + list = "${keys({foo = 1, bar = 2, baz = 3})}" + # => ["bar","baz","foo"] (sorted order) + } +} +``` + +## `length` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + size = "${length([1,2,3,4])}" # => 4 + } +} +``` + +## `lessthan` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${lessthan(10, 3)}" # => false + } +} +``` + +## `lessthanorequalto` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${lessthanorequalto(5, 7)}" # => true + } +} +``` + +## `log` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + val = "${log(100, 10)}" # => 2 + } +} +``` + +## `lookup` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + found = "${lookup({a="apple", b="banana"}, "a", "none")}" # => "apple" + fallback = "${lookup({a="apple", b="banana"}, "c", "none")}" # => "none" + } +} +``` +## `lower` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + val = "${lower("HELLO")}" # => "hello" + } +} +``` + +## `max` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${max(3, 9, 7)}" # => 9 + } +} +``` + +## `md5` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + hash = "${md5("docker")}" # => "597dd5f6a..." (hex string) + } +} +``` + +## `merge` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + combined = "${merge({a=1, b=2}, {b=3, c=4})}" # => {a=1, b=3, c=4} + } +} +``` + +## `min` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${min(3, 9, 7)}" # => 3 + } +} +``` + +## `modulo` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${modulo(10, 3)}" # => 1 + } +} +``` + +## `multiply` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${multiply(6, 7)}" # => 42 + } +} +``` + +## `negate` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${negate(7)}" # => -7 + } +} +``` + +## `not` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${not(true)}" # => false + } +} +``` + +## `notequal` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${notequal(4, 5)}" # => true + } +} +``` + +## `or` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${or(true, false)}" # => true + } +} +``` + +## `parseint` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${parseint("ff", 16)}" # => 255 + } +} +``` + +## `pow` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${pow(3, 2)}" # => 9 + } +} +``` + +## `range` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${range(0, 5)}" # => [0,1,2,3,4] + } +} +``` + +## `regex` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${regex("h.llo", "hello")}" # => "hello" + } +} +``` + +## `regex_replace` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${regex_replace("[0-9]+", "abc123xyz", "NUM")}" # => "abcNUMxyz" + } +} +``` + +## `regexall` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = matches = "${regexall("[a-z]+", "abc123xyz")}" # => ["abc","xyz"] + } +} +``` + +## `replace` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${replace("banana", "na", "--")}" # => "ba-- --" + } +} +``` + +## `reverse` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${reverse("stressed")}" # => "desserts" + } +} +``` + +## `reverselist` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${reverselist([1,2,3])}" # => [3,2,1] + } +} +``` + +## `rsadecrypt` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${rsadecrypt("eczGaDhXDbOFRZ...", "MIIEowIBAAKCAQEAgUElV5...")}" + } +} +``` + +## `sanitize` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sanitize("My App! v1.0")}" # => "My_App__v1_0" + } +} +``` + +## `semvercmp` + +This function checks if a semantic version fits within a set of constraints. +See [Checking Version Constraints](https://github.com/Masterminds/semver?tab=readme-ov-file#checking-version-constraints) +for details. + +```hcl +# docker-bake.hcl +variable "ALPINE_VERSION" { + default = "3.23" +} + +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + platforms = semvercmp(ALPINE_VERSION, ">= 3.20") ? [ + "linux/amd64", + "linux/arm64", + "linux/riscv64" + ] : [ + "linux/amd64", + "linux/arm64" + ] +} +``` + +## `sethaselement` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sethaselement([1,2,3], 2)}" # => true + } +} +``` + +## `setintersection` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${setintersection(["a","b","c"], ["b","c","d"])}" # => ["b","c"] + } +} +``` + +## `setproduct` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${setproduct(["x","y"], [1,2])}" # => [["x",1],["x",2],["y",1],["y",2]] + } +} +``` + +## `setsubtract` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${setsubtract([1,2,3], [2])}" # => [1,3] + } +} +``` + +## `setsymmetricdifference` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${setsymmetricdifference([1,2,3], [3,4])}" # => [1,2,4] + } +} +``` + +## `setunion` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${setunion(["a","b"], ["b","c"])}" # => ["a","b","c"] + } +} +``` + +## `sha1` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sha1("hello")}" # => "aaf4c61d..." (hex) + } +} +``` + +## `sha256` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sha256("hello")}" # => "2cf24dba..." (hex) + } +} +``` + +## `sha512` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sha512("hello")}" # => "9b71d224..." (hex) + } +} +``` + +## `signum` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + zero = "${signum(0)}" # => 0 + pos = "${signum(12)}" # => 1 + neg = "${signum(-12)}" # => -1 + } +} +``` + +## `slice` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${slice(["a","b","c","d"], 1, 3)}" # => ["b","c"] + } +} +``` + +## `sort` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${sort(["b","c","a"])}" # => ["a","b","c"] + } +} +``` + +## `split` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${split(",", "a,b,c")}" # => ["a","b","c"] + } +} +``` + +## `strlen` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${strlen("Docker")}" # => 6 + } +} +``` + +## `substr` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${substr("abcdef", 2, 3)}" # => "cde" + } +} +``` + +## `subtract` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${subtract(10, 3)}" # => 7 + } +} +``` + +## `timeadd` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${timeadd("2025-09-24T12:00:00Z", "1h30m")}" # => "2025-09-24T13:30:00Z" + } +} +``` + +## `timestamp` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${timestamp()}" # => current RFC3339 time at evaluation + } +} +``` + +## `title` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${title("hello world-from_docker")}" # => "Hello World-From_Docker" + } +} +``` + +## `trim` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${trim("--hello--", "-")}" # => "hello" + } +} +``` + +## `trimprefix` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${trimprefix("docker-build", "docker-")}" # => "build" + } +} +``` + +## `trimspace` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${trimspace(" hello ")}" # => "hello" + } +} +``` + +## `trimsuffix` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${trimsuffix("filename.txt", ".txt")}" # => "filename" + } +} +``` + +## `try` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + # First expr errors (invalid hex), second succeeds → returns 255 + val1 = "${try(parseint("zz", 16), parseint("ff", 16))}" # => 255 + + # First expr errors (missing key), fallback string is used + val2 = "${try(index({a="apple"}, "b"), "fallback")}" # => "fallback" + } +} +``` + +## `unixtimestampparse` + +The returned object has the following attributes: +* `year` (Number) The year for the unix timestamp. +* `year_day` (Number) The day of the year for the unix timestamp, in the range 1-365 for non-leap years, and 1-366 in leap years. +* `day` (Number) The day of the month for the unix timestamp. +* `month` (Number) The month of the year for the unix timestamp. +* `month_name` (String) The name of the month for the unix timestamp (ex. "January"). +* `weekday` (Number) The day of the week for the unix timestamp. +* `weekday_name` (String) The name of the day for the unix timestamp (ex. "Sunday"). +* `hour` (Number) The hour within the day for the unix timestamp, in the range 0-23. +* `minute` (Number) The minute offset within the hour for the unix timestamp, in the range 0-59. +* `second` (Number) The second offset within the minute for the unix timestamp, in the range 0-59. +* `rfc3339` (String) The RFC3339 format string. +* `iso_year` (Number) The ISO 8601 year number. +* `iso_week` (Number) The ISO 8601 week number. + +```hcl +# docker-bake.hcl +variable "SOURCE_DATE_EPOCH" { + type = number + default = 1690328596 +} + +target "default" { + args = { + SOURCE_DATE_EPOCH = SOURCE_DATE_EPOCH + } + labels = { + "org.opencontainers.image.created" = unixtimestampparse(SOURCE_DATE_EPOCH).rfc3339 + } +} +``` + +## `upper` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + result = "${upper("hello")}" # => "HELLO" + } +} +``` + +## `urlencode` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + url = "${urlencode("a b=c&d")}" # => "a+b%3Dc%26d" + } +} +``` + +## `uuidv4` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + id = "${uuidv4()}" # => random v4 UUID each evaluation + } +} +``` + +## `uuidv5` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + # Uses the DNS namespace UUID per RFC 4122 + # "6ba7b810-9dad-11d1-80b4-00c04fd430c8" + id = "${uuidv5("6ba7b810-9dad-11d1-80b4-00c04fd430c8", "example.com")}" + # => always "9073926b-929f-31c2-abc9-fad77ae3e8eb" for "example.com" + } +} +``` + +## `values` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + vals = "${values({a=1, c=3, b=2})}" # => [1,2,3] (ordered by key: a,b,c) + } +} +``` + +## `zipmap` + +```hcl +# docker-bake.hcl +target "webapp-dev" { + dockerfile = "Dockerfile.webapp" + tags = ["docker.io/username/webapp:latest"] + args = { + obj = "${zipmap(["name","stars"], ["Docker", 5])}" # => {name="Docker", stars=5} + } +} +``` diff --git a/_vendor/github.com/docker/cli/docs/deprecated.md b/_vendor/github.com/docker/cli/docs/deprecated.md index 30fe60f0ea2e..37ffcbc4705b 100644 --- a/_vendor/github.com/docker/cli/docs/deprecated.md +++ b/_vendor/github.com/docker/cli/docs/deprecated.md @@ -53,16 +53,22 @@ The following table provides an overview of the current status of deprecated fea | Status | Feature | Deprecated | Remove | |------------|------------------------------------------------------------------------------------------------------------------------------------|------------|--------| +| Deprecated | [Support for cgroup v1](#support-for-cgroup-v1) | v29.0 | - | +| Deprecated | [`--pause` option on `docker commit`](#--pause-option-on-docker-commit) | v29.0 | v30.0 | +| Deprecated | [Legacy links environment variables](#legacy-links-environment-variables) | v28.4 | v30.0 | +| Deprecated | [Special handling for quoted values for TLS flags](#special-handling-for-quoted-values-for-tls-flags) | v28.4 | v29.0 | +| Deprecated | [Empty/nil fields in image Config from inspect API](#emptynil-fields-in-image-config-from-inspect-api) | v28.3 | v29.0 | | Deprecated | [Configuration for pushing non-distributable artifacts](#configuration-for-pushing-non-distributable-artifacts) | v28.0 | v29.0 | | Deprecated | [`--time` option on `docker stop` and `docker restart`](#--time-option-on-docker-stop-and-docker-restart) | v28.0 | - | -| Deprecated | [Non-standard fields in image inspect](#non-standard-fields-in-image-inspect) | v27.0 | v28.0 | +| Removed | [Non-standard fields in image inspect](#non-standard-fields-in-image-inspect) | v27.0 | v28.2 | | Removed | [API CORS headers](#api-cors-headers) | v27.0 | v28.0 | -| Deprecated | [Graphdriver plugins (experimental)](#graphdriver-plugins-experimental) | v27.0 | v28.0 | +| Removed | [Graphdriver plugins (experimental)](#graphdriver-plugins-experimental) | v27.0 | v28.0 | | Deprecated | [Unauthenticated TCP connections](#unauthenticated-tcp-connections) | v26.0 | v28.0 | -| Deprecated | [`Container` and `ContainerConfig` fields in Image inspect](#container-and-containerconfig-fields-in-image-inspect) | v25.0 | v26.0 | -| Deprecated | [Deprecate legacy API versions](#deprecate-legacy-api-versions) | v25.0 | v26.0 | +| Removed | [`Container` and `ContainerConfig` fields in Image inspect](#container-and-containerconfig-fields-in-image-inspect) | v25.0 | v26.0 | +| Removed | [Deprecate legacy API versions](#deprecate-legacy-api-versions) | v25.0 | v26.0 | | Removed | [Container short ID in network Aliases field](#container-short-id-in-network-aliases-field) | v25.0 | v26.0 | -| Deprecated | [IsAutomated field, and `is-automated` filter on `docker search`](#isautomated-field-and-is-automated-filter-on-docker-search) | v25.0 | v26.0 | +| Removed | [Mount `bind-nonrecursive` option](#mount-bind-nonrecursive-option) | v25.0 | v29.0 | +| Removed | [IsAutomated field, and `is-automated` filter on `docker search`](#isautomated-field-and-is-automated-filter-on-docker-search) | v25.0 | v28.2 | | Removed | [logentries logging driver](#logentries-logging-driver) | v24.0 | v25.0 | | Removed | [OOM-score adjust for the daemon](#oom-score-adjust-for-the-daemon) | v24.0 | v25.0 | | Removed | [BuildKit build information](#buildkit-build-information) | v23.0 | v24.0 | @@ -71,7 +77,7 @@ The following table provides an overview of the current status of deprecated fea | Removed | [Btrfs storage driver on CentOS 7 and RHEL 7](#btrfs-storage-driver-on-centos-7-and-rhel-7) | v20.10 | v23.0 | | Removed | [Support for encrypted TLS private keys](#support-for-encrypted-tls-private-keys) | v20.10 | v23.0 | | Removed | [Kubernetes stack and context support](#kubernetes-stack-and-context-support) | v20.10 | v23.0 | -| Deprecated | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | - | +| Removed | [Pulling images from non-compliant image registries](#pulling-images-from-non-compliant-image-registries) | v20.10 | v28.2 | | Removed | [Linux containers on Windows (LCOW)](#linux-containers-on-windows-lcow-experimental) | v20.10 | v23.0 | | Deprecated | [BLKIO weight options with cgroups v1](#blkio-weight-options-with-cgroups-v1) | v20.10 | - | | Removed | [Kernel memory limit](#kernel-memory-limit) | v20.10 | v23.0 | @@ -80,9 +86,9 @@ The following table provides an overview of the current status of deprecated fea | Deprecated | [CLI plugins support](#cli-plugins-support) | v20.10 | - | | Deprecated | [Dockerfile legacy `ENV name value` syntax](#dockerfile-legacy-env-name-value-syntax) | v20.10 | - | | Removed | [`docker build --stream` flag (experimental)](#docker-build---stream-flag-experimental) | v20.10 | v20.10 | -| Deprecated | [`fluentd-async-connect` log opt](#fluentd-async-connect-log-opt) | v20.10 | v28.0 | +| Removed | [`fluentd-async-connect` log opt](#fluentd-async-connect-log-opt) | v20.10 | v28.0 | | Removed | [Configuration options for experimental CLI features](#configuration-options-for-experimental-cli-features) | v19.03 | v23.0 | -| Deprecated | [Pushing and pulling with image manifest v2 schema 1](#pushing-and-pulling-with-image-manifest-v2-schema-1) | v19.03 | v27.0 | +| Removed | [Pushing and pulling with image manifest v2 schema 1](#pushing-and-pulling-with-image-manifest-v2-schema-1) | v19.03 | v28.2 | | Removed | [`docker engine` subcommands](#docker-engine-subcommands) | v19.03 | v20.10 | | Removed | [Top-level `docker deploy` subcommand (experimental)](#top-level-docker-deploy-subcommand-experimental) | v19.03 | v20.10 | | Removed | [`docker stack deploy` using "dab" files (experimental)](#docker-stack-deploy-using-dab-files-experimental) | v19.03 | v20.10 | @@ -107,6 +113,7 @@ The following table provides an overview of the current status of deprecated fea | Deprecated | [`-h` shorthand for `--help`](#-h-shorthand-for---help) | v1.12 | v17.09 | | Removed | [`-e` and `--email` flags on `docker login`](#-e-and---email-flags-on-docker-login) | v1.11 | v17.06 | | Deprecated | [Separator (`:`) of `--security-opt` flag on `docker run`](#separator--of---security-opt-flag-on-docker-run) | v1.11 | v17.06 | +| Deprecated | [Links on the default bridge network](#links-on-the-default-bridge-network) | v1.10 | - | | Deprecated | [Ambiguous event fields in API](#ambiguous-event-fields-in-api) | v1.10 | - | | Removed | [`-f` flag on `docker tag`](#-f-flag-on-docker-tag) | v1.10 | v1.12 | | Removed | [HostConfig at API container start](#hostconfig-at-api-container-start) | v1.10 | v1.12 | @@ -120,10 +127,127 @@ The following table provides an overview of the current status of deprecated fea | Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13 | | Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12 | -## Configuration for pushing non-distributable artifacts +### Support for cgroup v1 -**Deprecated in Release: v28.0** -**Target For Removal In Release: v29.0** +**Deprecated in release: v29.0** + +Support for cgroup v1 is deprecated in the v29.0 release, however, it will continue +to be supported until May 2029. +The latest release in May 2029 may not necessarily support cgroup v1, +but there will be at least one maintained branch with the support for cgroup v1. + +The cgroup version currently in use can be checked by running the `docker info` command: + +```console +$ docker info +<...> +Server: + <...> + Cgroup Version: 2 + <...> +``` + +### `--pause` option on `docker commit` + +**Deprecated in release: v29.0** + +**Target for removal in release: v30.0** + +The `--pause` option is enabled by default since Docker v1.1.0 to prevent +committing containers in an inconsistent state, but can be disabled by +setting the `--pause=false` option. In docker CLI v29.0 this flag is +replaced by a `--no-pause` flag instead. The `--pause` option is still +functional in the v29.0 release, printing a deprecation warning, but +will be removed in docker CLI v30. + +### Legacy links environment variables + +**Deprecated in release: v28.4** + +**Disabled by default in release: v29.0** + +**Target for removal in release: v30.0** + +Containers attached to the default bridge network can specify "legacy links" (e.g. +using `--links` on the CLI) to get access to other containers attached to that +network. The linking container (i.e., the container created with `--links`) automatically +gets environment variables that specify the IP address and port mappings of the linked +container. However, these environment variables are prefixed with the linked +container's names, making them impractical. + +Starting with Docker v29.0, these environment variables are no longer set by +default. Users who still depend on them can start Docker Engine with the +environment variable `DOCKER_KEEP_DEPRECATED_LEGACY_LINKS_ENV_VARS=1` set. + +Support for legacy links environment variables, as well as the `DOCKER_KEEP_DEPRECATED_LEGACY_LINKS_ENV_VARS` +will be removed in Docker Engine v30.0. + +### Special handling for quoted values for TLS flags + +**Deprecated in release: v28.4** + +**Target for removal in release: v29.0** + +The `--tlscacert`, `--tlscert`, and `--tlskey` command-line flags had +non-standard behavior for handling values contained in quotes (`"` or `'`). +Normally, quotes are handled by the shell, for example, in the following +example, the shell takes care of handling quotes before passing the values +to the `docker` CLI: + +```console +docker --some-option "some-value-in-quotes" ... +``` + +However, when passing values using an equal sign (`=`), this may not happen +and values may be handled including quotes; + +```console +docker --some-option="some-value-in-quotes" ... +``` + +This caused issues with "Docker Machine", which used this format as part +of its `docker-machine config` output, and the CLI carried special, non-standard +handling for these flags. + +Docker Machine reached EOL, and this special handling made the processing +of flag values inconsistent with other flags used, so this behavior is +deprecated. Users depending on this behavior are recommended to specify +the quoted values using a space between the flag and its value, as illustrated +above. + +### Empty/nil fields in image Config from inspect API + +**Deprecated in release: v28.3** + +**Target for removal in release: v29.0** + +The `Config` field returned by `docker image inspect` (and the `GET /images/{name}/json` +API endpoint) currently includes certain fields even when they are empty or nil. +Starting in Docker v29.0, the following fields will be omitted from the API response +when they contain empty or default values: + +- `Cmd` +- `Entrypoint` +- `Env` +- `Labels` +- `OnBuild` +- `User` +- `Volumes` +- `WorkingDir` + +Applications consuming the image inspect API should be updated to handle the +absence of these fields gracefully, treating missing fields as having their +default/empty values. + +For API version corresponding to Docker v29.0, these fields will be omitted when +empty. They will continue to be included when using clients that request an older +API version for backward compatibility. + +### Configuration for pushing non-distributable artifacts + +**Deprecated in release: v28.0** + +**Target for removal in release: v29.0** Non-distributable artifacts (also called foreign layers) were introduced in docker v1.12 to accommodate Windows images for which the EULA did not allow @@ -161,7 +285,7 @@ entirely. ### `--time` option on `docker stop` and `docker restart` -**Deprecated in Release: v28.0** +**Deprecated in release: v28.0** The `--time` option for the `docker stop`, `docker container stop`, `docker restart`, and `docker container restart` commands has been renamed to `--timeout` for @@ -171,8 +295,9 @@ Users are encouraged to migrate to using the `--timeout` option instead. ### Non-standard fields in image inspect -**Deprecated in Release: v27.0** -**Target For Removal In Release: v28.0** +**Deprecated in release: v27.0** + +**Removed in release: v28.2** The `Config` field returned shown in `docker image inspect` (and as returned by the `GET /images/{name}/json` API endpoint) returns additional fields that are @@ -184,8 +309,9 @@ but are not omitted in the response when left empty. As these fields were not intended to be part of the image configuration response, they are deprecated, and will be removed from the API in thee next release. -The following fields are currently included in the API response, but are not -part of the underlying image's `Config` field, and deprecated: +The following fields are not part of the underlying image's `Config` field, and +removed in the API response for API v1.50 and newer, corresponding with v28.2. +They continue to be included when using clients that use an older API version: - `Hostname` - `Domainname` @@ -196,39 +322,37 @@ part of the underlying image's `Config` field, and deprecated: - `OpenStdin` - `StdinOnce` - `Image` -- `NetworkDisabled` (already omitted unless set) -- `MacAddress` (already omitted unless set) -- `StopTimeout` (already omitted unless set) +- `NetworkDisabled` (omitted unless set on older API versions) +- `MacAddress` (omitted unless set on older API versions) +- `StopTimeout` (omitted unless set on older API versions) [Docker image specification]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 [OCI image specification]: https://github.com/opencontainers/image-spec/blob/v1.1.0/specs-go/v1/config.go#L24-L62 ### Graphdriver plugins (experimental) -**Deprecated in Release: v27.0** -**Disabled by default in Release: v27.0** -**Target For Removal In Release: v28.0** +**Deprecated in**: v27.0**. + +**Disabled by default in release: v27.0** + +**Target for removal in release: v28.0** [Graphdriver plugins](https://github.com/docker/cli/blob/v26.1.4/docs/extend/plugins_graphdriver.md) -are an experimental feature that allow extending the Docker Engine with custom +were an experimental feature that allowed extending the Docker Engine with custom storage drivers for storing images and containers. This feature was not -maintained since its inception, and will no longer be supported in upcoming -releases. - -Support for graphdriver plugins is disabled by default in v27.0, and will be -removed v28.0. An `DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS` environment variable -is provided in v27.0 to re-enable the feature. This environment variable must -be set to a non-empty value in the daemon's environment. +maintained since its inception. -The `DOCKERD_DEPRECATED_GRAPHDRIVER_PLUGINS` environment variable, along with -support for graphdriver plugins, will be removed in v28.0. Users of this feature -are recommended to instead configure the Docker Engine to use the [containerd image store](https://docs.docker.com/storage/containerd/) +Support for graphdriver plugins was disabled by default in v27.0, and removed +in v28.0. Users of this feature are recommended to instead configure the Docker +Engine to use the [containerd image store](https://docs.docker.com/storage/containerd/) and a custom [snapshotter](https://github.com/containerd/containerd/tree/v1.7.18/docs/snapshotters) ### API CORS headers -**Deprecated in Release: v27.0** -**Disabled by default in Release: v27.0** +**Deprecated in release: v27.0** + +**Disabled by default in release: v27.0** + **Removed in release: v28.0** The `api-cors-header` configuration option for the Docker daemon is insecure, @@ -248,8 +372,9 @@ If you need to access the API through a browser, use a reverse proxy. ### Unauthenticated TCP connections -**Deprecated in Release: v26.0** -**Target For Removal In Release: v28.0** +**Deprecated in release: v26.0** + +**Target for removal in release: v28.0** Configuring the Docker daemon to listen on a TCP address will require mandatory TLS verification. This change aims to ensure secure communication by preventing @@ -275,21 +400,23 @@ configuring TLS (or SSH) for the Docker daemon, refer to ### `Container` and `ContainerConfig` fields in Image inspect -**Deprecated in Release: v25.0** -**Target For Removal In Release: v26.0** +**Deprecated in release: v25.0** + +**Removed in release: v26.0** The `Container` and `ContainerConfig` fields returned by `docker inspect` are mostly an implementation detail of the classic (non-BuildKit) image builder. These fields are not portable and are empty when using the BuildKit-based builder (enabled by default since v23.0). -These fields are deprecated in v25.0 and will be omitted starting from v26.0. -If image configuration of an image is needed, you can obtain it from the -`Config` field. +These fields are deprecated in v25.0 and are omitted starting from v26.0 ( +API version v1.45 and up). If image configuration of an image is needed, +you can obtain it from the `Config` field. ### Deprecate legacy API versions -**Deprecated in Release: v25.0** -**Target For Removal In Release: v26.0** +**Deprecated in release: v25.0** + +**Target for removal in release: v26.0** The Docker daemon provides a versioned API for backward compatibility with old clients. Docker clients can perform API-version negotiation to select the most @@ -326,25 +453,28 @@ Error response from daemon: client version 1.23 is too old. Minimum supported AP upgrade your client to a newer version ``` +Support for API versions lower than `1.24` has been permanently removed in Docker +Engine v26, and the minimum supported API version will be incrementally raised +in releases following that. + +<!-- keeping the paragraphs below for when we incrementally raise the minimum API version --> +<!-- An environment variable (`DOCKER_MIN_API_VERSION`) is introduced that allows re-enabling older API versions in the daemon. This environment variable must be set in the daemon's environment (for example, through a [systemd override file](https://docs.docker.com/config/daemon/systemd/)), and the specified -API version must be supported by the daemon (`1.12` or higher on Linux, or -`1.24` or higher on Windows). - -Support for API versions lower than `1.24` will be permanently removed in Docker -Engine v26, and the minimum supported API version will be incrementally raised -in releases following that. +API version must be supported by the daemon (`1.24` or higher). We do not recommend depending on the `DOCKER_MIN_API_VERSION` environment variable other than for exceptional cases where it's not possible to update old clients, and those clients must be supported. +--> ### Container short ID in network Aliases field -**Deprecated in Release: v25.0** -**Removed In Release: v26.0** +**Deprecated in release: v25.0** + +**Removed in release: v26.0** The `Aliases` field returned by `docker inspect` contains the container short ID once the container is started. This behavior is deprecated in v25.0 but @@ -356,10 +486,32 @@ A new field `DNSNames` containing the container name (if one was specified), the hostname, the network aliases, as well as the container short ID, has been introduced in v25.0 and should be used instead of the `Aliases` field. +### Mount `bind-nonrecursive` option + +**Deprecated in release: v25.0** + +**Removed in release: v29.0** + +The `bind-nonrecursive` option was replaced with the [`bind-recursive`] +option (see [cli-4316], [cli-4671]). The option was still accepted, but +printed a deprecation warning: + +```console +bind-nonrecursive is deprecated, use bind-recursive=disabled instead +``` + +In the v29.0 release, this warning is removed, and returned as an error. +Users should use the equivalent `bind-recursive=disabled` option instead. + +[`bind-recursive`]: https://docs.docker.com/engine/storage/bind-mounts/#recursive-mounts +[cli-4316]: https://github.com/docker/cli/pull/4316 +[cli-4671]: https://github.com/docker/cli/pull/4671 + ### IsAutomated field, and `is-automated` filter on `docker search` -**Deprecated in Release: v25.0** -**Target For Removal In Release: v26.0** +**Deprecated in release: v25.0** + +**Removed in release: v28.2** The `is_automated` field has been deprecated by Docker Hub's search API. Consequently, the `IsAutomated` field in image search will always be set @@ -368,12 +520,13 @@ results. The `AUTOMATED` column has been removed from the default `docker search` and `docker image search` output in v25.0, and the corresponding `IsAutomated` -templating option will be removed in v26.0. +templating has been removed in v28.2. ### Logentries logging driver -**Deprecated in Release: v24.0** -**Removed in Release: v25.0** +**Deprecated in release: v24.0** + +**Removed in release: v25.0** The logentries service SaaS was shut down on November 15, 2022, rendering this logging driver non-functional. Users should no longer use this logging @@ -383,8 +536,9 @@ after upgrading. ### OOM-score adjust for the daemon -**Deprecated in Release: v24.0** -**Removed in Release: v25.0** +**Deprecated in release: v24.0** + +**Removed in release: v25.0** The `oom-score-adjust` option was added to prevent the daemon from being OOM-killed before other processes. This option was mostly added as a @@ -403,8 +557,9 @@ the daemon. ### BuildKit build information -**Deprecated in Release: v23.0** -**Removed in Release: v24.0** +**Deprecated in release: v23.0** + +**Removed in release: v24.0** [Build information](https://github.com/moby/buildkit/blob/v0.11/docs/buildinfo.md) structures have been introduced in [BuildKit v0.10.0](https://github.com/moby/buildkit/releases/tag/v0.10.0) @@ -415,7 +570,7 @@ information is also embedded into the image configuration if one is generated. ### Legacy builder for Linux images -**Deprecated in Release: v23.0** +**Deprecated in release: v23.0** Docker v23.0 now uses BuildKit by default to build Linux images, and uses the [Buildx](https://docs.docker.com/buildx/working-with-buildx/) CLI component for @@ -446,7 +601,7 @@ you to report issues in the [BuildKit issue tracker on GitHub](https://github.co ### Legacy builder fallback -**Deprecated in Release: v23.0** +**Deprecated in release: v23.0** [Docker v23.0 now uses BuildKit by default to build Linux images](#legacy-builder-for-linux-images), which requires the Buildx component to build images with BuildKit. There may be @@ -492,7 +647,7 @@ be possible in a future release. ### Btrfs storage driver on CentOS 7 and RHEL 7 -**Removed in Release: v23.0** +**Removed in release: v23.0** The `btrfs` storage driver on CentOS and RHEL was provided as a technology preview by CentOS and RHEL, but has been deprecated since the [Red Hat Enterprise Linux 7.4 release](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-btrfs), @@ -504,9 +659,9 @@ of Docker will no longer provide this driver. ### Support for encrypted TLS private keys -**Deprecated in Release: v20.10** +**Deprecated in release: v20.10** -**Removed in Release: v23.0** +**Removed in release: v23.0** Use of encrypted TLS private keys has been deprecated, and has been removed. Golang has deprecated support for legacy PEM encryption (as specified in @@ -520,8 +675,9 @@ to decrypt the private key, and store it un-encrypted to continue using it. ### Kubernetes stack and context support -**Deprecated in Release: v20.10** -**Removed in Release: v23.0** +**Deprecated in release: v20.10** + +**Removed in release: v23.0** Following the deprecation of [Compose on Kubernetes](https://github.com/docker/compose-on-kubernetes), support for Kubernetes in the `stack` and `context` commands has been removed from @@ -549,7 +705,9 @@ CLI configuration file are no longer used, and ignored. ### Pulling images from non-compliant image registries -**Deprecated in Release: v20.10** +**Deprecated in release: v20.10** + +**Removed in release: v28.2** Docker Engine v20.10 and up includes optimizations to verify if images in the local image cache need updating before pulling, preventing the Docker Engine @@ -559,7 +717,7 @@ image registry to conform to the [Open Container Initiative Distribution Specifi While most registries conform to the specification, we encountered some registries to be non-compliant, resulting in `docker pull` to fail. -As a temporary solution, Docker Engine v20.10 includes a fallback mechanism to +As a temporary solution, Docker Engine v20.10 added a fallback mechanism to allow `docker pull` to be functional when using a non-compliant registry. A warning message is printed in this situation: @@ -568,21 +726,19 @@ warning message is printed in this situation: pull by tag. This fallback is DEPRECATED, and will be removed in a future release. -The fallback is added to allow users to either migrate their images to a compliant -registry, or for these registries to become compliant. - -Note that this fallback only addresses failures on `docker pull`. Other commands, -such as `docker stack deploy`, or pulling images with `containerd` will continue -to fail. +The fallback was added to allow users to either migrate their images to a +compliant registry, or for these registries to become compliant. -Given that other functionality is still broken with these registries, we consider -this fallback a _temporary_ solution, and will remove the fallback in an upcoming -major release. +GitHub deprecated the legacy `docker.pkg.github.com` registry, and it was +[sunset on Feb 24th, 2025](https://github.blog/changelog/2025-01-23-legacy-docker-registry-closing-down/) +in favor of GitHub Container Registry (GHCR, ghcr.io), making this fallback +no longer needed. ### Linux containers on Windows (LCOW) (experimental) -**Deprecated in Release: v20.10** -**Removed in Release: v23.0** +**Deprecated in release: v20.10** + +**Removed in release: v23.0** The experimental feature to run Linux containers on Windows (LCOW) was introduced as a technical preview in Docker 17.09. While many enhancements were made after @@ -594,7 +750,7 @@ Developers who want to run Linux workloads on a Windows host are encouraged to u ### BLKIO weight options with cgroups v1 -**Deprecated in Release: v20.10** +**Deprecated in release: v20.10** Specifying blkio weight (`docker run --blkio-weight` and `docker run --blkio-weight-device`) is now marked as deprecated when using cgroups v1 because the corresponding features @@ -604,35 +760,23 @@ When using cgroups v2, the `--blkio-weight` options are implemented using ### Kernel memory limit -**Deprecated in Release: v20.10** -**Removed in Release: v23.0** +**Deprecated in release: v20.10** + +**Removed in release: v23.0** Specifying kernel memory limit (`docker run --kernel-memory`) is no longer supported because the [Linux kernel deprecated `kmem.limit_in_bytes` in v5.4](https://github.com/torvalds/linux/commit/0158115f702b0ba208ab0b5adf44cae99b3ebcc7). -The OCI runtime specification now marks this option (as well as `--kernel-memory-tcp`) -as ["NOT RECOMMENDED"](https://github.com/opencontainers/runtime-spec/pull/1093), +The OCI runtime specification now marks this option as ["NOT RECOMMENDED"](https://github.com/opencontainers/runtime-spec/pull/1093), and OCI runtimes such as `runc` no longer support this option. -Docker API v1.42 and up now ignores this option when set. Older versions of the -API continue to accept the option, but depending on the OCI runtime used, may -take no effect. - -> [!NOTE] -> While not deprecated (yet) in Docker, the OCI runtime specification also -> deprecated the `memory.kmem.tcp.limit_in_bytes` option. When using `runc` as -> runtime, this option takes no effect. The Linux kernel did not explicitly -> deprecate this feature, and there is a tracking ticket in the `runc` issue -> tracker to determine if this option should be reinstated or if this was an -> oversight of the Linux kernel maintainers (see [opencontainers/runc#3174](https://github.com/opencontainers/runc/issues/3174)). -> -> The `memory.kmem.tcp.limit_in_bytes` option is only supported with cgroups v1, -> and not available on installations running with cgroups v2. This option is -> only supported by the API, and not exposed on the `docker` command-line. +The Docker API no longer handles the kernel-memory fields, and Docker CLI v29.0 +removes the `--kernel-memory` option. ### Classic Swarm and overlay networks using cluster store -**Deprecated in Release: v20.10** -**Removed in Release: v23.0** +**Deprecated in release: v20.10** + +**Removed in release: v23.0** Standalone ("classic") Swarm has been deprecated, and with that the use of overlay networks using an external key/value store. The corresponding`--cluster-advertise`, @@ -640,8 +784,9 @@ networks using an external key/value store. The corresponding`--cluster-advertis ### Support for legacy `~/.dockercfg` configuration files -**Deprecated in Release: v20.10** -**Removed in Release: v23.0** +**Deprecated in release: v20.10** + +**Removed in release: v23.0** The Docker CLI up until v1.7.0 used the `~/.dockercfg` file to store credentials after authenticating to a registry (`docker login`). Docker v1.7.0 replaced this @@ -656,9 +801,9 @@ been removed. ### Configuration options for experimental CLI features -**Deprecated in Release: v19.03** +**Deprecated in release: v19.03** -**Removed in Release: v23.0** +**Removed in release: v23.0** The `DOCKER_CLI_EXPERIMENTAL` environment variable and the corresponding `experimental` field in the CLI configuration file are deprecated. Experimental features are @@ -670,13 +815,13 @@ format. ### CLI plugins support -**Deprecated in Release: v20.10** +**Deprecated in release: v20.10** CLI Plugin API is now marked as deprecated. ### Dockerfile legacy `ENV name value` syntax -**Deprecated in Release: v20.10** +**Deprecated in release: v20.10** The Dockerfile `ENV` instruction allows values to be set using either `ENV name=value` or `ENV name value`. The latter (`ENV name value`) form can be ambiguous, for example, @@ -700,8 +845,9 @@ ENV ONE="" TWO="" THREE="world" ### `docker build --stream` flag (experimental) -**Deprecated in Release: v20.10** -**Removed in Release: v20.10** +**Deprecated in release: v20.10** + +**Removed in release: v20.10** Docker v17.07 introduced an experimental `--stream` flag on `docker build` which allowed the build-context to be incrementally sent to the daemon, instead of @@ -717,8 +863,9 @@ files. ### `fluentd-async-connect` log opt -**Deprecated in Release: v20.10** -**Removed in Release: v28.0** +**Deprecated in release: v20.10** + +**Removed in release: v28.0** The `--log-opt fluentd-async-connect` option for the fluentd logging driver is [deprecated in favor of `--log-opt fluentd-async`](https://github.com/moby/moby/pull/39086). @@ -729,15 +876,16 @@ fluent#New: AsyncConnect is now deprecated, use Async instead ``` Users are encouraged to use the `fluentd-async` option going forward, as support -for the old option will be removed in a future release. +for the old option has been removed. ### Pushing and pulling with image manifest v2 schema 1 -**Deprecated in Release: v19.03** +**Deprecated in release: v19.03** -**Disabled by default in Release: v26.0** +**Disabled by default in release: v26.0** + +**Removed in release: v28.2** -**Target For Removal In Release: v27.0** The image manifest [v2 schema 1](https://distribution.github.io/distribution/spec/deprecated-schema-v1/) and "Docker Image v1" formats were deprecated in favor of the @@ -748,28 +896,22 @@ formats. These legacy formats should no longer be used, and users are recommended to update images to use current formats, or to upgrade to more current images. Starting with Docker v26.0, pulling these images is disabled by default, and -produces an error when attempting to pull the image: +support has been removed in v28.2. Attempting to pull a legacy image now +produces an error: ```console $ docker pull ubuntu:10.04 Error response from daemon: -[DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default and will be removed in an upcoming release. +Docker Image Format v1 and Docker Image manifest version 2, schema 1 support has been removed. Suggest the author of docker.io/library/ubuntu:10.04 to upgrade the image to the OCI Format or Docker Image manifest v2, schema 2. More information at https://docs.docker.com/go/deprecated-image-specs/ ``` -An environment variable (`DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE`) is -added in Docker v26.0 that allows re-enabling support for these image formats -in the daemon. This environment variable must be set to a non-empty value in -the daemon's environment (for example, through a [systemd override file](https://docs.docker.com/config/daemon/systemd/)). -Support for the `DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE` environment variable -will be removed in Docker v27.0 after which this functionality is removed permanently. - ### `docker engine` subcommands -**Deprecated in Release: v19.03** +**Deprecated in release: v19.03** -**Removed in Release: v20.10** +**Removed in release: v20.10** The `docker engine activate`, `docker engine check`, and `docker engine update` provided an alternative installation method to upgrade Docker Community engines @@ -782,9 +924,9 @@ standard package managers. ### Top-level `docker deploy` subcommand (experimental) -**Deprecated in Release: v19.03** +**Deprecated in release: v19.03** -**Removed in Release: v20.10** +**Removed in release: v20.10** The top-level `docker deploy` command (using the "Docker Application Bundle" (.dab) file format was introduced as an experimental feature in Docker 1.13 / @@ -793,9 +935,9 @@ subcommand. ### `docker stack deploy` using "dab" files (experimental) -**Deprecated in Release: v19.03** +**Deprecated in release: v19.03** -**Removed in Release: v20.10** +**Removed in release: v20.10** With no development being done on this feature, and no active use of the file format, support for the DAB file format and the top-level `docker deploy` command @@ -804,8 +946,9 @@ using compose files. ### Support for the `overlay2.override_kernel_check` storage option -**Deprecated in Release: v19.03** -**Removed in Release: v24.0** +**Deprecated in release: v19.03** + +**Removed in release: v24.0** This daemon configuration option disabled the Linux kernel version check used to detect if the kernel supported OverlayFS with multiple lower dirs, which is @@ -815,8 +958,9 @@ option was no longer used. ### AuFS storage driver -**Deprecated in Release: v19.03** -**Removed in Release: v24.0** +**Deprecated in release: v19.03** + +**Removed in release: v24.0** The `aufs` storage driver is deprecated in favor of `overlay2`, and has been removed in a Docker Engine v24.0. Users of the `aufs` storage driver must @@ -834,8 +978,9 @@ maintenance of the `aufs` storage driver. ### Legacy overlay storage driver -**Deprecated in Release: v18.09** -**Removed in Release: v24.0** +**Deprecated in release: v18.09** + +**Removed in release: v24.0** The `overlay` storage driver is deprecated in favor of the `overlay2` storage driver, which has all the benefits of `overlay`, without its limitations (excessive @@ -850,9 +995,11 @@ backported), there is no reason to keep maintaining the `overlay` storage driver ### Device mapper storage driver -**Deprecated in Release: v18.09** -**Disabled by default in Release: v23.0** -**Removed in Release: v25.0** +**Deprecated in release: v18.09** + +**Disabled by default in release: v23.0** + +**Removed in release: v25.0** The `devicemapper` storage driver is deprecated in favor of `overlay2`, and has been removed in Docker Engine v25.0. Users of the `devicemapper` storage driver @@ -868,9 +1015,9 @@ is no reason to continue maintenance of the `devicemapper` storage driver. ### Use of reserved namespaces in engine labels -**Deprecated in Release: v18.06** +**Deprecated in release: v18.06** -**Removed In Release: v20.10** +**Removed in release: v20.10** The namespaces `com.docker.*`, `io.docker.*`, and `org.dockerproject.*` in engine labels were always documented to be reserved, but there was never any enforcement. @@ -882,7 +1029,7 @@ use, and will error instead in v20.10 and above. **Disabled In Release: v17.12** -**Removed In Release: v19.03** +**Removed in release: v19.03** The `--disable-legacy-registry` flag was disabled in Docker 17.12 and will print an error when used. For this error to be printed, the flag itself is still present, @@ -890,9 +1037,9 @@ but hidden. The flag has been removed in Docker 19.03. ### Interacting with V1 registries -**Disabled By Default In Release: v17.06** +**Disabled by default in release: v17.06** -**Removed In Release: v17.12** +**Removed in release: v17.12** Version 1.8.3 added a flag (`--disable-legacy-registry=false`) which prevents the Docker daemon from `pull`, `push`, and `login` operations against v1 @@ -909,7 +1056,7 @@ start when set. ### Asynchronous `service create` and `service update` as default -**Deprecated In Release: v17.05** +**Deprecated in release: v17.05** **Disabled by default in release: [v17.10](https://github.com/docker/docker-ce/releases/tag/v17.10.0-ce)** @@ -923,9 +1070,9 @@ and `docker service scale` in Docker 17.10. ### `-g` and `--graph` flags on `dockerd` -**Deprecated In Release: v17.05** +**Deprecated in release: v17.05** -**Removed In Release: v23.0** +**Removed in release: v23.0** The `-g` or `--graph` flag for the `dockerd` or `docker daemon` command was used to indicate the directory in which to store persistent data and resource @@ -934,9 +1081,9 @@ flag. These flags were deprecated and hidden in v17.05, and removed in v23.0. ### Top-level network properties in NetworkSettings -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Target For Removal In Release: v17.12** +**Target for removal in release: v17.12** When inspecting a container, `NetworkSettings` contains top-level information about the default ("bridge") network; @@ -953,18 +1100,18 @@ information. ### `filter` option for `/images/json` endpoint -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Removed In Release: v20.10** +**Removed in release: v20.10** The `filter` option to filter the list of image by reference (name or name:tag) is now implemented as a regular filter, named `reference`. ### `repository:shortid` image references -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Removed In Release: v17.12** +**Removed in release: v17.12** The `repository:shortid` syntax for referencing images is very little used, collides with tag references, and can be confused with digest references. @@ -974,32 +1121,32 @@ in Docker 17.12. ### `docker daemon` subcommand -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Removed In Release: v17.12** +**Removed in release: v17.12** The daemon is moved to a separate binary (`dockerd`), and should be used instead. ### Duplicate keys with conflicting values in engine labels -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Removed In Release: v17.12** +**Removed in release: v17.12** When setting duplicate keys with conflicting values, an error will be produced, and the daemon will fail to start. ### `MAINTAINER` in Dockerfile -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** `MAINTAINER` was an early very limited form of `LABEL` which should be used instead. ### API calls without a version -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Target For Removal In Release: v17.12** +**Target for removal in release: v17.12** API versions should be supplied to all API calls to ensure compatibility with future Engine versions. Instead of just requesting, for example, the URL @@ -1007,9 +1154,9 @@ future Engine versions. Instead of just requesting, for example, the URL ### Backing filesystem without `d_type` support for overlay/overlay2 -**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Deprecated in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** -**Removed In Release: v17.12** +**Removed in release: v17.12** The overlay and overlay2 storage driver does not work as expected if the backing filesystem does not support `d_type`. For example, XFS does not support `d_type` @@ -1023,18 +1170,18 @@ Refer to [#27358](https://github.com/docker/docker/issues/27358) for details. ### `--automated` and `--stars` flags on `docker search` -**Deprecated in Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Deprecated in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** -**Removed In Release: v20.10** +**Removed in release: v20.10** The `docker search --automated` and `docker search --stars` options are deprecated. Use `docker search --filter=is-automated=<true|false>` and `docker search --filter=stars=...` instead. ### `-h` shorthand for `--help` -**Deprecated In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Deprecated in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** -**Target For Removal In Release: v17.09** +**Target for removal in release: v17.09** The shorthand (`-h`) is less common than `--help` on Linux and cannot be used on all subcommands (due to it conflicting with, e.g. `-h` / `--hostname` on @@ -1043,58 +1190,71 @@ on all subcommands (due to it conflicting with, e.g. `-h` / `--hostname` on ### `-e` and `--email` flags on `docker login` -**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)** +**Deprecated in release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)** -**Removed In Release: [v17.06](https://github.com/docker/docker-ce/releases/tag/v17.06.0-ce)** +**Removed in release: [v17.06](https://github.com/docker/docker-ce/releases/tag/v17.06.0-ce)** The `docker login` no longer automatically registers an account with the target registry if the given username doesn't exist. Due to this change, the email flag is no longer required, and will be deprecated. ### Separator (`:`) of `--security-opt` flag on `docker run` -**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)** +**Deprecated in release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)** -**Target For Removal In Release: v17.06** +**Target for removal in release: v17.06** The flag `--security-opt` doesn't use the colon separator (`:`) anymore to divide keys and values, it uses the equal symbol (`=`) for consistency with other similar flags, like `--storage-opt`. +### Links on the default bridge network + +**Deprecated in release: v1.10** +**Target for removal in release: v30.0** + +The `--link` option on `docker create` and `docker run`, when used with no +`--network` specified, was deprecated in v1.10 and will be removed in a future +release. Custom networks should be used instead. Docker 29.6 added a deprecation +warning when this option is used for the default bridge network. + +Note that the `--link` option is still supported when a non-default network +is used. + ### Ambiguous event fields in API -**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Deprecated in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** The fields `ID`, `Status` and `From` in the events API have been deprecated in favor of a more rich structure. See the events API documentation for the new format. ### `-f` flag on `docker tag` -**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Deprecated in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** To make tagging consistent across the various `docker` commands, the `-f` flag on the `docker tag` command is deprecated. It is no longer necessary to specify `-f` to move a tag from one image to another. Nor will `docker` generate an error if the `-f` flag is missing and the specified tag is already in use. ### HostConfig at API container start -**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Deprecated in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** Passing an `HostConfig` to `POST /containers/{name}/start` is deprecated in favor of defining it at container creation (`POST /containers/create`). ### `--before` and `--since` flags on `docker ps` -**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Deprecated in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** The `docker ps --before` and `docker ps --since` options are deprecated. Use `docker ps --filter=before=...` and `docker ps --filter=since=...` instead. ### Driver-specific log tags -**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)** +**Deprecated in release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** Log tags are now generated in a standard way across different logging drivers. Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` and @@ -1106,9 +1266,9 @@ $ docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}" ### Docker Content Trust ENV passphrase variables name change -**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)** +**Deprecated in release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** Since 1.9, Docker Content Trust Offline key has been renamed to Root key and the Tagging key has been renamed to Repository key. Due to this renaming, we're also changing the corresponding environment variables @@ -1117,25 +1277,25 @@ Since 1.9, Docker Content Trust Offline key has been renamed to Root key and the ### `/containers/(id or name)/copy` endpoint -**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** +**Deprecated in release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** The endpoint `/containers/(id or name)/copy` is deprecated in favor of `/containers/(id or name)/archive`. ### LXC built-in exec driver -**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** +**Deprecated in release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** -**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Removed in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** The built-in LXC execution driver, the lxc-conf flag, and API fields have been removed. ### Old Command Line Options -**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** +**Deprecated in release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** -**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** +**Removed in release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)** The flags `-d` and `--daemon` are deprecated. Use the separate `dockerd` binary instead. @@ -1179,34 +1339,34 @@ The following double-dash options are deprecated and have no replacement: - `docker ps --before-id` - `docker search --trusted` -**Deprecated In Release: [v1.5.0](https://github.com/docker/docker/releases/tag/v1.5.0)** +**Deprecated in release: [v1.5.0](https://github.com/docker/docker/releases/tag/v1.5.0)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** The single-dash (`-help`) was removed, in favor of the double-dash `--help` ### `--api-enable-cors` flag on `dockerd` -**Deprecated In Release: [v1.6.0](https://github.com/docker/docker/releases/tag/v1.6.0)** +**Deprecated in release: [v1.6.0](https://github.com/docker/docker/releases/tag/v1.6.0)** -**Removed In Release: [v17.09](https://github.com/docker/docker-ce/releases/tag/v17.09.0-ce)** +**Removed in release: [v17.09](https://github.com/docker/docker-ce/releases/tag/v17.09.0-ce)** The flag `--api-enable-cors` is deprecated since v1.6.0. Use the flag `--api-cors-header` instead. ### `--run` flag on `docker commit` -**Deprecated In Release: [v0.10.0](https://github.com/docker/docker/releases/tag/v0.10.0)** +**Deprecated in release: [v0.10.0](https://github.com/docker/docker/releases/tag/v0.10.0)** -**Removed In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** +**Removed in release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)** The flag `--run` of the `docker commit` command (and its short version `-run`) were deprecated in favor of the `--changes` flag that allows to pass `Dockerfile` commands. ### Three arguments form in `docker import` -**Deprecated In Release: [v0.6.7](https://github.com/docker/docker/releases/tag/v0.6.7)** +**Deprecated in release: [v0.6.7](https://github.com/docker/docker/releases/tag/v0.6.7)** -**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** +**Removed in release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)** The `docker import` command format `file|URL|- [REPOSITORY [TAG]]` is deprecated since November 2013. It's no longer supported. diff --git a/_vendor/github.com/docker/cli/docs/extend/legacy_plugins.md b/_vendor/github.com/docker/cli/docs/extend/legacy_plugins.md index 2c6ba4bc1a2e..11269df40439 100644 --- a/_vendor/github.com/docker/cli/docs/extend/legacy_plugins.md +++ b/_vendor/github.com/docker/cli/docs/extend/legacy_plugins.md @@ -10,6 +10,14 @@ This document describes the Docker Engine plugins generally available in Docker Engine. To view information on plugins managed by Docker, refer to [Docker Engine plugin system](_index.md). +> [!NOTE] +> Legacy plugins are superseded by Docker Engine's managed plugin system. +> For plugins installed and managed by Docker, use +> [`docker plugin install`](https://docs.docker.com/reference/cli/docker/plugin/install/) +> and the [Docker Engine plugin system](_index.md). The third-party plugins +> listed on this page are provided for historical reference, and archived +> projects are marked accordingly. + You can extend the capabilities of the Docker Engine by loading third-party plugins. This page explains the types of plugins and provides links to several volume and network plugins for Docker. @@ -30,7 +38,8 @@ Follow the instructions in the plugin's documentation. ## Finding a plugin -The sections below provide an overview of available third-party plugins. +The sections below provide an overview of third-party plugins that use the +legacy plugin model. ### Network plugins @@ -44,22 +53,21 @@ The sections below provide an overview of available third-party plugins. | Plugin | Description | |:---------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Azure File Storage plugin](https://github.com/Azure/azurefile-dockervolumedriver) | Lets you mount Microsoft [Azure File Storage](https://azure.microsoft.com/blog/azure-file-storage-now-generally-available/) shares to Docker containers as volumes using the SMB 3.0 protocol. [Learn more](https://azure.microsoft.com/blog/persistent-docker-volumes-with-azure-file-storage/). | +| [Azure File Storage plugin](https://github.com/Azure/azurefile-dockervolumedriver) (archived) | Lets you mount Microsoft [Azure File Storage](https://azure.microsoft.com/blog/azure-file-storage-now-generally-available/) shares to Docker containers as volumes using the SMB 3.0 protocol. [Learn more](https://azure.microsoft.com/blog/persistent-docker-volumes-with-azure-file-storage/). | | [BeeGFS Volume Plugin](https://github.com/RedCoolBeans/docker-volume-beegfs) | An open source volume plugin to create persistent volumes in a BeeGFS parallel file system. | | [Blockbridge plugin](https://github.com/blockbridge/blockbridge-docker-volume) | A volume plugin that provides access to an extensible set of container-based persistent storage options. It supports single and multi-host Docker environments with features that include tenant isolation, automated provisioning, encryption, secure deletion, snapshots and QoS. | | [Contiv Volume Plugin](https://github.com/contiv/volplugin) | An open source volume plugin that provides multi-tenant, persistent, distributed storage with intent based consumption. It has support for Ceph and NFS. | -| [Convoy plugin](https://github.com/rancher/convoy) | A volume plugin for a variety of storage back-ends including device mapper and NFS. It's a simple standalone executable written in Go and provides the framework to support vendor-specific extensions such as snapshots, backups and restore. | +| [Convoy plugin](https://github.com/rancher/convoy) (archived) | A volume plugin for a variety of storage back-ends including device mapper and NFS. It's a simple standalone executable written in Go and provides the framework to support vendor-specific extensions such as snapshots, backups and restore. | | [DigitalOcean Block Storage plugin](https://github.com/omallo/docker-volume-plugin-dostorage) | Integrates DigitalOcean's [block storage solution](https://www.digitalocean.com/products/storage/) into the Docker ecosystem by automatically attaching a given block storage volume to a DigitalOcean droplet and making the contents of the volume available to Docker containers running on that droplet. | | [DRBD plugin](https://www.drbd.org/en/supported-projects/docker) | A volume plugin that provides highly available storage replicated by [DRBD](https://www.drbd.org). Data written to the docker volume is replicated in a cluster of DRBD nodes. | -| [Flocker plugin](https://github.com/ScatterHQ/flocker) | A volume plugin that provides multi-host portable volumes for Docker, enabling you to run databases and other stateful containers and move them around across a cluster of machines. | -| [Fuxi Volume Plugin](https://github.com/openstack/fuxi) | A volume plugin that is developed as part of the OpenStack Kuryr project and implements the Docker volume plugin API by utilizing Cinder, the OpenStack block storage service. | -| [gce-docker plugin](https://github.com/mcuadros/gce-docker) | A volume plugin able to attach, format and mount Google Compute [persistent-disks](https://cloud.google.com/compute/docs/disks/persistent-disks). | -| [GlusterFS plugin](https://github.com/calavera/docker-volume-glusterfs) | A volume plugin that provides multi-host volumes management for Docker using GlusterFS. | +| [Flocker plugin](https://github.com/ScatterHQ/flocker) (archived) | A volume plugin that provides multi-host portable volumes for Docker, enabling you to run databases and other stateful containers and move them around across a cluster of machines. | +| [Fuxi Volume Plugin](https://github.com/openstack-archive/fuxi) (archived) | A volume plugin that is developed as part of the OpenStack Kuryr project and implements the Docker volume plugin API by utilizing Cinder, the OpenStack block storage service. | +| [gce-docker plugin](https://github.com/mcuadros/gce-docker) (archived) | A volume plugin able to attach, format and mount Google Compute [persistent-disks](https://cloud.google.com/compute/docs/disks/persistent-disks). | +| [GlusterFS plugin](https://github.com/calavera/docker-volume-glusterfs) (archived) | A volume plugin that provides multi-host volumes management for Docker using GlusterFS. | | [Horcrux Volume Plugin](https://github.com/muthu-r/horcrux) | A volume plugin that allows on-demand, version controlled access to your data. Horcrux is an open-source plugin, written in Go, and supports SCP, [Minio](https://www.minio.io) and Amazon S3. | | [HPE 3Par Volume Plugin](https://github.com/hpe-storage/python-hpedockerplugin/) | A volume plugin that supports HPE 3Par and StoreVirtual iSCSI storage arrays. | -| [Infinit volume plugin](https://infinit.sh/documentation/docker/volume-plugin) | A volume plugin that makes it easy to mount and manage Infinit volumes using Docker. | -| [IPFS Volume Plugin](https://github.com/vdemeester/docker-volume-ipfs) | An open source volume plugin that allows using an [ipfs](https://ipfs.io/) filesystem as a volume. | -| [Keywhiz plugin](https://github.com/calavera/docker-volume-keywhiz) | A plugin that provides credentials and secret management using Keywhiz as a central repository. | +| [IPFS Volume Plugin](https://github.com/vdemeester/docker-volume-ipfs) (archived) | An open source volume plugin that allows using an [ipfs](https://ipfs.io/) filesystem as a volume. | +| [Keywhiz plugin](https://github.com/calavera/docker-volume-keywhiz) (archived) | A plugin that provides credentials and secret management using Keywhiz as a central repository. | | [Linode Volume Plugin](https://github.com/linode/docker-volume-linode) | A plugin that adds the ability to manage Linode Block Storage as Docker Volumes from within a Linode. | | [Local Persist Plugin](https://github.com/CWSpear/local-persist) | A volume plugin that extends the default `local` driver's functionality by allowing you specify a mountpoint anywhere on the host, which enables the files to *always persist*, even if the volume is removed via `docker volume rm`. | | [NetApp Plugin](https://github.com/NetApp/netappdvp) (nDVP) | A volume plugin that provides direct integration with the Docker ecosystem for the NetApp storage portfolio. The nDVP package supports the provisioning and management of storage resources from the storage platform to Docker hosts, with a robust framework for adding additional platforms in the future. | diff --git a/_vendor/github.com/docker/cli/docs/extend/plugin_api.md b/_vendor/github.com/docker/cli/docs/extend/plugin_api.md index a0b0a7367552..0cf2d9e1d6bf 100644 --- a/_vendor/github.com/docker/cli/docs/extend/plugin_api.md +++ b/_vendor/github.com/docker/cli/docs/extend/plugin_api.md @@ -21,7 +21,7 @@ which registers itself by placing a file on the daemon host in one of the plugin directories described in [Plugin discovery](#plugin-discovery). Plugins have human-readable names, which are short, lowercase strings. For -example, `flocker` or `weave`. +example, `myplugin`. Plugins can run inside or outside containers. Currently running them outside containers is recommended. @@ -45,12 +45,12 @@ spec files can be located either under `/etc/docker/plugins` or `/usr/lib/docker The name of the file (excluding the extension) determines the plugin name. -For example, the `flocker` plugin might create a Unix socket at -`/run/docker/plugins/flocker.sock`. +For example, a plugin named `myplugin` might create a Unix socket at +`/run/docker/plugins/myplugin.sock`. You can define each plugin into a separated subdirectory if you want to isolate definitions from each other. -For example, you can create the `flocker` socket under `/run/docker/plugins/flocker/flocker.sock` and only -mount `/run/docker/plugins/flocker` inside the `flocker` container. +For example, you can create the `myplugin` socket under `/run/docker/plugins/myplugin/myplugin.sock` and only +mount `/run/docker/plugins/myplugin` inside the `myplugin` container. Docker always searches for Unix sockets in `/run/docker/plugins` first. It checks for spec or json files under `/etc/docker/plugins` and `/usr/lib/docker/plugins` if the socket doesn't exist. The directory scan stops as diff --git a/_vendor/github.com/docker/cli/docs/extend/plugins_authorization.md b/_vendor/github.com/docker/cli/docs/extend/plugins_authorization.md index b8678debd59d..605fac16fa04 100644 --- a/_vendor/github.com/docker/cli/docs/extend/plugins_authorization.md +++ b/_vendor/github.com/docker/cli/docs/extend/plugins_authorization.md @@ -74,9 +74,14 @@ The sequence diagrams below depict an allow and deny authorization flow: Each request sent to the plugin includes the authenticated user, the HTTP headers, and the request/response body. Only the user name and the authentication method used are passed to the plugin. Most importantly, no user -credentials or tokens are passed. Finally, not all request/response bodies -are sent to the authorization plugin. Only those request/response bodies where -the `Content-Type` is either `text/*` or `application/json` are sent. +credentials or tokens are passed. + +> [!NOTE] +> Authorization plugins enforce requests to the Docker daemon's HTTP API only. gRPC method +> calls, whether dispatched natively or upgraded through `POST /grpc`, are not subject to authorization. +> Furthermore, HTTP request/response bodies where the `Content-Type` is `application/json` are forwarded; +> bodies of any other type are not visible to the plugin and cannot be used for enforcement, +> even though the daemon acts on this data. For commands that can potentially hijack the HTTP connection (`HTTP Upgrade`), such as `exec`, the authorization plugin is only called for the @@ -86,6 +91,38 @@ passed to the authorization plugins. For commands that return chunked HTTP response, such as `logs` and `events`, only the HTTP request is sent to the authorization plugins. +The Engine's authorization middleware fails closed: when a plugin returns an error or returns `Allow: false`, +the request is denied and the error is surfaced to the client. Plugins should also fail closed: if the plugin +cannot confidently evaluate a request, it should return an error or `Allow: false`. + +> [!WARNING] +> Because the plugin receives the [**raw** request body](#authzpluginauthzreq) from the daemon, it must +> apply the same decoding semantics as the daemon to be sure it evaluates the request the daemon will +> act on. The daemon decodes JSON with Go's [`encoding/json.Unmarshal`](https://pkg.go.dev/encoding/json#Unmarshal). +> +> The same requirement applies to the response body. Plugins that depend on `ResponseBody` +> inspection for redaction or content-filtering should restrict their policies to endpoints +> whose response is produced as a single write (typical of REST-style API responses). For +> commands whose responses are streamed or are likely to exceed the [buffer](#response-body-size-and-partial-buffering) through multiple +> writes, do not rely on `ResponseBody` for security-relevant decisions; perform the filtering +> in a separate layer in front of the daemon. + +### Response body size and partial buffering + +The internal buffer that holds the response body between the daemon's HTTP +handler and the plugin's response authorization callback (`responseModifier`, +defined in [`pkg/authorization/response.go`](https://github.com/moby/moby/blob/master/pkg/authorization/response.go)) +has a fixed capacity of 64 KiB (`maxBufferSize`). + +For most non-streaming endpoints the full response is buffered for plugin +inspection regardless of total size, because Go's `encoding/json` encoder +serializes the complete payload into a single underlying write. The +streaming-response exclusion noted above (for example, `logs` and `events`) +is the practical effect of this 64 KiB threshold combined with the +`io.WriteFlusher` write pattern used by streaming handlers, where each write +is immediately drained to the client and is therefore no longer available +for plugin inspection by the time the handler returns. + During request/response processing, some authorization flows might need to do additional queries to the Docker daemon. To complete such flows, plugins can call the daemon API similar to a regular user. To enable these @@ -209,7 +246,7 @@ Name | Type | Description User | string | The user identification Authentication method | string | The authentication method used Request method | enum | The HTTP method (GET/DELETE/POST) -Request URI | string | The HTTP request URI including API version (e.g., v.1.17/containers/json) +Request URI | string | The HTTP request URI including API version, as sent by the client (e.g., v.1.17/containers/json) Request headers | map[string]string | Request headers as key value pairs (without the authorization header) Request body | []byte | Raw request body @@ -232,7 +269,7 @@ Name | Type | Description User | string | The user identification Authentication method | string | The authentication method used Request method | string | The HTTP method (GET/DELETE/POST) -Request URI | string | The HTTP request URI including API version (e.g., v.1.17/containers/json) +Request URI | string | The HTTP request URI including API version, as sent by the client (e.g., v.1.17/containers/json) Request headers | map[string]string | Request headers as key value pairs (without the authorization header) Request body | []byte | Raw request body Response status code | int | Status code from the Docker daemon diff --git a/_vendor/github.com/docker/cli/docs/extend/plugins_network.md b/_vendor/github.com/docker/cli/docs/extend/plugins_network.md index 8f94546b01b4..0ff0a64b1b6a 100644 --- a/_vendor/github.com/docker/cli/docs/extend/plugins_network.md +++ b/_vendor/github.com/docker/cli/docs/extend/plugins_network.md @@ -61,11 +61,4 @@ plugin protocol The network driver protocol, in addition to the plugin activation call, is documented as part of libnetwork: -[https://github.com/moby/moby/blob/master/libnetwork/docs/remote.md](https://github.com/moby/moby/blob/master/libnetwork/docs/remote.md). - -## Related Information - -To interact with the Docker maintainers and other interested users, see the IRC channel `#docker-network`. - -- [Docker networks feature overview](https://docs.docker.com/engine/userguide/networking/) -- The [LibNetwork](https://github.com/docker/libnetwork) project +[https://github.com/moby/moby/blob/master/daemon/libnetwork/docs/remote.md](https://github.com/moby/moby/blob/master/daemon/libnetwork/docs/remote.md). diff --git a/_vendor/github.com/docker/cli/docs/extend/plugins_services.md b/_vendor/github.com/docker/cli/docs/extend/plugins_services.md index f0c2dc503ddc..fb914047b80d 100644 --- a/_vendor/github.com/docker/cli/docs/extend/plugins_services.md +++ b/_vendor/github.com/docker/cli/docs/extend/plugins_services.md @@ -38,7 +38,7 @@ node1 is the manager and node2 is the worker. ```console $ docker swarm join \ - --token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \ + --token SWMTKN-1-aabbccdd00112233aabbccdd00112233aabbccdd00112233aa-aabbccdd00112233... \ 192.168.99.100:2377 ``` diff --git a/_vendor/github.com/docker/cli/docs/extend/plugins_volume.md b/_vendor/github.com/docker/cli/docs/extend/plugins_volume.md index 8da7deb742c9..688350f6231b 100644 --- a/_vendor/github.com/docker/cli/docs/extend/plugins_volume.md +++ b/_vendor/github.com/docker/cli/docs/extend/plugins_volume.md @@ -45,7 +45,7 @@ accepts a volume name and path on the host, and the `--volume-driver` flag accepts a driver type. ```console -$ docker volume create --driver=flocker volumename +$ docker volume create --driver=myplugin volumename $ docker container run -it --volume volumename:/data busybox sh ``` @@ -61,11 +61,18 @@ separated by a colon (`:`) character. - The `Mountpoint` is the path on the host (v1) or in the plugin (v2) where the volume has been made available. -### `volumedriver` +### `--volume-driver` -Specifying a `volumedriver` in conjunction with a `volumename` allows you to -use plugins such as [Flocker](https://github.com/ScatterHQ/flocker) to manage -volumes external to a single host, such as those on EBS. +Specifying the `--volume-driver` flag together with a volume name (using +`--volume`) allows you to use plugins to manage volumes for the container. + +The `--volume-driver` flag is used as a default for all volumes created for +the container, including anonymous volumes. Use the [`--mount`] flag with +the [`volume-driver`] option to specify the driver to use for each volume +individually. + +[`--mount`]: https://docs.docker.com/reference/cli/docker/container/run/#mount +[`volume-driver`]: https://docs.docker.com/engine/storage/volumes/#start-a-container-which-creates-a-volume-using-a-volume-driver ## Create a VolumeDriver diff --git a/_vendor/github.com/docker/cli/docs/reference/dockerd.md b/_vendor/github.com/docker/cli/docs/reference/dockerd.md index b55b66c30b1d..1dcb19162654 100644 --- a/_vendor/github.com/docker/cli/docs/reference/dockerd.md +++ b/_vendor/github.com/docker/cli/docs/reference/dockerd.md @@ -24,10 +24,12 @@ A self-sufficient runtime for containers. Options: --add-runtime runtime Register an additional OCI compatible runtime (default []) + --allow-direct-routing Allow remote access to published ports on container IP addresses --authorization-plugin list Authorization plugins to load --bip string IPv4 address for the default bridge --bip6 string IPv6 address for the default bridge -b, --bridge string Attach containers to a network bridge + --bridge-accept-fwmark string In bridge networks, accept packets with this firewall mark/mask --cdi-spec-dir list CDI specification directories to use --cgroup-parent string Set parent cgroup for all containers --config-file string Daemon configuration file (default "/etc/docker/daemon.json") @@ -57,6 +59,7 @@ Options: --exec-root string Root directory for execution state files (default "/var/run/docker") --experimental Enable experimental features --feature map Enable feature in the daemon + --firewall-backend string Firewall backend to use, iptables or nftables --fixed-cidr string IPv4 subnet for the default bridge network --fixed-cidr-v6 string IPv6 subnet for the default bridge network -G, --group string Group for the unix socket (default "docker") @@ -607,7 +610,7 @@ $ sudo dockerd --add-runtime <runtime>=<path> Defining runtime arguments via the command line is not supported. -For an example configuration for a runc drop-in replacment, see +For an example configuration for a runc drop-in replacement, see [Alternative container runtimes > youki](https://docs.docker.com/engine/daemon/alternative-runtimes/#youki) ##### Configure the default container runtime @@ -839,42 +842,49 @@ $ docker run -it --add-host host.docker.internal:host-gateway \ PING host.docker.internal (2001:db8::1111): 56 data bytes ``` -### Enable CDI devices - -> [!NOTE] -> This is experimental feature and as such doesn't represent a stable API. -> -> This feature isn't enabled by default. To this feature, set `features.cdi` to -> `true` in the `daemon.json` configuration file. +### Configure CDI devices Container Device Interface (CDI) is a [standardized](https://github.com/cncf-tags/container-device-interface/blob/main/SPEC.md) mechanism for container runtimes to create containers which are able to interact with third party devices. +CDI is currently only supported for Linux containers and is enabled by default +since Docker Engine 28.3.0. + The Docker daemon supports running containers with CDI devices if the requested device specifications are available on the filesystem of the daemon. -The default specification directors are: +The default specification directories are: - `/etc/cdi/` for static CDI Specs - `/var/run/cdi` for generated CDI Specs -Alternatively, you can set custom locations for CDI specifications using the +#### Set custom locations + +To set custom locations for CDI specifications, use the `cdi-spec-dirs` option in the `daemon.json` configuration file, or the -`--cdi-spec-dir` flag for the `dockerd` CLI. +`--cdi-spec-dir` flag for the `dockerd` CLI: ```json { - "features": { - "cdi": true - }, "cdi-spec-dirs": ["/etc/cdi/", "/var/run/cdi"] } ``` -When CDI is enabled for a daemon, you can view the configured CDI specification -directories using the `docker info` command. +You can view the configured CDI specification directories using the `docker info` command. + +#### Disable CDI devices + +The feature in enabled by default. To disable it, use the `cdi` options in the `daemon.json` file: + +```json +"features": { + "cdi": false +}, +``` + +To check the status of the CDI devices, run `docker info`. #### Daemon logging format {#log-format} @@ -948,8 +958,6 @@ the `--cgroup-parent` option on the daemon. #### Daemon metrics The `--metrics-addr` option takes a TCP address to serve the metrics API. -This feature is still experimental, therefore, the daemon must be running in experimental -mode for this feature to work. To serve the metrics API on `localhost:9323` you would specify `--metrics-addr 127.0.0.1:9323`, allowing you to make requests on the API at `127.0.0.1:9323/metrics` to receive metrics in the @@ -1049,26 +1057,28 @@ $ echo $? ##### On Linux -The default location of the configuration file on Linux is -`/etc/docker/daemon.json`. Use the `--config-file` flag to specify a -non-default location. +The default location of the configuration file on Linux is `/etc/docker/daemon.json`. +If the file does not exist, you need to create it first. Use the `--config-file` +flag to specify a non-default location. The following is a full example of the allowed configuration options on Linux: ```json { + "allow-direct-routing": false, "authorization-plugins": [], "bip": "", "bip6": "", "bridge": "", + "bridge-accept-fwmark": "", "builder": { "gc": { "enabled": true, - "defaultKeepStorage": "10GB", + "defaultReservedSpace": "10GB", "policy": [ - { "keepStorage": "10GB", "filter": ["unused-for=2200h"] }, - { "keepStorage": "50GB", "filter": ["unused-for=3300h"] }, - { "keepStorage": "100GB", "all": true } + { "maxUsedSpace": "512MB", "keepDuration": "48h", "filter": [ "type=source.local" ] }, + { "reservedSpace": "10GB", "maxUsedSpace": "100GB", "keepDuration": "1440h" }, + { "reservedSpace": "50GB", "minFreeSpace": "20GB", "maxUsedSpace": "200GB", "all": true } ] } }, @@ -1111,6 +1121,7 @@ The following is a full example of the allowed configuration options on Linux: "cdi": true, "containerd-snapshotter": true }, + "firewall-backend": "", "fixed-cidr": "", "fixed-cidr-v6": "", "group": "", @@ -1197,8 +1208,9 @@ The following is a full example of the allowed configuration options on Linux: ##### On Windows The default location of the configuration file on Windows is -`%programdata%\docker\config\daemon.json`. Use the `--config-file` flag -to specify a non-default location. +`%programdata%\docker\config\daemon.json`. If the file does not exist, you need +to create it first. Use the `--config-file` flag to specify a non-default +location. The following is a full example of the allowed configuration options on Windows: @@ -1300,7 +1312,7 @@ The list of currently supported options that can be reconfigured is this: | ---------------------------------- | ----------------------------------------------------------------------------------------------------------- | | `debug` | Toggles debug mode of the daemon. | | `labels` | Replaces the daemon labels with a new set of labels. | -| `live-restore` | Toggles [live restore](https://docs.docker.com/engine/containers/live-restore/). | +| `live-restore` | Toggles [live restore](https://docs.docker.com/engine/daemon/live-restore/). | | `max-concurrent-downloads` | Configures the max concurrent downloads for each pull. | | `max-concurrent-uploads` | Configures the max concurrent uploads for each push. | | `max-download-attempts` | Configures the max download attempts for each pull. | diff --git a/_vendor/github.com/docker/cli/docs/reference/run.md b/_vendor/github.com/docker/cli/docs/reference/run.md index db06ad71f669..4824233685c9 100644 --- a/_vendor/github.com/docker/cli/docs/reference/run.md +++ b/_vendor/github.com/docker/cli/docs/reference/run.md @@ -248,10 +248,18 @@ $ docker run -it --mount type=bind,source=[PATH],target=[PATH] busybox ``` In this case, the `--mount` flag takes three parameters. A type (`bind`), and -two paths. The `source` path is a the location on the host that you want to +two paths. The `source` path is the location on the host that you want to bind mount into the container. The `target` path is the mount destination inside the container. +By default, bind mounts require the source path to exist on the daemon host. If the +source path doesn't exist, an error is returned. To create the source path on +the daemon host if it doesn't exist, use the `bind-create-src` option: + +```console +$ docker run -it --mount type=bind,source=[PATH],target=[PATH],bind-create-src busybox +``` + Bind mounts are read-write by default, meaning that you can both read and write files to and from the mounted location from the container. Changes that you make, such as adding or editing files, are reflected on the host filesystem: @@ -326,7 +334,6 @@ container: | `-m`, `--memory=""` | Memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 6M. | | `--memory-swap=""` | Total memory limit (memory + swap, format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | | `--memory-reservation=""` | Memory soft limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. | -| `--kernel-memory=""` | Kernel memory limit (format: `<number>[<unit>]`). Number is a positive integer. Unit can be one of `b`, `k`, `m`, or `g`. Minimum is 4M. | | `-c`, `--cpu-shares=0` | CPU shares (relative weight) | | `--cpus=0.000` | Number of CPUs. Number is a fractional number. 0.000 means no limit. | | `--cpu-period=0` | Limit the CPU CFS (Completely Fair Scheduler) period | @@ -419,7 +426,7 @@ $ docker run -it -m 300M ubuntu:24.04 /bin/bash We set memory limit only, this means the processes in the container can use 300M memory and 300M swap memory, by default, the total virtual memory size -(--memory-swap) will be set as double of memory, in this case, memory + swap +(`--memory-swap`) will be set as double of memory, in this case, memory + swap would be 2*300M, so processes can use 300M swap memory as well. ```console @@ -492,80 +499,6 @@ parameter can be changed to select the priority of which containers will be killed when the system is out of memory, with negative scores making them less likely to be killed, and positive scores more likely. -### Kernel memory constraints - -Kernel memory is fundamentally different than user memory as kernel memory can't -be swapped out. The inability to swap makes it possible for the container to -block system services by consuming too much kernel memory. Kernel memory includes: - - - stack pages - - slab pages - - sockets memory pressure - - tcp memory pressure - -You can setup kernel memory limit to constrain these kinds of memory. For example, -every process consumes some stack pages. By limiting kernel memory, you can -prevent new processes from being created when the kernel memory usage is too high. - -Kernel memory is never completely independent of user memory. Instead, you limit -kernel memory in the context of the user memory limit. Assume "U" is the user memory -limit and "K" the kernel limit. There are three possible ways to set limits: - -<table> - <thead> - <tr> - <th>Option</th> - <th>Result</th> - </tr> - </thead> - <tbody> - <tr> - <td class="no-wrap"><strong>U != 0, K = inf</strong> (default)</td> - <td> - This is the standard memory limitation mechanism already present before using - kernel memory. Kernel memory is completely ignored. - </td> - </tr> - <tr> - <td class="no-wrap"><strong>U != 0, K < U</strong></td> - <td> - Kernel memory is a subset of the user memory. This setup is useful in - deployments where the total amount of memory per-cgroup is overcommitted. - Overcommitting kernel memory limits is definitely not recommended, since the - box can still run out of non-reclaimable memory. - In this case, you can configure K so that the sum of all groups is - never greater than the total memory. Then, freely set U at the expense of - the system's service quality. - </td> - </tr> - <tr> - <td class="no-wrap"><strong>U != 0, K > U</strong></td> - <td> - Since kernel memory charges are also fed to the user counter and reclamation - is triggered for the container for both kinds of memory. This configuration - gives the admin a unified view of memory. It is also useful for people - who just want to track kernel memory usage. - </td> - </tr> - </tbody> -</table> - -Examples: - -```console -$ docker run -it -m 500M --kernel-memory 50M ubuntu:24.04 /bin/bash -``` - -We set memory and kernel memory, so the processes in the container can use -500M memory in total, in this 500M memory, it can be 50M kernel memory tops. - -```console -$ docker run -it --kernel-memory 50M ubuntu:24.04 /bin/bash -``` - -We set kernel memory without **-m**, so the processes in the container can -use as much memory as they want, but they can only use 50M kernel memory. - ### Swappiness constraint By default, a container's kernel can swap out a percentage of anonymous pages. @@ -1087,7 +1020,7 @@ Additionally, you can set any environment variable in the container by using one or more `-e` flags. You can even override the variables mentioned above, or variables defined using a Dockerfile `ENV` instruction when building the image. -If the you name an environment variable without specifying a value, the current +If you name an environment variable without specifying a value, the current value of the named variable on the host is propagated into the container's environment: @@ -1214,7 +1147,7 @@ starting a container, you can override the `USER` instruction by passing the -u="", --user="": Sets the username or UID used and optionally the groupname or GID for the specified command. ``` -The followings examples are all valid: +The following examples are all valid: ```text --user=[ user | user:group | uid | uid:gid | user:gid | uid:group ] diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose.md deleted file mode 100644 index d1a1c2a46272..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose.md +++ /dev/null @@ -1,210 +0,0 @@ -# docker compose - -```text -docker compose [-f <arg>...] [options] [COMMAND] [ARGS...] -``` - -<!---MARKER_GEN_START--> -Define and run multi-container applications with Docker - -### Subcommands - -| Name | Description | -|:--------------------------------|:----------------------------------------------------------------------------------------| -| [`attach`](compose_attach.md) | Attach local standard input, output, and error streams to a service's running container | -| [`build`](compose_build.md) | Build or rebuild services | -| [`commit`](compose_commit.md) | Create a new image from a service container's changes | -| [`config`](compose_config.md) | Parse, resolve and render compose file in canonical format | -| [`cp`](compose_cp.md) | Copy files/folders between a service container and the local filesystem | -| [`create`](compose_create.md) | Creates containers for a service | -| [`down`](compose_down.md) | Stop and remove containers, networks | -| [`events`](compose_events.md) | Receive real time events from containers | -| [`exec`](compose_exec.md) | Execute a command in a running container | -| [`export`](compose_export.md) | Export a service container's filesystem as a tar archive | -| [`images`](compose_images.md) | List images used by the created containers | -| [`kill`](compose_kill.md) | Force stop service containers | -| [`logs`](compose_logs.md) | View output from containers | -| [`ls`](compose_ls.md) | List running compose projects | -| [`pause`](compose_pause.md) | Pause services | -| [`port`](compose_port.md) | Print the public port for a port binding | -| [`ps`](compose_ps.md) | List containers | -| [`publish`](compose_publish.md) | Publish compose application | -| [`pull`](compose_pull.md) | Pull service images | -| [`push`](compose_push.md) | Push service images | -| [`restart`](compose_restart.md) | Restart service containers | -| [`rm`](compose_rm.md) | Removes stopped service containers | -| [`run`](compose_run.md) | Run a one-off command on a service | -| [`scale`](compose_scale.md) | Scale services | -| [`start`](compose_start.md) | Start services | -| [`stats`](compose_stats.md) | Display a live stream of container(s) resource usage statistics | -| [`stop`](compose_stop.md) | Stop services | -| [`top`](compose_top.md) | Display the running processes | -| [`unpause`](compose_unpause.md) | Unpause services | -| [`up`](compose_up.md) | Create and start containers | -| [`version`](compose_version.md) | Show the Docker Compose version information | -| [`wait`](compose_wait.md) | Block until containers of all (or specified) services stop. | -| [`watch`](compose_watch.md) | Watch build context for service and rebuild/refresh containers when files are updated | - - -### Options - -| Name | Type | Default | Description | -|:-----------------------|:--------------|:--------|:----------------------------------------------------------------------------------------------------| -| `--all-resources` | `bool` | | Include all resources, even those not used by services | -| `--ansi` | `string` | `auto` | Control when to print ANSI control characters ("never"\|"always"\|"auto") | -| `--compatibility` | `bool` | | Run compose in backward compatibility mode | -| `--dry-run` | `bool` | | Execute command in dry run mode | -| `--env-file` | `stringArray` | | Specify an alternate environment file | -| `-f`, `--file` | `stringArray` | | Compose configuration files | -| `--parallel` | `int` | `-1` | Control max parallelism, -1 for unlimited | -| `--profile` | `stringArray` | | Specify a profile to enable | -| `--progress` | `string` | `auto` | Set type of progress output (auto, tty, plain, json, quiet) | -| `--project-directory` | `string` | | Specify an alternate working directory<br>(default: the path of the, first specified, Compose file) | -| `-p`, `--project-name` | `string` | | Project name | - - -<!---MARKER_GEN_END--> - -## Examples - -### Use `-f` to specify the name and path of one or more Compose files -Use the `-f` flag to specify the location of a Compose [configuration file](/reference/compose-file/). - -#### Specifying multiple Compose files -You can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single -configuration. Compose builds the configuration in the order you supply the files. Subsequent files override and add -to their predecessors. - -For example, consider this command line: - -```console -$ docker compose -f compose.yaml -f compose.admin.yaml run backup_db -``` - -The `compose.yaml` file might specify a `webapp` service. - -```yaml -services: - webapp: - image: examples/web - ports: - - "8000:8000" - volumes: - - "/data" -``` -If the `compose.admin.yaml` also specifies this same service, any matching fields override the previous file. -New values, add to the `webapp` service configuration. - -```yaml -services: - webapp: - build: . - environment: - - DEBUG=1 -``` - -When you use multiple Compose files, all paths in the files are relative to the first configuration file specified -with `-f`. You can use the `--project-directory` option to override this base path. - -Use a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the -configuration are relative to the current working directory. - -The `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory -and its parent directories looking for a `compose.yaml` or `docker-compose.yaml` file. - -#### Specifying a path to a single Compose file -You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either -from the command line or by setting up a `COMPOSE_FILE` environment variable in your shell or in an environment file. - -For an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and -have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to -get the postgres image for the db service from anywhere by using the `-f` flag as follows: - -```console -$ docker compose -f ~/sandbox/rails/compose.yaml pull db -``` - -### Use `-p` to specify a project name - -Each configuration has a project name. Compose sets the project name using -the following mechanisms, in order of precedence: -- The `-p` command line flag -- The `COMPOSE_PROJECT_NAME` environment variable -- The top level `name:` variable from the config file (or the last `name:` -from a series of config files specified using `-f`) -- The `basename` of the project directory containing the config file (or -containing the first config file specified using `-f`) -- The `basename` of the current directory if no config file is specified -Project names must contain only lowercase letters, decimal digits, dashes, -and underscores, and must begin with a lowercase letter or decimal digit. If -the `basename` of the project directory or current directory violates this -constraint, you must use one of the other mechanisms. - -```console -$ docker compose -p my_project ps -a -NAME SERVICE STATUS PORTS -my_project_demo_1 demo running - -$ docker compose -p my_project logs -demo_1 | PING localhost (127.0.0.1): 56 data bytes -demo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms -``` - -### Use profiles to enable optional services - -Use `--profile` to specify one or more active profiles -Calling `docker compose --profile frontend up` starts the services with the profile `frontend` and services -without any specified profiles. -You can also enable multiple profiles, e.g. with `docker compose --profile frontend --profile debug up` the profiles `frontend` and `debug` is enabled. - -Profiles can also be set by `COMPOSE_PROFILES` environment variable. - -### Configuring parallelism - -Use `--parallel` to specify the maximum level of parallelism for concurrent engine calls. -Calling `docker compose --parallel 1 pull` pulls the pullable images defined in the Compose file -one at a time. This can also be used to control build concurrency. - -Parallelism can also be set by the `COMPOSE_PARALLEL_LIMIT` environment variable. - -### Set up environment variables - -You can set environment variables for various docker compose options, including the `-f`, `-p` and `--profiles` flags. - -Setting the `COMPOSE_FILE` environment variable is equivalent to passing the `-f` flag, -`COMPOSE_PROJECT_NAME` environment variable does the same as the `-p` flag, -`COMPOSE_PROFILES` environment variable is equivalent to the `--profiles` flag -and `COMPOSE_PARALLEL_LIMIT` does the same as the `--parallel` flag. - -If flags are explicitly set on the command line, the associated environment variable is ignored. - -Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` stops docker compose from detecting orphaned -containers for the project. - -Setting the `COMPOSE_MENU` environment variable to `false` disables the helper menu when running `docker compose up` -in attached mode. Alternatively, you can also run `docker compose up --menu=false` to disable the helper menu. - -### Use Dry Run mode to test your command - -Use `--dry-run` flag to test a command without changing your application stack state. -Dry Run mode shows you all the steps Compose applies when executing a command, for example: -```console -$ docker compose --dry-run up --build -d -[+] Pulling 1/1 - ✔ DRY-RUN MODE - db Pulled 0.9s -[+] Running 10/8 - ✔ DRY-RUN MODE - build service backend 0.0s - ✔ DRY-RUN MODE - ==> ==> writing image dryRun-754a08ddf8bcb1cf22f310f09206dd783d42f7dd 0.0s - ✔ DRY-RUN MODE - ==> ==> naming to nginx-golang-mysql-backend 0.0s - ✔ DRY-RUN MODE - Network nginx-golang-mysql_default Created 0.0s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-db-1 Created 0.0s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-backend-1 Created 0.0s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-proxy-1 Created 0.0s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-db-1 Healthy 0.5s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-backend-1 Started 0.0s - ✔ DRY-RUN MODE - Container nginx-golang-mysql-proxy-1 Started Started -``` -From the example above, you can see that the first step is to pull the image defined by `db` service, then build the `backend` service. -Next, the containers are created. The `db` service is started, and the `backend` and `proxy` wait until the `db` service is healthy before starting. - -Dry Run mode works with almost all commands. You cannot use Dry Run mode with a command that doesn't change the state of a Compose stack such as `ps`, `ls`, `logs` for example. diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_events.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_events.md deleted file mode 100644 index b71f4c993d50..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_events.md +++ /dev/null @@ -1,54 +0,0 @@ -# docker compose events - -<!---MARKER_GEN_START--> -Stream container events for every container in the project. - -With the `--json` flag, a json object is printed one per line with the format: - -```json -{ - "time": "2015-11-20T18:01:03.615550", - "type": "container", - "action": "create", - "id": "213cf7...5fc39a", - "service": "web", - "attributes": { - "name": "application_web_1", - "image": "alpine:edge" - } -} -``` - -The events that can be received using this can be seen [here](/reference/cli/docker/system/events/#object-types). - -### Options - -| Name | Type | Default | Description | -|:------------|:-------|:--------|:------------------------------------------| -| `--dry-run` | `bool` | | Execute command in dry run mode | -| `--json` | `bool` | | Output events as a stream of json objects | - - -<!---MARKER_GEN_END--> - -## Description - -Stream container events for every container in the project. - -With the `--json` flag, a json object is printed one per line with the format: - -```json -{ - "time": "2015-11-20T18:01:03.615550", - "type": "container", - "action": "create", - "id": "213cf7...5fc39a", - "service": "web", - "attributes": { - "name": "application_web_1", - "image": "alpine:edge" - } -} -``` - -The events that can be received using this can be seen [here](https://docs.docker.com/reference/cli/docker/system/events/#object-types). diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_exec.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_exec.md deleted file mode 100644 index 8b54def472e9..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_exec.md +++ /dev/null @@ -1,30 +0,0 @@ -# docker compose exec - -<!---MARKER_GEN_START--> -This is the equivalent of `docker exec` targeting a Compose service. - -With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so -you can use a command such as `docker compose exec web sh` to get an interactive prompt. - -### Options - -| Name | Type | Default | Description | -|:------------------|:--------------|:--------|:---------------------------------------------------------------------------------| -| `-d`, `--detach` | `bool` | | Detached mode: Run command in the background | -| `--dry-run` | `bool` | | Execute command in dry run mode | -| `-e`, `--env` | `stringArray` | | Set environment variables | -| `--index` | `int` | `0` | Index of the container if service has multiple replicas | -| `-T`, `--no-TTY` | `bool` | `true` | Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY. | -| `--privileged` | `bool` | | Give extended privileges to the process | -| `-u`, `--user` | `string` | | Run the command as this user | -| `-w`, `--workdir` | `string` | | Path to workdir directory for this command | - - -<!---MARKER_GEN_END--> - -## Description - -This is the equivalent of `docker exec` targeting a Compose service. - -With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so -you can use a command such as `docker compose exec web sh` to get an interactive prompt. diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_logs.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_logs.md deleted file mode 100644 index 4c8ba7e34867..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_logs.md +++ /dev/null @@ -1,25 +0,0 @@ -# docker compose logs - -<!---MARKER_GEN_START--> -Displays log output from services - -### Options - -| Name | Type | Default | Description | -|:---------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------| -| `--dry-run` | `bool` | | Execute command in dry run mode | -| `-f`, `--follow` | `bool` | | Follow log output | -| `--index` | `int` | `0` | index of the container if service has multiple replicas | -| `--no-color` | `bool` | | Produce monochrome output | -| `--no-log-prefix` | `bool` | | Don't print prefix in logs | -| `--since` | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | -| `-n`, `--tail` | `string` | `all` | Number of lines to show from the end of the logs for each container | -| `-t`, `--timestamps` | `bool` | | Show timestamps | -| `--until` | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | - - -<!---MARKER_GEN_END--> - -## Description - -Displays log output from services diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_start.md b/_vendor/github.com/docker/compose/v2/docs/reference/compose_start.md deleted file mode 100644 index 08db7ef2135a..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_start.md +++ /dev/null @@ -1,17 +0,0 @@ -# docker compose start - -<!---MARKER_GEN_START--> -Starts existing containers for a service - -### Options - -| Name | Type | Default | Description | -|:------------|:-------|:--------|:--------------------------------| -| `--dry-run` | `bool` | | Execute command in dry run mode | - - -<!---MARKER_GEN_END--> - -## Description - -Starts existing containers for a service diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_events.yaml b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_events.yaml deleted file mode 100644 index fe6d4216ce1f..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_events.yaml +++ /dev/null @@ -1,54 +0,0 @@ -command: docker compose events -short: Receive real time events from containers -long: |- - Stream container events for every container in the project. - - With the `--json` flag, a json object is printed one per line with the format: - - ```json - { - "time": "2015-11-20T18:01:03.615550", - "type": "container", - "action": "create", - "id": "213cf7...5fc39a", - "service": "web", - "attributes": { - "name": "application_web_1", - "image": "alpine:edge" - } - } - ``` - - The events that can be received using this can be seen [here](/reference/cli/docker/system/events/#object-types). -usage: docker compose events [OPTIONS] [SERVICE...] -pname: docker compose -plink: docker_compose.yaml -options: - - option: json - value_type: bool - default_value: "false" - description: Output events as a stream of json objects - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -inherited_options: - - option: dry-run - value_type: bool - default_value: "false" - description: Execute command in dry run mode - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -deprecated: false -hidden: false -experimental: false -experimentalcli: false -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_start.yaml b/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_start.yaml deleted file mode 100644 index 902b688d3e7c..000000000000 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_start.yaml +++ /dev/null @@ -1,24 +0,0 @@ -command: docker compose start -short: Start services -long: Starts existing containers for a service -usage: docker compose start [SERVICE...] -pname: docker compose -plink: docker_compose.yaml -inherited_options: - - option: dry-run - value_type: bool - default_value: "false" - description: Execute command in dry run mode - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -deprecated: false -hidden: false -experimental: false -experimentalcli: false -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose.md new file mode 100644 index 000000000000..d80bb86ec626 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose.md @@ -0,0 +1,264 @@ + +# docker compose + +```text +docker compose [-f <arg>...] [options] [COMMAND] [ARGS...] +``` + +<!---MARKER_GEN_START--> +Define and run multi-container applications with Docker + +### Subcommands + +| Name | Description | +|:--------------------------------|:----------------------------------------------------------------------------------------| +| [`attach`](compose_attach.md) | Attach local standard input, output, and error streams to a service's running container | +| [`bridge`](compose_bridge.md) | Convert compose files into another model | +| [`build`](compose_build.md) | Build or rebuild services | +| [`commit`](compose_commit.md) | Create a new image from a service container's changes | +| [`config`](compose_config.md) | Parse, resolve and render compose file in canonical format | +| [`cp`](compose_cp.md) | Copy files/folders between a service container and the local filesystem | +| [`create`](compose_create.md) | Creates containers for a service | +| [`down`](compose_down.md) | Stop and remove containers, networks | +| [`events`](compose_events.md) | Receive real time events from containers | +| [`exec`](compose_exec.md) | Execute a command in a running container | +| [`export`](compose_export.md) | Export a service container's filesystem as a tar archive | +| [`images`](compose_images.md) | List images used by the created containers | +| [`kill`](compose_kill.md) | Force stop service containers | +| [`logs`](compose_logs.md) | View output from containers | +| [`ls`](compose_ls.md) | List running compose projects | +| [`pause`](compose_pause.md) | Pause services | +| [`port`](compose_port.md) | Print the public port for a port binding | +| [`ps`](compose_ps.md) | List containers | +| [`publish`](compose_publish.md) | Publish compose application | +| [`pull`](compose_pull.md) | Pull service images | +| [`push`](compose_push.md) | Push service images | +| [`restart`](compose_restart.md) | Restart service containers | +| [`rm`](compose_rm.md) | Removes stopped service containers | +| [`run`](compose_run.md) | Run a one-off command on a service | +| [`scale`](compose_scale.md) | Scale services | +| [`start`](compose_start.md) | Start services | +| [`stats`](compose_stats.md) | Display a live stream of container(s) resource usage statistics | +| [`stop`](compose_stop.md) | Stop services | +| [`top`](compose_top.md) | Display the running processes | +| [`unpause`](compose_unpause.md) | Unpause services | +| [`up`](compose_up.md) | Create and start containers | +| [`version`](compose_version.md) | Show the Docker Compose version information | +| [`volumes`](compose_volumes.md) | List volumes | +| [`wait`](compose_wait.md) | Block until containers of all (or specified) services stop. | +| [`watch`](compose_watch.md) | Watch build context for service and rebuild/refresh containers when files are updated | + + +### Options + +| Name | Type | Default | Description | +|:-----------------------|:--------------|:--------|:----------------------------------------------------------------------------------------------------| +| `--all-resources` | `bool` | | Include all resources, even those not used by services | +| `--ansi` | `string` | `auto` | Control when to print ANSI control characters ("never"\|"always"\|"auto") | +| `--compatibility` | `bool` | | Run compose in backward compatibility mode | +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `--env-file` | `stringArray` | | Specify an alternate environment file | +| `-f`, `--file` | `stringArray` | | Compose configuration files | +| `--parallel` | `int` | `-1` | Control max parallelism, -1 for unlimited | +| `--profile` | `stringArray` | | Specify a profile to enable | +| `--progress` | `string` | | Set type of progress output (auto, tty, plain, json, quiet) | +| `--project-directory` | `string` | | Specify an alternate working directory<br>(default: the path of the, first specified, Compose file) | +| `-p`, `--project-name` | `string` | | Project name | + + +<!---MARKER_GEN_END--> + +## Examples + +### Use `-f` to specify the name and path of one or more Compose files +Use the `-f` flag to specify the location of a Compose [configuration file](/reference/compose-file/). + +#### Specifying multiple Compose files +You can supply multiple `-f` configuration files. When you supply multiple files, Compose combines them into a single +configuration. Compose builds the configuration in the order you supply the files. Subsequent files override and add +to their predecessors. + +For example, consider this command line: + +```console +$ docker compose -f compose.yaml -f compose.admin.yaml run backup_db +``` + +The `compose.yaml` file might specify a `webapp` service. + +```yaml +services: + webapp: + image: examples/web + ports: + - "8000:8000" + volumes: + - "/data" +``` +If the `compose.admin.yaml` also specifies this same service, any matching fields override the previous file. +New values, add to the `webapp` service configuration. + +```yaml +services: + webapp: + build: . + environment: + - DEBUG=1 +``` + +When you use multiple Compose files, all paths in the files are relative to the first configuration file specified +with `-f`. You can use the `--project-directory` option to override this base path. + +Use a `-f` with `-` (dash) as the filename to read the configuration from stdin. When stdin is used all paths in the +configuration are relative to the current working directory. + +The `-f` flag is optional. If you don’t provide this flag on the command line, Compose traverses the working directory +and its parent directories looking for a `compose.yaml` or `docker-compose.yaml` file. + +#### Specifying a path to a single Compose file +You can use the `-f` flag to specify a path to a Compose file that is not located in the current directory, either +from the command line or by setting up a `COMPOSE_FILE` environment variable in your shell or in an environment file. + +For an example of using the `-f` option at the command line, suppose you are running the Compose Rails sample, and +have a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command like `docker compose pull` to +get the postgres image for the db service from anywhere by using the `-f` flag as follows: + +```console +$ docker compose -f ~/sandbox/rails/compose.yaml pull db +``` + +#### Using an OCI published artifact +You can use the `-f` flag with the `oci://` prefix to reference a Compose file that has been published to an OCI registry. +This allows you to distribute and version your Compose configurations as OCI artifacts. + +To use a Compose file from an OCI registry: + +```console +$ docker compose -f oci://registry.example.com/my-compose-project:latest up +``` + +You can also combine OCI artifacts with local files: + +```console +$ docker compose -f oci://registry.example.com/my-compose-project:v1.0 -f compose.override.yaml up +``` + +The OCI artifact must contain a valid Compose file. You can publish Compose files to an OCI registry using the +`docker compose publish` command. + +#### Using a git repository +You can use the `-f` flag to reference a Compose file from a git repository. Compose supports various git URL formats: + +Using HTTPS: +```console +$ docker compose -f https://github.com/user/repo.git up +``` + +Using SSH: +```console +$ docker compose -f git@github.com:user/repo.git up +``` + +You can specify a specific branch, tag, or commit: +```console +$ docker compose -f https://github.com/user/repo.git@main up +$ docker compose -f https://github.com/user/repo.git@v1.0.0 up +$ docker compose -f https://github.com/user/repo.git@abc123 up +``` + +You can also specify a subdirectory within the repository: +```console +$ docker compose -f https://github.com/user/repo.git#main:path/to/compose.yaml up +``` + +When using git resources, Compose will clone the repository and use the specified Compose file. You can combine +git resources with local files: + +```console +$ docker compose -f https://github.com/user/repo.git -f compose.override.yaml up +``` + +### Use `-p` to specify a project name + +Each configuration has a project name. Compose sets the project name using +the following mechanisms, in order of precedence: +- The `-p` command line flag +- The `COMPOSE_PROJECT_NAME` environment variable +- The top level `name:` variable from the config file (or the last `name:` +from a series of config files specified using `-f`) +- The `basename` of the project directory containing the config file (or +containing the first config file specified using `-f`) +- The `basename` of the current directory if no config file is specified +Project names must contain only lowercase letters, decimal digits, dashes, +and underscores, and must begin with a lowercase letter or decimal digit. If +the `basename` of the project directory or current directory violates this +constraint, you must use one of the other mechanisms. + +```console +$ docker compose -p my_project ps -a +NAME SERVICE STATUS PORTS +my_project_demo_1 demo running + +$ docker compose -p my_project logs +demo_1 | PING localhost (127.0.0.1): 56 data bytes +demo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms +``` + +### Use profiles to enable optional services + +Use `--profile` to specify one or more active profiles +Calling `docker compose --profile frontend up` starts the services with the profile `frontend` and services +without any specified profiles. +You can also enable multiple profiles, e.g. with `docker compose --profile frontend --profile debug up` the profiles `frontend` and `debug` is enabled. + +Profiles can also be set by `COMPOSE_PROFILES` environment variable. + +### Configuring parallelism + +Use `--parallel` to specify the maximum level of parallelism for concurrent engine calls. +Calling `docker compose --parallel 1 pull` pulls the pullable images defined in the Compose file +one at a time. This can also be used to control build concurrency. + +Parallelism can also be set by the `COMPOSE_PARALLEL_LIMIT` environment variable. + +### Set up environment variables + +You can set environment variables for various docker compose options, including the `-f`, `-p` and `--profiles` flags. + +Setting the `COMPOSE_FILE` environment variable is equivalent to passing the `-f` flag, +`COMPOSE_PROJECT_NAME` environment variable does the same as the `-p` flag, +`COMPOSE_PROFILES` environment variable is equivalent to the `--profiles` flag +and `COMPOSE_PARALLEL_LIMIT` does the same as the `--parallel` flag. + +If flags are explicitly set on the command line, the associated environment variable is ignored. + +Setting the `COMPOSE_IGNORE_ORPHANS` environment variable to `true` stops docker compose from detecting orphaned +containers for the project. + +Setting the `COMPOSE_MENU` environment variable to `false` disables the helper menu when running `docker compose up` +in attached mode. Alternatively, you can also run `docker compose up --menu=false` to disable the helper menu. + +### Use Dry Run mode to test your command + +Use `--dry-run` flag to test a command without changing your application stack state. +Dry Run mode shows you all the steps Compose applies when executing a command, for example: +```console +$ docker compose --dry-run up --build -d +[+] Pulling 1/1 + ✔ DRY-RUN MODE - db Pulled 0.9s +[+] Running 10/8 + ✔ DRY-RUN MODE - build service backend 0.0s + ✔ DRY-RUN MODE - ==> ==> writing image dryRun-754a08ddf8bcb1cf22f310f09206dd783d42f7dd 0.0s + ✔ DRY-RUN MODE - ==> ==> naming to nginx-golang-mysql-backend 0.0s + ✔ DRY-RUN MODE - Network nginx-golang-mysql_default Created 0.0s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-db-1 Created 0.0s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-backend-1 Created 0.0s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-proxy-1 Created 0.0s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-db-1 Healthy 0.5s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-backend-1 Started 0.0s + ✔ DRY-RUN MODE - Container nginx-golang-mysql-proxy-1 Started Started +``` +From the example above, you can see that the first step is to pull the image defined by `db` service, then build the `backend` service. +Next, the containers are created. The `db` service is started, and the `backend` and `proxy` wait until the `db` service is healthy before starting. + +Dry Run mode works with almost all commands. You cannot use Dry Run mode with a command that doesn't change the state of a Compose stack such as `ps`, `ls`, `logs` for example. diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_dry-run.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_dry-run.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_dry-run.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_dry-run.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_generate.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_generate.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_generate.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_generate.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_publish.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_publish.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_publish.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_publish.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_scale.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_scale.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_scale.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_scale.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_viz.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_viz.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_viz.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_viz.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_watch.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_watch.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_alpha_watch.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_alpha_watch.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_attach.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_attach.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_attach.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_attach.md diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge.md new file mode 100644 index 000000000000..78d3da4934c5 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge.md @@ -0,0 +1,22 @@ +# docker compose bridge + +<!---MARKER_GEN_START--> +Convert compose files into another model + +### Subcommands + +| Name | Description | +|:-------------------------------------------------------|:-----------------------------------------------------------------------------| +| [`convert`](compose_bridge_convert.md) | Convert compose files to Kubernetes manifests, Helm charts, or another model | +| [`transformations`](compose_bridge_transformations.md) | Manage transformation images | + + +### Options + +| Name | Type | Default | Description | +|:------------|:-------|:--------|:--------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_convert.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_convert.md new file mode 100644 index 000000000000..d4b91ba172d2 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_convert.md @@ -0,0 +1,17 @@ +# docker compose bridge convert + +<!---MARKER_GEN_START--> +Convert compose files to Kubernetes manifests, Helm charts, or another model + +### Options + +| Name | Type | Default | Description | +|:-------------------------|:--------------|:--------|:-------------------------------------------------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `-o`, `--output` | `string` | `out` | The output directory for the Kubernetes resources | +| `--templates` | `string` | | Directory containing transformation templates | +| `-t`, `--transformation` | `stringArray` | | Transformation to apply to compose model (default: docker/compose-bridge-kubernetes) | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations.md new file mode 100644 index 000000000000..1e1c7be392b1 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations.md @@ -0,0 +1,22 @@ +# docker compose bridge transformations + +<!---MARKER_GEN_START--> +Manage transformation images + +### Subcommands + +| Name | Description | +|:-----------------------------------------------------|:-------------------------------| +| [`create`](compose_bridge_transformations_create.md) | Create a new transformation | +| [`list`](compose_bridge_transformations_list.md) | List available transformations | + + +### Options + +| Name | Type | Default | Description | +|:------------|:-------|:--------|:--------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_create.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_create.md new file mode 100644 index 000000000000..187e8d9eca30 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_create.md @@ -0,0 +1,15 @@ +# docker compose bridge transformations create + +<!---MARKER_GEN_START--> +Create a new transformation + +### Options + +| Name | Type | Default | Description | +|:---------------|:---------|:--------|:----------------------------------------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `-f`, `--from` | `string` | | Existing transformation to copy (default: docker/compose-bridge-kubernetes) | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_list.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_list.md new file mode 100644 index 000000000000..ce0a5e6911ad --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_bridge_transformations_list.md @@ -0,0 +1,20 @@ +# docker compose bridge transformations list + +<!---MARKER_GEN_START--> +List available transformations + +### Aliases + +`docker compose bridge transformations list`, `docker compose bridge transformations ls` + +### Options + +| Name | Type | Default | Description | +|:----------------|:---------|:--------|:-------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `--format` | `string` | `table` | Format the output. Values: [table \| json] | +| `-q`, `--quiet` | `bool` | | Only display transformer names | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_build.md similarity index 83% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_build.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_build.md index 98d573e44c38..a715974dfa57 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_build.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_build.md @@ -17,13 +17,16 @@ run `docker compose build` to rebuild it. |:----------------------|:--------------|:--------|:------------------------------------------------------------------------------------------------------------| | `--build-arg` | `stringArray` | | Set build-time variables for services | | `--builder` | `string` | | Set builder to use | +| `--check` | `bool` | | Check build configuration | | `--dry-run` | `bool` | | Execute command in dry run mode | | `-m`, `--memory` | `bytes` | `0` | Set memory limit for the build container. Not supported by BuildKit. | | `--no-cache` | `bool` | | Do not use cache when building the image | | `--print` | `bool` | | Print equivalent bake file | +| `--provenance` | `string` | | Add a provenance attestation | | `--pull` | `bool` | | Always attempt to pull a newer version of the image | | `--push` | `bool` | | Push service images | -| `-q`, `--quiet` | `bool` | | Don't print anything to STDOUT | +| `-q`, `--quiet` | `bool` | | Suppress the build output | +| `--sbom` | `string` | | Add a SBOM attestation | | `--ssh` | `string` | | Set SSH authentications used when building service images. (use 'default' for using your default SSH Agent) | | `--with-dependencies` | `bool` | | Also build dependencies (transitively) | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_commit.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_commit.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_commit.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_commit.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_config.md similarity index 86% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_config.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_config.md index 9e87efd29cbc..e2e773feae54 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_config.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_config.md @@ -5,19 +5,18 @@ It merges the Compose files set by `-f` flags, resolves variables in the Compose file, and expands short-notation into the canonical format. -### Aliases - -`docker compose config`, `docker compose convert` - ### Options | Name | Type | Default | Description | |:--------------------------|:---------|:--------|:----------------------------------------------------------------------------| | `--dry-run` | `bool` | | Execute command in dry run mode | | `--environment` | `bool` | | Print environment used for interpolation. | -| `--format` | `string` | `yaml` | Format the output. Values: [yaml \| json] | +| `--format` | `string` | | Format the output. Values: [yaml \| json] | | `--hash` | `string` | | Print the service config hash, one per line. | | `--images` | `bool` | | Print the image names, one per line. | +| `--lock-image-digests` | `bool` | | Produces an override file with image digests | +| `--models` | `bool` | | Print the model names, one per line. | +| `--networks` | `bool` | | Print the network names, one per line. | | `--no-consistency` | `bool` | | Don't check model consistency - warning: may produce invalid Compose output | | `--no-env-resolution` | `bool` | | Don't resolve service env files | | `--no-interpolate` | `bool` | | Don't interpolate environment variables | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_cp.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_cp.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_cp.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_cp.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_create.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_create.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_create.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_create.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_down.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_down.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_down.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_down.md diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_events.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_events.md new file mode 100644 index 000000000000..066b5cf3831c --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_events.md @@ -0,0 +1,56 @@ +# docker compose events + +<!---MARKER_GEN_START--> +Stream container events for every container in the project. + +With the `--json` flag, a json object is printed one per line with the format: + +```json +{ + "time": "2015-11-20T18:01:03.615550", + "type": "container", + "action": "create", + "id": "213cf7...5fc39a", + "service": "web", + "attributes": { + "name": "application_web_1", + "image": "alpine:edge" + } +} +``` + +The events that can be received using this can be seen [here](/reference/cli/docker/system/events/#object-types). + +### Options + +| Name | Type | Default | Description | +|:------------|:---------|:--------|:------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `--json` | `bool` | | Output events as a stream of json objects | +| `--since` | `string` | | Show all events created since timestamp | +| `--until` | `string` | | Stream events until this timestamp | + + +<!---MARKER_GEN_END--> + +## Description + +Stream container events for every container in the project. + +With the `--json` flag, a json object is printed one per line with the format: + +```json +{ + "time": "2015-11-20T18:01:03.615550", + "type": "container", + "action": "create", + "id": "213cf7...5fc39a", + "service": "web", + "attributes": { + "name": "application_web_1", + "image": "alpine:edge" + } +} +``` + +The events that can be received using this can be seen [here](https://docs.docker.com/reference/cli/docker/system/events/#object-types). diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_exec.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_exec.md new file mode 100644 index 000000000000..2312b101b911 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_exec.md @@ -0,0 +1,42 @@ +# docker compose exec + +<!---MARKER_GEN_START--> +This is the equivalent of `docker exec` targeting a Compose service. + +With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so +you can use a command such as `docker compose exec web sh` to get an interactive prompt. + +By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec` +command requires passing `--interactive --tty` flags to get the same behavior. Compose also supports those two flags +to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to +force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside +a script. + +### Options + +| Name | Type | Default | Description | +|:------------------|:--------------|:--------|:---------------------------------------------------------------------------------| +| `-d`, `--detach` | `bool` | | Detached mode: Run command in the background | +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `-e`, `--env` | `stringArray` | | Set environment variables | +| `--index` | `int` | `0` | Index of the container if service has multiple replicas | +| `-T`, `--no-tty` | `bool` | `true` | Disable pseudo-TTY allocation. By default 'docker compose exec' allocates a TTY. | +| `--privileged` | `bool` | | Give extended privileges to the process | +| `-u`, `--user` | `string` | | Run the command as this user | +| `-w`, `--workdir` | `string` | | Path to workdir directory for this command | + + +<!---MARKER_GEN_END--> + +## Description + +This is the equivalent of `docker exec` targeting a Compose service. + +With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so +you can use a command such as `docker compose exec web sh` to get an interactive prompt. + +By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec` +command requires passing `--interactive --tty` flags to get the same behavior. Compose also supports those two flags +to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to +force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside +a script. diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_export.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_export.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_export.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_export.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_images.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_images.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_images.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_images.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_kill.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_kill.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_kill.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_kill.md diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_logs.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_logs.md new file mode 100644 index 000000000000..bcbb39e20810 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_logs.md @@ -0,0 +1,25 @@ +# docker compose logs + +<!---MARKER_GEN_START--> +Displays log output from services + +### Options + +| Name | Type | Default | Description | +|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------|:--------|:-----------------------------------------------------------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| [`-f`](https://docs.docker.com/reference/cli/docker/container/logs/#follow), [`--follow`](https://docs.docker.com/reference/cli/docker/container/logs/#follow) | `bool` | | Follow log output | +| `--index` | `int` | `0` | index of the container if service has multiple replicas | +| `--no-color` | `bool` | | Produce monochrome output | +| `--no-log-prefix` | `bool` | | Don't print prefix in logs | +| [`--since`](https://docs.docker.com/reference/cli/docker/container/logs/#since) | `string` | | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | +| [`-n`](https://docs.docker.com/reference/cli/docker/container/logs/#tail), [`--tail`](https://docs.docker.com/reference/cli/docker/container/logs/#tail) | `string` | `all` | Number of lines to show from the end of the logs for each container | +| [`-t`](https://docs.docker.com/reference/cli/docker/container/logs/#timestamps), [`--timestamps`](https://docs.docker.com/reference/cli/docker/container/logs/#timestamps) | `bool` | | Show timestamps | +| [`--until`](https://docs.docker.com/reference/cli/docker/container/logs/#until) | `string` | | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | + + +<!---MARKER_GEN_END--> + +## Description + +Displays log output from services diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_ls.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_ls.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_ls.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_ls.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_pause.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_pause.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_pause.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_pause.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_port.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_port.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_port.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_port.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_ps.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_ps.md similarity index 85% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_ps.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_ps.md index 3572c5305568..54305e2157a1 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_ps.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_ps.md @@ -61,50 +61,50 @@ example-bar-1 alpine "/entrypoint.…" bar 4 seconds ago exited By default, the `docker compose ps` command uses a table ("pretty") format to show the containers. The `--format` flag allows you to specify alternative presentations for the output. Currently, supported options are `pretty` (default), -and `json`, which outputs information about the containers as a JSON array: +and `json`, which outputs information about the containers as JSON Lines +(one JSON object per line), aligned with the output of `docker ps --format json`: ```console $ docker compose ps --format json -[{"ID":"1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a","Name":"example-bar-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"bar","State":"exited","Health":"","ExitCode":0,"Publishers":null},{"ID":"f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0","Name":"example-foo-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"foo","State":"running","Health":"","ExitCode":0,"Publishers":[{"URL":"0.0.0.0","TargetPort":80,"PublishedPort":8080,"Protocol":"tcp"}]}] +{"ID":"1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a","Name":"example-bar-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"bar","State":"exited","Health":"","ExitCode":0,"Publishers":null} +{"ID":"f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0","Name":"example-foo-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"foo","State":"running","Health":"","ExitCode":0,"Publishers":[{"URL":"0.0.0.0","TargetPort":80,"PublishedPort":8080,"Protocol":"tcp"}]} ``` The JSON output allows you to use the information in other tools for further processing, for example, using the [`jq` utility](https://stedolan.github.io/jq/) -to pretty-print the JSON: +to pretty-print each object: ```console $ docker compose ps --format json | jq . -[ - { - "ID": "1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a", - "Name": "example-bar-1", - "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", - "Project": "example", - "Service": "bar", - "State": "exited", - "Health": "", - "ExitCode": 0, - "Publishers": null - }, - { - "ID": "f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0", - "Name": "example-foo-1", - "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", - "Project": "example", - "Service": "foo", - "State": "running", - "Health": "", - "ExitCode": 0, - "Publishers": [ - { - "URL": "0.0.0.0", - "TargetPort": 80, - "PublishedPort": 8080, - "Protocol": "tcp" - } - ] - } -] +{ + "ID": "1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a", + "Name": "example-bar-1", + "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", + "Project": "example", + "Service": "bar", + "State": "exited", + "Health": "", + "ExitCode": 0, + "Publishers": null +} +{ + "ID": "f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0", + "Name": "example-foo-1", + "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", + "Project": "example", + "Service": "foo", + "State": "running", + "Health": "", + "ExitCode": 0, + "Publishers": [ + { + "URL": "0.0.0.0", + "TargetPort": 80, + "PublishedPort": 8080, + "Protocol": "tcp" + } + ] +} ``` ### <a name="status"></a> Filter containers by status (--status) diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_publish.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_publish.md similarity index 88% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_publish.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_publish.md index 8e5d181336b2..9a82fc260a73 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_publish.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_publish.md @@ -7,6 +7,7 @@ Publish compose application | Name | Type | Default | Description | |:--------------------------|:---------|:--------|:-------------------------------------------------------------------------------| +| `--app` | `bool` | | Published compose application (includes referenced images) | | `--dry-run` | `bool` | | Execute command in dry run mode | | `--oci-version` | `string` | | OCI image/artifact specification version (automatically determined by default) | | `--resolve-image-digests` | `bool` | | Pin image tags to digests | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_pull.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_pull.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_pull.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_pull.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_push.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_push.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_push.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_push.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_restart.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_restart.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_restart.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_restart.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_rm.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_rm.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_rm.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_rm.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_run.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_run.md similarity index 99% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_run.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_run.md index 25b28d1ded85..14fb85479266 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_run.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_run.md @@ -70,8 +70,8 @@ specified in the service configuration. | `-i`, `--interactive` | `bool` | `true` | Keep STDIN open even if not attached | | `-l`, `--label` | `stringArray` | | Add or override a label | | `--name` | `string` | | Assign a name to the container | -| `-T`, `--no-TTY` | `bool` | `true` | Disable pseudo-TTY allocation (default: auto-detected) | | `--no-deps` | `bool` | | Don't start linked services | +| `-T`, `--no-tty` | `bool` | `true` | Disable pseudo-TTY allocation (default: auto-detected) | | `-p`, `--publish` | `stringArray` | | Publish a container's port(s) to the host | | `--pull` | `string` | `policy` | Pull image before running ("always"\|"missing"\|"never") | | `-q`, `--quiet` | `bool` | | Don't print anything to STDOUT | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_scale.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_scale.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_scale.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_scale.md diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_start.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_start.md new file mode 100644 index 000000000000..06229e5940ef --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_start.md @@ -0,0 +1,19 @@ +# docker compose start + +<!---MARKER_GEN_START--> +Starts existing containers for a service + +### Options + +| Name | Type | Default | Description | +|:-----------------|:-------|:--------|:---------------------------------------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `--wait` | `bool` | | Wait for services to be running\|healthy. Implies detached mode. | +| `--wait-timeout` | `int` | `0` | Maximum duration in seconds to wait for the project to be running\|healthy | + + +<!---MARKER_GEN_END--> + +## Description + +Starts existing containers for a service diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_stats.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_stats.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_stats.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_stats.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_stop.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_stop.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_stop.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_stop.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_top.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_top.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_top.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_top.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_unpause.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_unpause.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_unpause.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_unpause.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_up.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_up.md similarity index 97% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_up.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_up.md index b831cb16d342..b7f17a0fac91 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/compose_up.md +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_up.md @@ -44,6 +44,7 @@ If the process is interrupted using `SIGINT` (ctrl + C) or `SIGTERM`, the contai | `--no-recreate` | `bool` | | If containers already exist, don't recreate them. Incompatible with --force-recreate. | | `--no-start` | `bool` | | Don't start the services after creating them | | `--pull` | `string` | `policy` | Pull image before running ("always"\|"missing"\|"never") | +| `--quiet-build` | `bool` | | Suppress the build output | | `--quiet-pull` | `bool` | | Pull without printing progress information | | `--remove-orphans` | `bool` | | Remove containers for services not defined in the Compose file | | `-V`, `--renew-anon-volumes` | `bool` | | Recreate anonymous volumes instead of retrieving data from the previous containers | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_version.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_version.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_version.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_version.md diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/compose_volumes.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_volumes.md new file mode 100644 index 000000000000..6bad874f187b --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/compose_volumes.md @@ -0,0 +1,16 @@ +# docker compose volumes + +<!---MARKER_GEN_START--> +List volumes + +### Options + +| Name | Type | Default | Description | +|:----------------|:---------|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--dry-run` | `bool` | | Execute command in dry run mode | +| `--format` | `string` | `table` | Format output using a custom template:<br>'table': Print output in table format with column headers (default)<br>'table TEMPLATE': Print output in table format using the given Go template<br>'json': Print in JSON format<br>'TEMPLATE': Print output using the given Go template.<br>Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates | +| `-q`, `--quiet` | `bool` | | Only display volume names | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_wait.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_wait.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_wait.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_wait.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/compose_watch.md b/_vendor/github.com/docker/compose/v5/docs/reference/compose_watch.md similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/compose_watch.md rename to _vendor/github.com/docker/compose/v5/docs/reference/compose_watch.md diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose.yaml similarity index 87% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose.yaml index 58ec47802a55..c5fdb9375105 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose.yaml @@ -6,6 +6,7 @@ pname: docker plink: docker.yaml cname: - docker compose attach + - docker compose bridge - docker compose build - docker compose commit - docker compose config @@ -36,10 +37,12 @@ cname: - docker compose unpause - docker compose up - docker compose version + - docker compose volumes - docker compose wait - docker compose watch clink: - docker_compose_attach.yaml + - docker_compose_bridge.yaml - docker_compose_build.yaml - docker_compose_commit.yaml - docker_compose_config.yaml @@ -70,6 +73,7 @@ clink: - docker_compose_unpause.yaml - docker_compose_up.yaml - docker_compose_version.yaml + - docker_compose_volumes.yaml - docker_compose_wait.yaml - docker_compose_watch.yaml options: @@ -135,6 +139,17 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: insecure-registry + value_type: stringArray + default_value: '[]' + description: | + Use insecure registry to pull Compose OCI artifacts. Doesn't apply to images + deprecated: false + hidden: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: no-ansi value_type: bool default_value: "false" @@ -167,7 +182,6 @@ options: swarm: false - option: progress value_type: string - default_value: auto description: Set type of progress output (auto, tty, plain, json, quiet) deprecated: false hidden: false @@ -287,6 +301,57 @@ examples: |- $ docker compose -f ~/sandbox/rails/compose.yaml pull db ``` + #### Using an OCI published artifact + You can use the `-f` flag with the `oci://` prefix to reference a Compose file that has been published to an OCI registry. + This allows you to distribute and version your Compose configurations as OCI artifacts. + + To use a Compose file from an OCI registry: + + ```console + $ docker compose -f oci://registry.example.com/my-compose-project:latest up + ``` + + You can also combine OCI artifacts with local files: + + ```console + $ docker compose -f oci://registry.example.com/my-compose-project:v1.0 -f compose.override.yaml up + ``` + + The OCI artifact must contain a valid Compose file. You can publish Compose files to an OCI registry using the + `docker compose publish` command. + + #### Using a git repository + You can use the `-f` flag to reference a Compose file from a git repository. Compose supports various git URL formats: + + Using HTTPS: + ```console + $ docker compose -f https://github.com/user/repo.git up + ``` + + Using SSH: + ```console + $ docker compose -f git@github.com:user/repo.git up + ``` + + You can specify a specific branch, tag, or commit: + ```console + $ docker compose -f https://github.com/user/repo.git@main up + $ docker compose -f https://github.com/user/repo.git@v1.0.0 up + $ docker compose -f https://github.com/user/repo.git@abc123 up + ``` + + You can also specify a subdirectory within the repository: + ```console + $ docker compose -f https://github.com/user/repo.git#main:path/to/compose.yaml up + ``` + + When using git resources, Compose will clone the repository and use the specified Compose file. You can combine + git resources with local files: + + ```console + $ docker compose -f https://github.com/user/repo.git -f compose.override.yaml up + ``` + ### Use `-p` to specify a project name Each configuration has a project name. Compose sets the project name using diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_dry-run.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_dry-run.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_dry-run.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_dry-run.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_generate.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_generate.yaml similarity index 99% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_generate.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_generate.yaml index 0932af080ecc..f31429c2d725 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_generate.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_generate.yaml @@ -45,7 +45,7 @@ inherited_options: kubernetes: false swarm: false deprecated: false -hidden: false +hidden: true experimental: false experimentalcli: true kubernetes: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_publish.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_publish.yaml similarity index 75% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_publish.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_publish.yaml index 1566677472ae..9059cbf48695 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_publish.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_publish.yaml @@ -5,6 +5,26 @@ usage: docker compose alpha publish [OPTIONS] REPOSITORY[:TAG] pname: docker compose alpha plink: docker_compose_alpha.yaml options: + - option: app + value_type: bool + default_value: "false" + description: Published compose application (includes referenced images) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: insecure-registry + value_type: bool + default_value: "false" + description: Use insecure registry + deprecated: false + hidden: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: oci-version value_type: string description: | @@ -58,7 +78,7 @@ inherited_options: kubernetes: false swarm: false deprecated: false -hidden: false +hidden: true experimental: false experimentalcli: true kubernetes: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_scale.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_scale.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_scale.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_scale.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_viz.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_viz.yaml similarity index 99% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_viz.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_viz.yaml index b179d648ef83..c07475caac8a 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_viz.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_viz.yaml @@ -69,7 +69,7 @@ inherited_options: kubernetes: false swarm: false deprecated: false -hidden: false +hidden: true experimental: false experimentalcli: true kubernetes: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_watch.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_watch.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_alpha_watch.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_alpha_watch.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_attach.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_attach.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_attach.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_attach.yaml diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge.yaml new file mode 100644 index 000000000000..5ef9ebf55850 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge.yaml @@ -0,0 +1,29 @@ +command: docker compose bridge +short: Convert compose files into another model +long: Convert compose files into another model +pname: docker compose +plink: docker_compose.yaml +cname: + - docker compose bridge convert + - docker compose bridge transformations +clink: + - docker_compose_bridge_convert.yaml + - docker_compose_bridge_transformations.yaml +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_convert.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_convert.yaml new file mode 100644 index 000000000000..f55f0b233c3c --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_convert.yaml @@ -0,0 +1,59 @@ +command: docker compose bridge convert +short: | + Convert compose files to Kubernetes manifests, Helm charts, or another model +long: | + Convert compose files to Kubernetes manifests, Helm charts, or another model +usage: docker compose bridge convert +pname: docker compose bridge +plink: docker_compose_bridge.yaml +options: + - option: output + shorthand: o + value_type: string + default_value: out + description: The output directory for the Kubernetes resources + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: templates + value_type: string + description: Directory containing transformation templates + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: transformation + shorthand: t + value_type: stringArray + default_value: '[]' + description: | + Transformation to apply to compose model (default: docker/compose-bridge-kubernetes) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations.yaml new file mode 100644 index 000000000000..2ab5661f0b2a --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations.yaml @@ -0,0 +1,29 @@ +command: docker compose bridge transformations +short: Manage transformation images +long: Manage transformation images +pname: docker compose bridge +plink: docker_compose_bridge.yaml +cname: + - docker compose bridge transformations create + - docker compose bridge transformations list +clink: + - docker_compose_bridge_transformations_create.yaml + - docker_compose_bridge_transformations_list.yaml +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_create.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_create.yaml new file mode 100644 index 000000000000..e8dd9e58a51e --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_create.yaml @@ -0,0 +1,36 @@ +command: docker compose bridge transformations create +short: Create a new transformation +long: Create a new transformation +usage: docker compose bridge transformations create [OPTION] PATH +pname: docker compose bridge transformations +plink: docker_compose_bridge_transformations.yaml +options: + - option: from + shorthand: f + value_type: string + description: | + Existing transformation to copy (default: docker/compose-bridge-kubernetes) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_list.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_list.yaml new file mode 100644 index 000000000000..3afd3a84b8e7 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_bridge_transformations_list.yaml @@ -0,0 +1,47 @@ +command: docker compose bridge transformations list +aliases: docker compose bridge transformations list, docker compose bridge transformations ls +short: List available transformations +long: List available transformations +usage: docker compose bridge transformations list +pname: docker compose bridge transformations +plink: docker_compose_bridge_transformations.yaml +options: + - option: format + value_type: string + default_value: table + description: 'Format the output. Values: [table | json]' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display transformer names + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_build.yaml similarity index 87% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_build.yaml index 3f53dcf73628..e645a40aac21 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_build.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_build.yaml @@ -33,6 +33,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: check + value_type: bool + default_value: "false" + description: Check build configuration + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: compress value_type: bool default_value: "true" @@ -108,7 +118,6 @@ options: swarm: false - option: progress value_type: string - default_value: auto description: Set type of ui output (auto, tty, plain, json, quiet) deprecated: false hidden: true @@ -116,6 +125,15 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: provenance + value_type: string + description: Add a provenance attestation + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: pull value_type: bool default_value: "false" @@ -140,7 +158,16 @@ options: shorthand: q value_type: bool default_value: "false" - description: Don't print anything to STDOUT + description: Suppress the build output + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: sbom + value_type: string + description: Add a SBOM attestation deprecated: false hidden: false experimental: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_commit.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_commit.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_commit.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_commit.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_config.yaml similarity index 86% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_config.yaml index 15b1e7dc3989..3efc922b219e 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_config.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_config.yaml @@ -1,5 +1,4 @@ command: docker compose config -aliases: docker compose config, docker compose convert short: Parse, resolve and render compose file in canonical format long: |- `docker compose config` renders the actual data model to be applied on the Docker Engine. @@ -21,7 +20,6 @@ options: swarm: false - option: format value_type: string - default_value: yaml description: 'Format the output. Values: [yaml | json]' deprecated: false hidden: false @@ -48,6 +46,36 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: lock-image-digests + value_type: bool + default_value: "false" + description: Produces an override file with image digests + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: models + value_type: bool + default_value: "false" + description: Print the model names, one per line. + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: networks + value_type: bool + default_value: "false" + description: Print the network names, one per line. + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: no-consistency value_type: bool default_value: "false" diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_convert.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_convert.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_convert.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_convert.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_cp.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_cp.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_cp.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_cp.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_create.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_create.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_create.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_create.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_down.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_down.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_down.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_down.yaml diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_events.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_events.yaml new file mode 100644 index 000000000000..7c4cb4297f97 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_events.yaml @@ -0,0 +1,72 @@ +command: docker compose events +short: Receive real time events from containers +long: |- + Stream container events for every container in the project. + + With the `--json` flag, a json object is printed one per line with the format: + + ```json + { + "time": "2015-11-20T18:01:03.615550", + "type": "container", + "action": "create", + "id": "213cf7...5fc39a", + "service": "web", + "attributes": { + "name": "application_web_1", + "image": "alpine:edge" + } + } + ``` + + The events that can be received using this can be seen [here](/reference/cli/docker/system/events/#object-types). +usage: docker compose events [OPTIONS] [SERVICE...] +pname: docker compose +plink: docker_compose.yaml +options: + - option: json + value_type: bool + default_value: "false" + description: Output events as a stream of json objects + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: since + value_type: string + description: Show all events created since timestamp + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: until + value_type: string + description: Stream events until this timestamp + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_exec.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_exec.yaml similarity index 84% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_exec.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_exec.yaml index b2a1cf20685f..a76b8259049d 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_exec.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_exec.yaml @@ -5,6 +5,12 @@ long: |- With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so you can use a command such as `docker compose exec web sh` to get an interactive prompt. + + By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent `docker exec` + command requires passing `--interactive --tty` flags to get the same behavior. Compose also supports those two flags + to offer a smooth migration between commands, whenever they are no-op by default. Still, `interactive` can be used to + force disabling interactive mode (`--interactive=false`), typically when `docker compose exec` command is used inside + a script. usage: docker compose exec [OPTIONS] SERVICE COMMAND [ARGS...] pname: docker compose plink: docker_compose.yaml @@ -52,12 +58,12 @@ options: experimentalcli: false kubernetes: false swarm: false - - option: no-TTY + - option: no-tty shorthand: T value_type: bool default_value: "true" description: | - Disable pseudo-TTY allocation. By default `docker compose exec` allocates a TTY. + Disable pseudo-TTY allocation. By default 'docker compose exec' allocates a TTY. deprecated: false hidden: false experimental: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_export.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_export.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_export.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_export.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_images.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_images.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_images.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_images.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_kill.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_kill.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_kill.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_kill.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_logs.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_logs.yaml similarity index 90% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_logs.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_logs.yaml index 92d94dd108cf..6b657ff8cb08 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_logs.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_logs.yaml @@ -10,6 +10,7 @@ options: value_type: bool default_value: "false" description: Follow log output + details_url: /reference/cli/docker/container/logs/#follow deprecated: false hidden: false experimental: false @@ -50,6 +51,7 @@ options: value_type: string description: | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) + details_url: /reference/cli/docker/container/logs/#since deprecated: false hidden: false experimental: false @@ -62,6 +64,7 @@ options: default_value: all description: | Number of lines to show from the end of the logs for each container + details_url: /reference/cli/docker/container/logs/#tail deprecated: false hidden: false experimental: false @@ -73,6 +76,7 @@ options: value_type: bool default_value: "false" description: Show timestamps + details_url: /reference/cli/docker/container/logs/#timestamps deprecated: false hidden: false experimental: false @@ -83,6 +87,7 @@ options: value_type: string description: | Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) + details_url: /reference/cli/docker/container/logs/#until deprecated: false hidden: false experimental: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_ls.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_ls.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_ls.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_ls.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_pause.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_pause.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_pause.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_pause.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_port.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_port.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_port.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_port.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_ps.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_ps.yaml similarity index 80% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_ps.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_ps.yaml index d03702756954..9f8d4ba447a9 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_ps.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_ps.yaml @@ -130,50 +130,50 @@ examples: |- By default, the `docker compose ps` command uses a table ("pretty") format to show the containers. The `--format` flag allows you to specify alternative presentations for the output. Currently, supported options are `pretty` (default), - and `json`, which outputs information about the containers as a JSON array: + and `json`, which outputs information about the containers as JSON Lines + (one JSON object per line), aligned with the output of `docker ps --format json`: ```console $ docker compose ps --format json - [{"ID":"1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a","Name":"example-bar-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"bar","State":"exited","Health":"","ExitCode":0,"Publishers":null},{"ID":"f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0","Name":"example-foo-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"foo","State":"running","Health":"","ExitCode":0,"Publishers":[{"URL":"0.0.0.0","TargetPort":80,"PublishedPort":8080,"Protocol":"tcp"}]}] + {"ID":"1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a","Name":"example-bar-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"bar","State":"exited","Health":"","ExitCode":0,"Publishers":null} + {"ID":"f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0","Name":"example-foo-1","Command":"/docker-entrypoint.sh nginx -g 'daemon off;'","Project":"example","Service":"foo","State":"running","Health":"","ExitCode":0,"Publishers":[{"URL":"0.0.0.0","TargetPort":80,"PublishedPort":8080,"Protocol":"tcp"}]} ``` The JSON output allows you to use the information in other tools for further processing, for example, using the [`jq` utility](https://stedolan.github.io/jq/) - to pretty-print the JSON: + to pretty-print each object: ```console $ docker compose ps --format json | jq . - [ - { - "ID": "1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a", - "Name": "example-bar-1", - "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", - "Project": "example", - "Service": "bar", - "State": "exited", - "Health": "", - "ExitCode": 0, - "Publishers": null - }, - { - "ID": "f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0", - "Name": "example-foo-1", - "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", - "Project": "example", - "Service": "foo", - "State": "running", - "Health": "", - "ExitCode": 0, - "Publishers": [ - { - "URL": "0.0.0.0", - "TargetPort": 80, - "PublishedPort": 8080, - "Protocol": "tcp" - } - ] - } - ] + { + "ID": "1553b0236cf4d2715845f053a4ee97042c4f9a2ef655731ee34f1f7940eaa41a", + "Name": "example-bar-1", + "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", + "Project": "example", + "Service": "bar", + "State": "exited", + "Health": "", + "ExitCode": 0, + "Publishers": null + } + { + "ID": "f02a4efaabb67416e1ff127d51c4b5578634a0ad5743bd65225ff7d1909a3fa0", + "Name": "example-foo-1", + "Command": "/docker-entrypoint.sh nginx -g 'daemon off;'", + "Project": "example", + "Service": "foo", + "State": "running", + "Health": "", + "ExitCode": 0, + "Publishers": [ + { + "URL": "0.0.0.0", + "TargetPort": 80, + "PublishedPort": 8080, + "Protocol": "tcp" + } + ] + } ``` ### Filter containers by status (--status) {#status} diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_publish.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_publish.yaml similarity index 76% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_publish.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_publish.yaml index 44a7a46dd421..c3189d89c573 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_publish.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_publish.yaml @@ -5,6 +5,26 @@ usage: docker compose publish [OPTIONS] REPOSITORY[:TAG] pname: docker compose plink: docker_compose.yaml options: + - option: app + value_type: bool + default_value: "false" + description: Published compose application (includes referenced images) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: insecure-registry + value_type: bool + default_value: "false" + description: Use insecure registry + deprecated: false + hidden: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: oci-version value_type: string description: | diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_pull.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_pull.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_pull.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_pull.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_push.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_push.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_push.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_push.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_restart.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_restart.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_restart.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_restart.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_rm.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_rm.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_rm.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_rm.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_run.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_run.yaml similarity index 99% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_run.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_run.yaml index 61c7ca0e8cbc..bc9f81e9ed0a 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_run.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_run.yaml @@ -158,21 +158,21 @@ options: experimentalcli: false kubernetes: false swarm: false - - option: no-TTY - shorthand: T + - option: no-deps value_type: bool - default_value: "true" - description: 'Disable pseudo-TTY allocation (default: auto-detected)' + default_value: "false" + description: Don't start linked services deprecated: false hidden: false experimental: false experimentalcli: false kubernetes: false swarm: false - - option: no-deps + - option: no-tty + shorthand: T value_type: bool - default_value: "false" - description: Don't start linked services + default_value: "true" + description: 'Disable pseudo-TTY allocation (default: auto-detected)' deprecated: false hidden: false experimental: false diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_scale.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_scale.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_scale.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_scale.yaml diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_start.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_start.yaml new file mode 100644 index 000000000000..56f9bcdff7c8 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_start.yaml @@ -0,0 +1,46 @@ +command: docker compose start +short: Start services +long: Starts existing containers for a service +usage: docker compose start [SERVICE...] +pname: docker compose +plink: docker_compose.yaml +options: + - option: wait + value_type: bool + default_value: "false" + description: Wait for services to be running|healthy. Implies detached mode. + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: wait-timeout + value_type: int + default_value: "0" + description: | + Maximum duration in seconds to wait for the project to be running|healthy + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_stats.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_stats.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_stats.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_stats.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_stop.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_stop.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_stop.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_stop.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_top.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_top.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_top.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_top.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_unpause.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_unpause.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_unpause.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_unpause.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_up.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_up.yaml similarity index 97% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_up.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_up.yaml index 47e0c5259ebb..8c78a8fa683e 100644 --- a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_up.yaml +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_up.yaml @@ -211,6 +211,16 @@ options: experimentalcli: false kubernetes: false swarm: false + - option: quiet-build + value_type: bool + default_value: "false" + description: Suppress the build output + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false - option: quiet-pull value_type: bool default_value: "false" diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_version.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_version.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_version.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_version.yaml diff --git a/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_volumes.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_volumes.yaml new file mode 100644 index 000000000000..20516db7f137 --- /dev/null +++ b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_volumes.yaml @@ -0,0 +1,52 @@ +command: docker compose volumes +short: List volumes +long: List volumes +usage: docker compose volumes [OPTIONS] [SERVICE...] +pname: docker compose +plink: docker_compose.yaml +options: + - option: format + value_type: string + default_value: table + description: |- + Format output using a custom template: + 'table': Print output in table format with column headers (default) + 'table TEMPLATE': Print output in table format using the given Go template + 'json': Print in JSON format + 'TEMPLATE': Print output using the given Go template. + Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display volume names + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: dry-run + value_type: bool + default_value: "false" + description: Execute command in dry run mode + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_wait.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_wait.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_wait.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_wait.yaml diff --git a/_vendor/github.com/docker/compose/v2/docs/reference/docker_compose_watch.yaml b/_vendor/github.com/docker/compose/v5/docs/reference/docker_compose_watch.yaml similarity index 100% rename from _vendor/github.com/docker/compose/v2/docs/reference/docker_compose_watch.yaml rename to _vendor/github.com/docker/compose/v5/docs/reference/docker_compose_watch.yaml diff --git a/_vendor/github.com/docker/docker-agent/docs/community/_index.md b/_vendor/github.com/docker/docker-agent/docs/community/_index.md new file mode 100644 index 000000000000..764483d9718c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/community/_index.md @@ -0,0 +1,5 @@ +--- +title: "Community" +description: "Contributing, troubleshooting, and telemetry." +weight: 80 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/community/contributing/index.md b/_vendor/github.com/docker/docker-agent/docs/community/contributing/index.md new file mode 100644 index 000000000000..302997a137dc --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/community/contributing/index.md @@ -0,0 +1,131 @@ +--- +title: "Contributing" +description: "Docker Agent is open source. Here's how to set up your development environment and contribute." +keywords: docker agent, ai agents, community, contributing +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/community/contributing/ +--- + +_Docker Agent is open source. Here's how to set up your development environment and contribute._ + +## Development Setup + +### Prerequisites + +- [Go 1.26](https://go.dev/dl/) or higher +- API key(s) for your chosen AI provider +- [Task](https://taskfile.dev/installation/) +- [golangci-lint](https://golangci-lint.run/docs/welcome/install/local/) + +> [!NOTE] +> **Platform Support** +> +> macOS and Linux are fully supported for development. On Windows, use `task build-local` to build via Docker. + +### Build from Source + +```bash +# Clone and build +git clone https://github.com/docker/docker-agent.git +cd docker-agent +task build + +# Set API keys +export OPENAI_API_KEY=your_key_here +export ANTHROPIC_API_KEY=your_key_here + +# Run an example +./bin/docker-agent run examples/code.yaml +``` + +### Development Commands + +| Command | Description | +| ------------------ | ----------------------------------------------- | +| `task build` | Build the binary to `./bin/docker-agent` | +| `task test` | Run all tests (clears API keys for determinism) | +| `task lint` | Run golangci-lint | +| `task format` | Format code | +| `task dev` | Run lint, test, and build in sequence | +| `task build-local` | Build for local platform via Docker | +| `task cross` | Cross-platform builds (all architectures) | + +## Dogfooding + +Use Docker Agent to work on Docker Agent! The project includes a specialized developer agent: + +```bash +cd docker-agent +docker agent run ./golang_developer.yaml +``` + +This agent is an expert Go developer that understands the Docker Agent codebase. Ask it questions, request fixes, or have it implement features. + +## Core Concepts + +- **Root Agent** — Main entry point that coordinates the system +- **Sub-Agents** — Specialized agents for specific domains +- **Tools** — External capabilities via MCP +- **Models** — AI provider configurations + +## Code Style + +The project uses `golangci-lint` with strict rules. As long as `task lint` passes, the code is stylistically acceptable. + +Key conventions: + +- Use `fmt.Errorf("context: %w", err)` for error wrapping +- Always pass `context.Context` as the first parameter +- Use `slog` for structured logging +- Use functional options pattern for constructors +- In tests: use `t.Context()`, `t.TempDir()`, `t.Setenv()`, and `t.Parallel()` + +## Opening Issues + +File issues on the [GitHub issue tracker](https://github.com/docker/docker-agent/issues). Please: + +> [!NOTE] +> **See also** +> +> [Troubleshooting](../troubleshooting/index.md) — Common issues and debug mode. [Telemetry](../telemetry/index.md) — What data is collected and how to opt out. + +- Use the included issue template +- Search for existing issues before creating new ones +- Only use issues for bugs and feature requests (not support) + +## Submitting Pull Requests + +1. **Fork** the repository and create a branch for your changes +2. **Write** your code following the style and testing guidelines above +3. **Test** your changes: run `task lint` and `task test` +4. **Sign** your commits with `git commit -s` (DCO required) +5. **Open a pull request** against the `main` branch + +> [!TIP] +> Use the dogfooding agent (`docker agent run ./golang_developer.yaml`) to help write and review your changes before submitting. + +## Sign Your Work + +All contributions require a Developer Certificate of Origin (DCO) sign-off: + +```bash +# Sign commits automatically +git config user.name "Your Name" +git config user.email "your.email@example.com" +git commit -s -m "Your commit message" +``` + +## Community + +Find us on [Slack](https://dockercommunity.slack.com/archives/C09DASHHRU4) for questions and discussions. + +## Code of Conduct + +We want to keep the Docker Agent community welcoming, inclusive, and collaborative. Key guidelines: + +- **Be nice** — Be courteous, respectful, and polite. No abuse of any kind will be tolerated. +- **Encourage diversity** — Make everyone feel welcome regardless of background. +- **Keep it legal** — Share only content you own and don't break the law. +- **Stay on topic** — Post to the correct channel and avoid off-topic discussions. + +The governance for this repository is handled by Docker Inc. diff --git a/_vendor/github.com/docker/docker-agent/docs/community/opentelemetry/index.md b/_vendor/github.com/docker/docker-agent/docs/community/opentelemetry/index.md new file mode 100644 index 000000000000..ae6b3c9a1304 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/community/opentelemetry/index.md @@ -0,0 +1,99 @@ +--- +title: "OpenTelemetry Tracing" +description: "Export Docker Agent traces to any OTLP backend, including Langfuse and LangSmith, for debugging agentic workflows." +keywords: docker agent, ai agents, community, opentelemetry tracing +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/community/opentelemetry/ +--- + +_Docker Agent can export OpenTelemetry traces of an agent run to any OTLP/HTTP backend. This is separate from [product-analytics telemetry](../telemetry/index.md) and is opt-in via the `--otel` flag._ + +When enabled, Docker Agent emits OpenTelemetry GenAI (`gen_ai.*`) and MCP (`mcp.*`) spans following the [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/). Spans cover the agent turn, model calls (with token usage and cost attributes), tool calls, MCP client/server activity, sub-agent hand-offs, and provider fallbacks. W3C `traceparent` context is propagated so the whole run renders as a single connected trace tree. + +## Enabling + +```bash +docker agent run agent.yaml --otel +``` + +Without an exporter endpoint configured, spans are recorded locally as no-ops. To ship them somewhere, set the standard OTLP environment variables described below. + +## Configuration + +Docker Agent reads the standard OTLP environment variables: + +| Variable | Purpose | +| --- | --- | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | Base OTLP/HTTP endpoint. The signal subpath (`/v1/traces`, `/v1/metrics`, `/v1/logs`) is appended automatically. | +| `OTEL_EXPORTER_OTLP_HEADERS` | Comma-separated `key=value` headers sent with every export request (for example, an `Authorization` header). | +| `OTEL_RESOURCE_ATTRIBUTES` | Extra resource attributes merged into every span. | +| `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` | Set to `true` to capture prompt and response message content as span attributes. Off by default. | + +> [!NOTE] +> **Base endpoint, not the full signal URL** +> +> Set `OTEL_EXPORTER_OTLP_ENDPOINT` to the **base** endpoint (for example `https://cloud.langfuse.com/api/public/otel`). Docker Agent appends `/v1/traces` for you, matching the value documented by Langfuse and LangSmith. A bare `host:port` is also accepted and gets `https://` (or `http://` for localhost). + +> [!WARNING] +> **Message content can contain sensitive data** +> +> `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` is off by default because chat history routinely contains PII, secrets, and internal documents. Enable it only for backends and environments where exporting that content is acceptable. + +## Backends + +Protocol support is OTLP over HTTP (`http/protobuf`). gRPC endpoints are not currently supported. + +### Langfuse + +[Langfuse](https://langfuse.com) exposes an OTLP endpoint and authenticates with HTTP Basic auth built from a project's public and secret keys. + +```bash +# Base64 of "public_key:secret_key" +LANGFUSE_AUTH=$(echo -n "pk-lf-...:sk-lf-..." | base64) + +export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel" +export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic ${LANGFUSE_AUTH}" + +docker agent run agent.yaml --otel +``` + +Regional and self-hosted hosts use the same `/api/public/otel` base path: + +| Region | Endpoint | +| --- | --- | +| EU | `https://cloud.langfuse.com/api/public/otel` | +| US | `https://us.cloud.langfuse.com/api/public/otel` | +| Self-hosted (>= v3.22.0) | `http://localhost:3000/api/public/otel` | + +### LangSmith + +[LangSmith](https://docs.langchain.com/langsmith/trace-with-opentelemetry) authenticates with an `x-api-key` header (the raw API key, with no `Basic`/`Bearer` prefix). An optional `Langsmith-Project` header routes traces to a named project. + +```bash +export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.smith.langchain.com/otel" +export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your-api-key>,Langsmith-Project=<project>" + +docker agent run agent.yaml --otel +``` + +### OpenTelemetry Collector + +Any OTLP/HTTP collector (the OpenTelemetry Collector, Grafana Alloy, Jaeger, and so on) works by pointing at its base endpoint: + +```bash +export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318" +docker agent run agent.yaml --otel +``` + +> [!NOTE] +> **Langfuse and LangSmith ingest traces only** +> +> Both backends accept the traces signal only. Docker Agent also wires metric and log exporters at the same endpoint, so their periodic exports return `404` against trace-only backends. This is harmless to traces but appears in the debug log. Point a full OTLP collector at the endpoint if you also want metrics and logs. + +## Inspecting traces locally + +Use `--debug` to print telemetry activity to the debug log (`~/.cagent/cagent.debug.log` by default) without standing up a backend: + +```bash +docker agent run agent.yaml --otel --debug +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/community/telemetry/index.md b/_vendor/github.com/docker/docker-agent/docs/community/telemetry/index.md new file mode 100644 index 000000000000..54974db155f8 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/community/telemetry/index.md @@ -0,0 +1,79 @@ +--- +title: "Telemetry" +description: "Docker Agent collects anonymous usage data to help improve the tool. Telemetry can be disabled at any time." +keywords: docker agent, ai agents, community, telemetry +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/community/telemetry/ +--- + +_Docker Agent collects anonymous usage data to help improve the tool. Telemetry can be disabled at any time._ + +On first startup, Docker Agent displays a notice about telemetry collection so you're always informed. All events are processed synchronously when recorded. + +## Disabling Telemetry + +```bash +# Disable via environment variable +$ TELEMETRY_ENABLED=false docker agent run agent.yaml + +# Or export it in your shell profile +$ export TELEMETRY_ENABLED=false +``` + +> [!NOTE] +> **Default** +> +> Telemetry is **enabled by default**. Set `TELEMETRY_ENABLED=false` to opt out. + +## What's Collected ✅ + +- Command names and success/failure status +- Agent names and model types +- Tool names and whether calls succeed or fail +- Token counts (input/output totals) and estimated costs +- Session metadata (durations, error counts) + +## What's NOT Collected ❌ + +- User input or prompts +- Agent responses or generated content +- File contents +- API keys or credentials +- Personally identifying information (PII) + +> [!TIP] +> **See events locally** +> +> Use `--debug` to see telemetry events printed to the debug log without sending them anywhere additional. + +```bash +docker agent run agent.yaml --debug +``` + +## Event Types + +The telemetry system uses structured, type-safe events: + +| Event Type | What It Tracks | +| ----------- | ------------------------------------------------------------------- | +| **Command** | CLI command execution with success status | +| **Tool** | Agent tool calls with timing and error information | +| **Token** | LLM token usage by model, session, and cost | +| **Session** | Agent session lifecycle with start/end events and aggregate metrics | + +## For Developers + +Telemetry is automatically wrapped around all commands. To record additional events, use the context-based API: + +```bash +// Recommended: context-based telemetry (clean, testable) +if telemetryClient := telemetry.FromContext(ctx); telemetryClient != nil { + telemetryClient.RecordToolCall(ctx, "filesystem", "session-id", "agentName", time.Millisecond*500, nil) + telemetryClient.RecordTokenUsage(ctx, "gpt-4", 100, 50, 0.01) +} + +// Or use direct calls +telemetry.TrackCommand("run", args) +``` + +Events are processed synchronously when `Track()` is called, sending HTTP requests immediately. diff --git a/_vendor/github.com/docker/docker-agent/docs/community/troubleshooting/index.md b/_vendor/github.com/docker/docker-agent/docs/community/troubleshooting/index.md new file mode 100644 index 000000000000..1e73169e067b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/community/troubleshooting/index.md @@ -0,0 +1,342 @@ +--- +title: "Troubleshooting" +description: "Common issues and how to resolve them when working with Docker Agent." +keywords: docker agent, ai agents, community, troubleshooting +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/community/troubleshooting/ +--- + +_Common issues and how to resolve them when working with Docker Agent._ + +## Common Errors + +### Context Window Exceeded + +Error message: `context_length_exceeded` or similar. + +- Use `/compact` in the TUI to summarize and reduce conversation history +- Set `num_history_items` in agent config to limit messages sent to the model +- Switch to a model with larger context (Claude Sonnet 4.5 supports 1M tokens, Gemini up to 2M) +- Break large tasks into smaller conversations + +### Max Iterations Reached + +The agent hit its `max_iterations` limit without completing the task. + +- Increase `max_iterations` in agent config (default is unlimited, but many agents set 20-50) +- Check if the agent is stuck in a loop (enable `--debug` to see tool calls) +- Break complex tasks into smaller steps + +### Model Fallback Triggered + +When the primary model fails, Docker Agent automatically switches to fallback models. Look for log messages like `"Switching to fallback model"`. + +- **429 errors:** Rate limited — the cooldown period keeps using the fallback +- **5xx errors:** Server issues — retries with exponential backoff first, then falls back +- **4xx errors:** Client errors — skips directly to next model + +Configure fallback behavior in your agent config: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + fallback: + models: [openai/gpt-5-mini, openai/gpt-4o-mini] + retries: 2 # retries per model for 5xx errors + cooldown: 1m # how long to stick with fallback after 429 +``` + +## Missing credentials or model errors + +When Docker Agent can't find a usable model at startup, it fails fast with an actionable error. The message names the exact next step. `docker agent doctor` is the fastest way to see the full picture — which providers have credentials, whether Docker Model Runner is reachable, and which model `auto` would pick. + +### Required environment variables not set + +An agent (or a tool it uses) depends on environment variables that aren't configured: + +```text +The following environment variables must be set: + - ANTHROPIC_API_KEY + +Provide them using any of these sources: + - Shell environment: export ANTHROPIC_API_KEY=<value> + - Env file: docker agent run --env-from-file <file> ... + - Docker Agent env file: docker agent setup (stores the key in ~/.config/cagent/.env) + +See https://docs.docker.com/ai/docker-agent/guides/secrets/ for details. +``` + +Set the variable through any of the listed [secret sources](../../guides/secrets/index.md). When the missing variable is a model-provider API key, the error also suggests running a local model instead (`docker agent run --model dmr/ai/qwen3 ...`), which needs no API key, and links to the [Set Up a Model](../../getting-started/set-up-a-model/index.md) tutorial. + +### No model available (`auto` selection failed) + +The `auto` model selector found no configured cloud provider and no usable Docker Model Runner model: + +```text +No model is currently available. + +To fix this, you can: + - Pull a Docker Model Runner model, e.g. `docker model pull ai/qwen3` + - Install Docker Model Runner: https://docs.docker.com/ai/model-runner/get-started/ + - Configure an API key for a cloud provider: + - anthropic: ANTHROPIC_API_KEY + - openai: OPENAI_API_KEY + ... +``` + +Either configure a cloud provider API key (see [API keys not set](#api-keys-not-set) below) or pull a local model. The [Set Up a Model](../../getting-started/set-up-a-model/index.md) tutorial walks through both paths. Run `docker agent doctor` to see which providers have credentials and whether Docker Model Runner is reachable. + +### Docker Model Runner model not pulled + +A `dmr/...` model was requested but isn't available locally: + +```text +model ai/qwen3 is not pulled in Docker Model Runner + +To resolve this, you can: + - Pull it first: docker model pull ai/qwen3 + - Or choose a model that is already available (see `docker model ls`). +``` + +If instead you see `cannot query Docker Model Runner at <url>`, Docker Model Runner isn't installed or running — see the [Model Runner get-started guide](https://docs.docker.com/ai/model-runner/get-started/). + +> [!TIP] +> **Diagnose before you run** +> +> Run `docker agent doctor` (or `docker agent doctor ./agent.yaml` to include a file's requirements) to check all three issues in one shot. It exits non-zero when something would block a run, making it useful as a CI preflight. See the [CLI reference](../../features/cli/index.md#docker-agent-doctor). + +## Debug Mode + +The first step for any issue is enabling debug logging. This provides detailed information about what Docker Agent is doing internally. + +```bash +# Enable debug logging (writes to ~/.cagent/cagent.debug.log) +$ docker agent run config.yaml --debug + +# Write debug logs to a custom file +$ docker agent run config.yaml --debug --log-file ./debug.log + +# Enable OpenTelemetry tracing for deeper analysis +$ docker agent run config.yaml --otel +``` + +> [!TIP] +> Always enable `--debug` when reporting issues. The log file contains detailed traces of API calls, tool executions, and agent interactions. + +## Agent Not Responding + +### API keys not set + +Each model provider requires its own API key as an environment variable: + +| Provider | Environment Variable | +| ------------- | --------------------------------------------------- | +| OpenAI | `OPENAI_API_KEY` | +| Anthropic | `ANTHROPIC_API_KEY` | +| Google Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | +| Mistral | `MISTRAL_API_KEY` | +| xAI | `XAI_API_KEY` | +| Nebius | `NEBIUS_API_KEY` | +| MiniMax | `MINIMAX_API_KEY` | +| Requesty | `REQUESTY_API_KEY` | +| OpenRouter | `OPENROUTER_API_KEY` | +| GitHub Copilot | `GITHUB_TOKEN` (PAT with `copilot` scope) | +| Azure OpenAI | `AZURE_API_KEY` (override with `token_key`) | +| AWS Bedrock | `AWS_BEARER_TOKEN_BEDROCK` or AWS credentials chain | + +```bash +# Verify your keys are set +$ env | grep API_KEY +``` + +### Incorrect model name + +Model names must match the provider's naming exactly. Common mistakes: + +- Using a deprecated model name (e.g. `gpt-4` instead of `gpt-5-mini` or `gpt-4o`) +- Model references are case-sensitive: `openai/gpt-5-mini` ≠ `openai/GPT-5-mini` + +### Network connectivity + +If the agent hangs or times out, check that you can reach the provider's API endpoint. Firewalls, VPNs, or proxy settings may block requests. + +## Tool Execution Failures + +### MCP tools not found or failing + +- Ensure the MCP tool command is installed and on your `PATH` +- Check file permissions — tools need to be executable +- Test MCP tools independently before integrating with Docker Agent +- For Docker-based MCP tools (`ref: docker:*`), ensure Docker Desktop is running + +### Filesystem / shell tool errors + +- Verify the agent has the correct toolset configured (`type: filesystem`, `type: shell`) +- Check that the working directory exists and is accessible +- On macOS, ensure terminal has the necessary permissions (e.g., Full Disk Access) + +### Tool lifecycle issues + +MCP and LSP toolsets are managed by a supervisor that auto-restarts them when they crash or drop their session. The TUI exposes that supervisor through two slash commands: + +- `/tools` — the unified tools dialog. Its top section lists every toolset with its current state (`Stopped`, `Starting`, `Ready`, `Degraded`, `Restarting`, `Failed`), restart count, and last error; the bottom section lists every tool the agent can call. Start here whenever a tool seems missing or stuck. +- `/toolset-restart <name>` — force a supervisor-driven reconnect of the named toolset. Useful after completing OAuth, when a remote MCP server has been redeployed, or when a language server like `gopls` is unresponsive. + +Remote MCP servers that return `401 invalid_token` (e.g. because the stored OAuth token was revoked or rotated) are now self-healing: Docker Agent silently exchanges the refresh token for a new one when possible, or surfaces an OAuth re-authentication prompt on your next message when refresh is not possible. No more stuck toolsets that require a process restart — but if you want to trigger re-auth immediately, `/toolset-restart <name>` forces it right away. + +MCP tools using stdio transport must complete the initialization handshake before becoming available. If tools fail silently: + +1. Run `/tools` to see whether the toolset is `Failed` or stuck in `Restarting`, and what the last error was. +2. Enable `--debug` and look for MCP protocol messages in the log +3. Check that the MCP server process starts and responds to `initialize` +4. Verify environment variables required by the tool are set (check `env` and `env_file` in the toolset config) + +> [!NOTE] +> **Startup tool-listing timeout** +> +> At startup, Docker Agent queries each toolset for its tool list. If a toolset does not respond within 10 seconds (e.g. a wedged MCP stdio server that never answers `tools/list`), that toolset is skipped with a warning and the remaining toolsets load normally. The sidebar resolves showing whichever tools did load — no infinite spinner. Enable `--debug` to see the warning message, and use `/toolset-restart <name>` once the server becomes responsive. + +If a toolset keeps crashing in a tight loop, tune the [`lifecycle`](../../configuration/tools/index.md#toolset-lifecycle) block on the toolset (e.g. raise `backoff.initial`, lower `max_restarts`, or switch to the `best-effort` profile) so a flaky dependency does not amplify into a restart storm. + +## Configuration Errors + +### YAML syntax issues + +Docker Agent validates config at startup and reports errors with line numbers. Common problems: + +- Incorrect indentation (YAML is whitespace-sensitive) +- Missing quotes around values containing special characters (`:`, `#`, `{`, `}`) +- Using tabs instead of spaces + +### Missing references + +- Local agents in `sub_agents` must be defined in the `agents` section (external OCI references like `myorg/agent:tag` are resolved from registries automatically) +- Named model references must exist in the `models` section (or use inline format like `openai/gpt-5`) +- RAG source names referenced by agents must be defined in the `rag` section + +### Toolset validation + +- The `path` field is valid for `memory` and `tasks` toolsets, and for the agent-level `cache` block +- MCP toolsets need either `command` (stdio), `remote` (Streamable HTTP/SSE), or `ref` (Docker) +- Provider names must be one of: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, etc. + +> [!NOTE] +> **Schema Validation** +> +> Use the [JSON schema](https://github.com/docker/docker-agent/blob/main/agent-schema.json) in your editor for real-time config validation and autocompletion. + +## Session & Connectivity Issues + +### Downgrade fails with a newer-database error + +If an older Docker Agent binary cannot open the session database after an upgrade, +the database may contain a schema migration that the older binary does not know. +Restore a database created by the older version, or use a binary that includes the +migration. + +### Port conflicts + +When running Docker Agent as an API server or MCP server, ensure the port is not already in use: + +```bash +# Check if port 8080 is in use +$ lsof -i :8080 + +# Use a different port +$ docker agent serve api config.yaml --listen :9090 +``` + +### MCP endpoint accessibility + +For remote MCP servers, verify the endpoint is reachable: + +```bash +# Test streamable HTTP endpoint +$ curl -v https://mcp-server.example.com/mcp +``` + +### Session isolation + +The API server stores every conversation as a distinct session in the SQLite database (`session.db` by default). Each session is identified by its UUID and only mixes messages when the same session ID is reused. If conversations seem to bleed into each other: + +- Make sure each client creates a fresh session via `POST /api/sessions` (don't reuse session IDs across users). +- Confirm `--session-db` points to the path you expect — a stale database from another run can resurface old sessions. +- Use `GET /api/sessions/:id` to inspect what is actually stored, and `DELETE /api/sessions/:id` to clear sessions you don't want anymore. + +### HTTP 413: request body too large + +Three kinds of process reject an oversized request body with `413 Request Entity Too Large`: `docker agent serve api`, `docker agent serve chat`, and an interactive run's control plane ([`docker agent run --listen`](../../features/api-server/index.md#listen)). They aren't configured the same way: `serve api` and `serve chat` each expose their own `--max-request-size` flag (1 MiB default). A `--listen` control plane has no such flag — it enforces a fixed, non-configurable 1 MiB limit — and no `--auth-token` either. Work through these layers in order: + +1. **Identify which server is involved.** `serve api`, `serve chat`, and an attached run's `--listen` control plane are three separate kinds of process. `serve api` and `serve chat` each have their own `--max-request-size` flag and 1 MiB default — check the flags the process that returned the 413 was actually started with. A `--listen` control plane has no `--max-request-size` flag: its 1 MiB cap is fixed. +2. **Measure the serialized request body, not a source file's size.** JSON string escaping and, for any base64-encoded binary content, base64's ~33% expansion both inflate the wire size well past the original file size — a file just under the limit can still push the encoded request over it. +3. **Rule out an intermediary.** If a reverse proxy, gateway, or load balancer sits in front of Docker Agent, it usually enforces its own, independent body-size limit — often with a differently formatted error — and can reject the request before Docker Agent ever sees it. +4. **Confirm who actually returned the error.** A 413 (or a context-length error) can also come from the model provider itself once the request reaches it; that is a separate limit unrelated to `--max-request-size` — see [Context Window Exceeded](#context-window-exceeded) above. +5. **Resolve it.** Once you've confirmed Docker Agent's own server rejected the request, send less content — split it across turns. On `serve api` or `serve chat` you can also restart the server with a deliberately chosen, larger `--max-request-size` (see [API Server](../../features/api-server/index.md#cli-flags) or [Chat Server](../../features/chat-server/index.md#cli-flags)). A `--listen` control plane has no `--max-request-size` flag to raise — sending less content is the only fix. + +A few things that catch people out: + +- `--max-request-size` is set once at process startup and applies to every request that server handles — it isn't per-request or per-client. Only `serve api` and `serve chat` have it; a `--listen` control plane's 1 MiB cap can't be changed. +- `0` or a negative value falls back to the 1 MiB default; it does not mean "no limit". +- Retrying the same oversized body against the same server won't succeed — the limit doesn't change between requests. +- On all three, the body-size check runs ahead of request authentication, so an oversized request can come back as 413 even without valid credentials. +- Piping stdin into a **local** run (`docker agent run agent.yaml -`) never crosses Docker Agent's own inbound HTTP boundary — Docker Agent may still send that content onward to a model/provider over HTTP, but no request reaches Docker Agent's own server to be measured against a `--max-request-size` cap. Piping stdin into `docker agent run --remote ... -`, however, does cross that boundary: the CLI serializes that stdin text into a native API run request and sends it to whichever Docker Agent server the `--remote` address points at — a `serve api` process or another run's `--listen` control plane, never `serve chat`, which speaks a different protocol — so it's measured against that server's own limit like any other request (a configurable `--max-request-size` for `serve api`, or the fixed 1 MiB cap for a `--listen` control plane). That initial request carries only message text — conversion currently drops any attachment resolved locally (`@path`, `/attach`, `--attach`) for the first message, so it alone can't be the cause of a 413. But a `--remote` run doesn't stay text-only for its whole lifetime: a locally resolved attachment added to a *later* message while the agent is still busy — via the default steer behavior or an explicit follow-up (Alt+Enter) — is forwarded as part of that native API request, counts toward the same limit, and can trigger 413 just like any other oversized request. + +> [!WARNING] +> Raising `--max-request-size` increases how much memory an unauthenticated or malicious client can force the server to buffer per request. Pick a value with your deployment's exposure in mind, and pair any non-loopback listener with `--auth-token` (API server) or `--api-key`/`--api-key-env` (chat server). A `--listen` control plane has neither flag — keep it on loopback, a unix socket, or behind an authenticating reverse proxy if it must be reachable from elsewhere. + +## Performance Issues + +### High memory usage + +- Large context windows (64K+ tokens) consume significant memory — consider reducing `max_tokens` +- Use `num_history_items` in agent config to limit conversation history +- For DMR (local models), tune `runtime_flags` for your hardware (e.g., `--ngl` for GPU layers) + +### Slow responses + +- Check if MCP tools are adding latency (visible in debug logs) +- Use the `/cost` command in TUI to see token usage and identify expensive interactions +- For DMR, consider enabling [speculative decoding](../../providers/dmr/index.md) for faster inference + +### Tool resource leaks + +Monitor for tools that don't clean up properly — check debug logs for MCP server start/stop lifecycle events. Orphaned tool processes can consume system resources. + +## Agent Store Issues + +### Pull / push failures + +```bash +# Test registry connectivity +$ docker pull docker.io/username/agent:latest + +# Verify pulled agent content +$ docker agent share pull docker.io/username/agent:latest +``` + +### Agent content issues + +- Ensure the pushed YAML is valid — run `docker agent run` locally before pushing +- Check that referenced resources (MCP tools, files) are available on the target machine +- For auto-refresh (`--pull-interval`), verify the registry is accessible from the server + +## Log Analysis + +When reviewing debug logs, search for these key patterns: + +| Log Pattern | What It Indicates | +| --------------------------- | ------------------------------------------------------------------------------------------------ | +| `"Starting runtime stream"` | Agent execution beginning | +| `"Tool call"` | A tool is being executed | +| `"Tool call result"` | Tool execution completed | +| `"Stream stopped"` | Agent finished processing | +| `HTTP 429` | Rate limiting — consider adding a [fallback model](../../configuration/agents/index.md) | +| `context canceled` | Operation was interrupted (timeout or user cancel) | +| `[RAG Manager]` | RAG retrieval operations | +| `[Reranker]` | Reranking operations | + +> [!WARNING] +> **Still stuck?** +> +> If these steps don't resolve your issue, file a bug on the [GitHub issue tracker](https://github.com/docker/docker-agent/issues) with your debug log attached, or ask on [Slack](https://dockercommunity.slack.com/archives/C09DASHHRU4). diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/_index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/_index.md new file mode 100644 index 000000000000..a4a44d04328a --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/_index.md @@ -0,0 +1,5 @@ +--- +title: "Core Concepts" +description: "The core ideas behind Docker Agent: agents, models, tools, and multi-agent teams." +weight: 20 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/agents/index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/agents/index.md new file mode 100644 index 000000000000..092f7af5104c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/agents/index.md @@ -0,0 +1,114 @@ +--- +title: "Agents" +description: "Agents are the core building blocks of Docker Agent. Each agent is an AI-powered entity with a model, instructions, tools, and optional sub-agents." +keywords: docker agent, ai agents, concepts, agents +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/concepts/agents/ +--- + +_Agents are the core building blocks of Docker Agent. Each agent is an AI-powered entity with a model, instructions, tools, and optional sub-agents._ + +## What is an Agent? + +An agent in Docker Agent is defined by: + +- **Model** — The AI model powering it (e.g., Claude, GPT-5, Gemini). See [Models](../models/index.md). +- **Description** — A brief summary of what the agent does (used by other agents for delegation) +- **Instruction** — The system prompt that defines the agent's behavior and personality +- **Tools** — Capabilities like filesystem access, shell commands, or external APIs +- **Sub-agents** — Other agents it can delegate tasks to + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Expert software developer + instruction: | + You are an expert developer. Write clean, efficient code + and explain your reasoning step by step. + toolsets: + - type: filesystem + - type: shell + - type: think +``` + +## The Root Agent + +Every Docker Agent configuration has a **root agent** — the entry point that receives user messages. In a single-agent setup, this is the only agent. In a multi-agent setup, the root agent acts as a coordinator, delegating tasks to specialized sub-agents. + +> [!NOTE] +> **Naming** +> +> The first agent defined in your YAML (or the one named `root`) is the root agent by default. You can also specify which agent to start with using `docker agent run config.yaml -a agent_name`. + +## Agent Properties + +| Property | Type | Required | Description | +| ---------------------- | ------- | -------- | -------------------------------------------------------------- | +| `model` | string | ✓ | Model reference (inline like `openai/gpt-5` or a named model) | +| `description` | string | ✓ | What the agent does — used by other agents for delegation | +| `instruction` | string | ✓ | System prompt defining behavior | +| `toolsets` | array | ✗ | List of tool configurations | +| `sub_agents` | array | ✗ | Names of agents this agent can delegate to | +| `fallback` | object | ✗ | Fallback model configuration for resilience | +| `add_date` | boolean | ✗ | Include current date in context | +| `add_environment_info` | boolean | ✗ | Include OS, working directory, git info in context | +| `max_iterations` | int | ✗ | Max tool-calling loops (default: unlimited) | +| `commands` | object | ✗ | Named prompts callable via `/command` | +| `skills` | boolean \| list | ✗ | Enable skill discovery and loading. `true` = `["local"]`; list values may combine `"local"` with remote skill-server URLs. | + +## Model Fallbacks + +Agents can automatically fail over to alternative models when the primary model is unavailable: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + fallback: + models: + - openai/gpt-5 + - google/gemini-3.5-flash + retries: 2 # retries per model for 5xx errors + cooldown: 1m # stick with fallback after 429 +``` + +## Named Commands + +Define reusable prompts that can be invoked as commands: + +```yaml +agents: + root: + model: openai/gpt-5 + instruction: You are a helpful assistant. + commands: + df: "Check how much free space I have on my disk" + greet: "Say hello to ${env.USER}" +``` + +```bash +# Run a named command +$ docker agent run agent.yaml /df +$ docker agent run agent.yaml /greet +``` + +Commands support environment variable interpolation using JavaScript template literal syntax. Undefined variables expand to empty strings. + +## Default Agent + +Running `docker agent run` without a config argument uses `docker-agent.yaml`, `docker-agent.yml`, or `docker-agent.hcl` from the current directory when present. Otherwise, it uses a capable built-in default agent for quick tasks without needing any configuration. + +```bash +# Use the project config or built-in default agent +$ docker agent run + +# Override the default with an alias +$ docker agent alias add default /path/to/my-agent.yaml +$ docker agent run # now runs your custom agent +``` + +> [!TIP] +> **See also** +> +> For reusable task-specific instructions, see [Skills](../../features/skills/index.md). For multi-agent patterns, see [Multi-Agent](../multi-agent/index.md). For full config reference, see [Agent Config](../../configuration/agents/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/distribution/index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/distribution/index.md new file mode 100644 index 000000000000..a2ea3aafde5f --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/distribution/index.md @@ -0,0 +1,135 @@ +--- +title: "Agent Distribution" +description: "Package, share, and run agents via OCI-compatible registries — just like container images." +keywords: docker agent, ai agents, concepts, agent distribution +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/concepts/distribution/ +aliases: + - /ai/docker-agent/sharing-agents/ +--- + +_Package, share, and run agents via OCI-compatible registries — just like container images._ + +## Overview + +Docker Agent agents can be pushed to any OCI-compatible registry (Docker Hub, GitHub Container Registry, etc.) and pulled/run anywhere. This makes sharing agents as easy as sharing Docker images. + +> [!TIP] +> For CLI commands related to distribution, see [CLI Reference](../../features/cli/index.md) (`docker agent share push`, `docker agent share pull`, `docker agent alias`). + +## Pushing Agents + +```bash +# Push to Docker Hub +$ docker agent share push ./agent.yaml docker.io/username/my-agent:latest + +# Push to GitHub Container Registry +$ docker agent share push ./agent.yaml ghcr.io/username/my-agent:v1.0 +``` + +## Pulling Agents + +```bash +# Pull an agent +$ docker agent share pull docker.io/username/my-agent:latest + +# Pull from Docker Hub shorthand +$ docker agent share pull myorg/agent:tag +``` + +## Running from a Registry + +Run agents directly from a registry without pulling first: + +```bash +# Run directly from Docker Hub +$ docker agent run docker.io/username/my-agent:latest + +# Docker Hub shorthand (docker.io is implied) +$ docker agent run myorg/agent:tag + +# Run with a specific agent from a multi-agent config +$ docker agent run docker.io/username/dev-team:latest -a developer +``` + +## Using as Sub-Agents + +Registry agents can be used directly as sub-agents in a multi-agent configuration — no need to define them locally: + +```yaml +agents: + root: + model: openai/gpt-5 + description: Coordinator + instruction: Delegate tasks to the right sub-agent. + sub_agents: + - myorg/agent:tag # auto-named "agent" + - my_reviewer:myorg/reviewer # explicitly named "my_reviewer" +``` + +External sub-agents are automatically named after their last path segment. Use the `name:reference` syntax to give them a custom name. + +Tag references are checked against the registry on every `docker agent run`, which adds a network round-trip per sub-agent at startup. Pin them to a digest (`myorg/agent@sha256:…`) to serve them from cache instead. + +See [Pin external sub-agents to a digest](../multi-agent/index.md#pin-external-sub-agents-to-a-digest) and [External Sub-Agents](../multi-agent/index.md#external-sub-agents-from-registries) for details. + +## Using with Aliases + +Combine OCI references with aliases for convenient access: + +```bash +# Create an alias for a registry agent +$ docker agent alias add coder myorg/coder --yolo + +# Now just run +$ docker agent run coder +``` + +## Using with API Server + +The API server supports OCI references with auto-refresh: + +```bash +# Start API from registry, auto-pull every 10 minutes +$ docker agent serve api docker.io/username/agent:latest --pull-interval 10 +``` + +## Private Repositories + +Docker Agent supports pulling from private GitHub repositories and registries that require authentication. Use standard Docker login or GitHub authentication: + +```bash +# Login to a registry +$ docker login docker.io + +# Now push/pull works with private repos +$ docker agent share push ./agent.yaml docker.io/myorg/private-agent:latest +$ docker agent run docker.io/myorg/private-agent:latest +``` + +> [!NOTE] +> **Docker authentication** +> +> When pulling or running an agent from a `docker.com` or `*.docker.com` HTTPS URL (e.g. `desktop.docker.com`), Docker Agent automatically forwards a Docker token for authentication. If Docker Desktop is running and signed in, its token is used; otherwise, Docker Agent exchanges the access token stored by `docker login` for a fresh Docker token. Either way, no explicit login step is required beyond `docker login` (or being signed into Docker Desktop). +> +> Note: `docker.io` (the standard Docker Hub registry domain) is a separate domain and is **not** covered by automatic token forwarding. Agents pulled from `docker.io` or `registry-1.docker.io` still require `docker login docker.io` for private repositories. + +> [!NOTE] +> **Troubleshooting** +> +> Having issues with push/pull? See [Troubleshooting](../../community/troubleshooting/index.md) for common registry issues. + +## Local Development + +For local development and testing, you can run an agent directly from a local HTTP server without a registry: + +```bash +# Serve an agent config locally +$ python3 -m http.server 8080 + +# Run it directly via HTTP +$ docker agent run http://localhost:8080/agent.yaml +$ docker agent run http://127.0.0.1:8080/agent.yaml +``` + +This is useful for iterating on agent configs served from a local dev server before pushing to a registry. Both `localhost` and `127.0.0.1` addresses are supported with plain `http://` URLs. diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/models/index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/models/index.md new file mode 100644 index 000000000000..d966769d4562 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/models/index.md @@ -0,0 +1,175 @@ +--- +title: "Models" +description: "Models are the AI brains behind your agents. Docker Agent supports multiple providers and flexible configuration." +keywords: docker agent, ai agents, concepts, models +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/concepts/models/ +--- + +_Models are the AI brains behind your agents. Docker Agent supports multiple providers and flexible configuration._ + +## Inline vs. Named Models + +There are two ways to assign a model to an agent: + +### Inline (Quick) + +Use the `provider/model` shorthand directly in the agent definition: + +```yaml +agents: + root: + model: openai/gpt-5 + instruction: You are a helpful assistant. +``` + +### Named (Full Control) + +Define models in a `models` section and reference them by name: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 64000 + temperature: 0.7 + +agents: + root: + model: claude + instruction: You are a helpful assistant. +``` + +Named models let you configure temperature, token limits, thinking budgets, and other parameters. They're also reusable across multiple agents. + +## First Available Models + +A named model can also select the first usable model from a priority list. This +is useful for shared configs that should prefer paid cloud models when their API +keys are present, but still work with a local fallback: + +```yaml +models: + smart: + first_available: + - anthropic/claude-sonnet-4-5 + - openai/gpt-5 + - dmr/ai/qwen3 + +agents: + root: + model: smart + instruction: You are a helpful assistant. +``` + +At load time, Docker Agent selects the first candidate whose credentials are +configured. You only need credentials for one candidate. See +[Model Configuration](../../configuration/models/index.md#first-available-models) +for details. + +## Supported Providers + +| Provider | Key | Example Models | API Key Env Var | +| ------------------- | ---------------- | ------------------------------------ | ----------------------------------- | +| OpenAI | `openai` | gpt-5, gpt-5-mini, gpt-4o | `OPENAI_API_KEY` | +| Anthropic | `anthropic` | claude-sonnet-4-5, claude-opus-5 | `ANTHROPIC_API_KEY` | +| Google | `google` | gemini-3.5-flash, gemini-3-pro | `GOOGLE_API_KEY` / `GEMINI_API_KEY` | +| AWS Bedrock | `amazon-bedrock` | Claude, Nova, Llama models | AWS credentials | +| Docker Model Runner | `dmr` | ai/qwen3, ai/llama3.2 | None (local) | +| Mistral | `mistral` | Mistral models | `MISTRAL_API_KEY` | +| xAI | `xai` | Grok models | `XAI_API_KEY` | +| Nebius | `nebius` | Open-source and specialised models | `NEBIUS_API_KEY` | +| NVIDIA NIM | `nvidia` | Nemotron, Llama, Qwen, DeepSeek (open models) | `NVIDIA_API_KEY` | +| MiniMax | `minimax` | MiniMax models | `MINIMAX_API_KEY` | +| Baseten | `baseten` | DeepSeek, Kimi, GLM, Llama models | `BASETEN_API_KEY` | +| OVHcloud | `ovhcloud` | Qwen, Llama, Mistral, DeepSeek (EU-hosted) | `OVH_AI_ENDPOINTS_ACCESS_TOKEN` | +| Groq | `groq` | Llama, Qwen, GPT-OSS (fast inference) | `GROQ_API_KEY` | +| Fireworks AI | `fireworks` | Kimi, Llama, Qwen, DeepSeek, GLM (open models) | `FIREWORKS_API_KEY` | +| DeepSeek | `deepseek` | DeepSeek-V3 chat and R1 reasoner | `DEEPSEEK_API_KEY` | +| Cerebras | `cerebras` | GPT-OSS, GLM (fast inference) | `CEREBRAS_API_KEY` | +| Together AI | `together` | Llama, Qwen, DeepSeek, Kimi (open models) | `TOGETHER_API_KEY` | +| Hugging Face | `huggingface` | Llama, Qwen, DeepSeek, GLM (open models) | `HF_TOKEN` | +| Cloudflare Workers AI | `cloudflare-workers-ai` | Llama, Mistral, Qwen, Gemma (edge-hosted open models) | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` | +| Moonshot AI | `moonshot` | Kimi K2 chat, reasoning, and coding models | `MOONSHOT_API_KEY` | +| Vercel AI Gateway | `vercel` | Multi-provider gateway | `AI_GATEWAY_API_KEY` | +| Cloudflare AI Gateway | `cloudflare-ai-gateway` | Multi-provider gateway | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_GATEWAY_ID` | +| Requesty | `requesty` | Multi-provider gateway | `REQUESTY_API_KEY` | +| OpenRouter | `openrouter` | Multi-provider gateway | `OPENROUTER_API_KEY` | +| Azure OpenAI | `azure` | gpt-4o, gpt-5 on Azure | `AZURE_API_KEY` + `base_url` | +| [Ollama](../../providers/local/index.md) | `ollama` | Any local Ollama model | None (local; optional `base_url`) | +| GitHub Copilot | `github-copilot` | Copilot-hosted OpenAI/Anthropic | `GITHUB_TOKEN` (PAT with `copilot`) | +| ChatGPT (OpenAI account) | `chatgpt` | gpt-5 family via ChatGPT subscription | None (sign in via `docker agent setup`) | + +See the [Model Providers](../../providers/overview/index.md) section for detailed configuration guides. + +## Model Properties + +| Property | Type | Description | +| ------------------- | ---------- | ------------------------------------------------- | +| `provider` | string | Provider identifier (required) | +| `model` | string | Model name (required) | +| `description` | string | Human-readable summary of the model's purpose | +| `temperature` | float | Randomness: 0.0 (deterministic) to 1.0 (creative) | +| `max_tokens` | int | Maximum response length | +| `top_p` | float | Nucleus sampling: 0.0 to 1.0 | +| `frequency_penalty` | float | Reduce repetition: 0.0 to 2.0 | +| `presence_penalty` | float | Encourage topic diversity: 0.0 to 2.0 | +| `base_url` | string | Custom API endpoint | +| `thinking_budget` | string/int | Reasoning effort configuration | +| `task_budget` | int/object | Total token budget for an agentic task (Anthropic; honored by Opus 4.7 today) | +| `provider_opts` | object | Provider-specific options | + +## Reasoning / Thinking Budget + +Control how much the model "thinks" before responding: + +| Provider | Format | Values | Default | +| ---------- | ---------- | ------------------------------------------------------------------- | -------------------------------- | +| OpenAI | string | `minimal`, `low`, `medium`, `high`, `xhigh`, `max` | `medium` (always-reasoning models only) | +| Anthropic | int or str | 1024–32768 tokens, or `adaptive`, `adaptive/<effort>`, effort level | off | +| Gemini 2.5 | int | 0 (off), -1 (dynamic), or token count | -1 (dynamic) | +| Gemini 3 | string | `minimal`, `low`, `medium`, `high` | varies | +| All | string/int | `none` or `0` clears Docker Agent's local config | — | + +`none` and `0` are not universal API-level disable switches. On genuine OpenAI +gpt-5.6+ endpoints (Sol/Terra/Luna), `none` is a real `reasoning_effort` value +that Docker Agent sends as-is and the model does not reason. On older OpenAI +models, `none`/`0` only clear the local `thinking_budget` — omitting the field +has the same effect — and the model falls back to the API's own default effort +(still reasoning internally for always-reasoning models like the o-series). +Providers with a true optional-thinking switch (Gemini 2.5, Claude, local +models) are fully disabled by `none`/`0`. See the +[Thinking / Reasoning guide](../../guides/thinking/index.md#disabling-thinking) +for the full per-provider breakdown. + +```yaml +models: + deep-thinker: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 16384 + + fast-responder: + provider: openai + model: gpt-5.6 + thinking_budget: none # real API-level disable on gpt-5.6+ +``` + +> [!NOTE] +> **Multi-provider teams** +> +> Different agents can use different providers in the same config. See [Multi-Agent](../multi-agent/index.md) for patterns. + +## Alloy Models + +"Alloy models" let you use more than one model in the same conversation — Docker Agent alternates between them to leverage the strengths of each: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5,openai/gpt-5 + instruction: You are a helpful assistant. +``` + +Read more about the alloy model concept at [xbow.com/blog/alloy-agents](https://xbow.com/blog/alloy-agents). diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/multi-agent/index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/multi-agent/index.md new file mode 100644 index 000000000000..e9632ff020d5 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/multi-agent/index.md @@ -0,0 +1,421 @@ +--- +title: "Multi-Agent Systems" +description: "Build teams of specialized agents that collaborate and delegate tasks to each other." +keywords: docker agent, ai agents, concepts, multi-agent systems +linkTitle: "Multi-Agent" +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/concepts/multi-agent/ +--- + +_Build teams of specialized agents that collaborate and delegate tasks to each other._ + +## Why Multi-Agent? + +Complex tasks benefit from specialization. Instead of one monolithic agent trying to do everything, you can create a **team** of focused agents: + +- A **coordinator** that understands the overall goal and delegates +- A **developer** that writes code with filesystem and shell access +- A **reviewer** that checks code quality +- A **researcher** that searches the web for information + +Each agent has its own model, tools, and instructions — optimized for its specific role. + +## Two Patterns: Delegation vs. Handoffs + +Docker Agent supports two multi-agent patterns: + +| | **Delegation** (`sub_agents`) | **Handoffs** (`handoffs`) | +|---|---|---| +| **Topology** | Hierarchical (parent → child → parent) | Peer-to-peer graph (A → B → C → A) | +| **Session** | Child runs in a **sub-session** | Conversation stays in the **same session** | +| **Context** | Child gets a clean task description | Next agent sees the **full conversation history** | +| **Control flow** | Parent blocks until child finishes, then continues | Active agent switches — previous agent is no longer in the loop | +| **Tool** | `transfer_task` | `handoff` | +| **Best for** | Task delegation to specialists | Pipeline workflows, conversational routing | + +You can combine both patterns in the same configuration — an agent can have both `sub_agents` and `handoffs`. + +> [!TIP] +> **When to use which** +> +> **`sub_agents`** — Use when a coordinator needs to send tasks to specialists and synthesize their results. +> +> **`handoffs`** — Use when agents should take turns processing the same conversation (pipelines, routing). +> +> **`background_agents`** — Use when multiple independent tasks can run simultaneously. + +## Delegation with `sub_agents` + +Agents delegate tasks using the built-in `transfer_task` tool, which is automatically available to any agent with `sub_agents`. The parent agent sends a task to a child agent, waits for the result, and then continues. + +1. **User** sends a message to the root agent +2. **Root agent** analyzes the request and decides which sub-agent should handle it +3. **Root agent** calls `transfer_task` with the target agent, task description, and expected output +4. **Sub-agent** processes the task in its own agentic loop using its tools +5. **Results** flow back to the root agent, which responds to the user + +```bash +# The transfer_task tool call looks like: +transfer_task( + agent="developer", + task="Create a REST API endpoint for user authentication", + expected_output="Working Go code with tests" +) +``` + +> [!NOTE] +> **Auto-Approved** +> +> Unlike other tools, `transfer_task` is always auto-approved — no user confirmation needed. This allows seamless delegation between agents. + +## Handoffs Routing + +Handoffs are a peer-to-peer routing pattern where agents **hand off the entire conversation** to another agent. Unlike delegation, there is no sub-session — the conversation stays in a single session and the active agent simply switches. + +This pattern is ideal for: + +- **Pipeline workflows** — data flows through a chain of specialized agents +- **Conversational routing** — a coordinator routes the user to the right specialist, who can route back when done +- **Graph topologies** — agents can form cycles (A → B → C → A), enabling iterative workflows + +### How It Works + +1. **User** sends a message to the starting agent +2. **Agent A** processes the message, then calls `handoff` to route to **Agent B** +3. **Agent B** becomes the active agent and sees the **full conversation history** +4. **Agent B** can respond, use its own tools, or hand off to another agent +5. This continues until an agent responds directly without handing off + +```bash +# The handoff tool call looks like: +handoff( + agent="summarizer" +) +``` + +> [!NOTE] +> **Scoped Handoff Targets** +> +> Each agent can only hand off to agents listed in its own `handoffs` array. The `handoff` tool is automatically injected — you don't need to add it manually. + +### Example + +A coordinator routes to a researcher, who hands off to a summarizer, who returns to the coordinator: + +```text +Root ──→ Researcher ──→ Summarizer ──→ Root +``` + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Coordinator that routes queries + instruction: | + Route research queries to the researcher. + handoffs: + - researcher + + researcher: + model: openai/gpt-5 + description: Web researcher + instruction: | + Search the web, then hand off to the summarizer. + toolsets: + - type: mcp + ref: docker:duckduckgo + handoffs: + - summarizer + + summarizer: + model: openai/gpt-5 + description: Summarizes findings + instruction: | + Summarize the research results, then hand off + back to root. + handoffs: + - root +``` + +> [!TIP] +> **Full pipeline example** +> +> For a more complex handoff graph with branching and multiple processing stages, see [`examples/handoff.yaml`](https://github.com/docker/docker-agent/blob/main/examples/handoff.yaml). + +### Forced Handoffs + +With `handoffs`, the **model decides** whether to call the `handoff` tool — which means it can forget to, breaking pipelines that depend on a strict order. `force_handoff` removes that uncertainty: whenever the agent produces a final response, the **runtime itself** routes the conversation to the named agent, bypassing the LLM's tool-calling entirely. The full conversation context carries over. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Extracts key facts from the input + instruction: | + Extract the key facts from the user's input as a bullet list. + force_handoff: summarizer + + summarizer: + model: anthropic/claude-sonnet-4-5 + description: Produces the final summary + instruction: | + Summarize the extracted facts for the user. +``` + +Rules enforced at config load time: + +- The target must be an agent defined in the config (or an external reference) +- An agent cannot `force_handoff` to itself +- Chains of `force_handoff` edges must not form a cycle (A → B → A is rejected) + +See [`examples/force_handoff.yaml`](https://github.com/docker/docker-agent/blob/main/examples/force_handoff.yaml) for a runnable example. + +## Parallel Delegation with Background Agents + +`transfer_task` is **sequential** — the coordinator waits for the sub-agent to finish before continuing. When you need to fan out work to multiple agents at the same time, use the `background_agents` toolset instead. + +Add it to your coordinator's toolsets: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Research coordinator + sub_agents: [researcher, analyst, writer] + toolsets: + - type: think + - type: background_agents +``` + +The coordinator can then: + +1. **Dispatch** several tasks at once with `run_background_agent` — each returns a task ID immediately +2. **Monitor** progress with `list_background_agents` or `view_background_agent` +3. **Collect** results once tasks complete +4. **Cancel** tasks that are no longer needed with `stop_background_agent` + +```bash +# Start two tasks in parallel +run_background_agent(agent="researcher", task="Find recent papers on LLM agents") +run_background_agent(agent="analyst", task="Analyze our current architecture") + +# Check on all tasks +list_background_agents() + +# Read results when ready +view_background_agent(task_id="agent_task_abc123") +``` + +## External Sub-Agents from Registries + +Sub-agents don't have to be defined locally — you can reference agents from any OCI-compatible registry directly in your `sub_agents` list. This lets you compose teams using shared agents without duplicating their configuration. + +```yaml +agents: + root: + model: openai/gpt-5 + description: Coordinator that delegates to local and external sub-agents + instruction: | + Delegate tasks to the most appropriate sub-agent. + sub_agents: + - local_helper + - myorg/agent:tag # pulled from registry automatically + + local_helper: + model: openai/gpt-5 + description: A local helper agent for simple tasks + instruction: You are a helpful assistant. +``` + +External sub-agents are automatically named after their last path segment (without the tag) — for example, `myorg/agent:tag` becomes `agent`. You can also give them an explicit name using the `name:reference` syntax: + +```yaml + sub_agents: + - my_agent:myorg/agent:tag # available as "my_agent" + - reviewer:docker.io/myorg/review-agent:latest +``` + +### Pin external sub-agents to a digest + +External references use a tag by default: `myorg/agent` is shorthand for `myorg/agent:latest`. Tag references are re-resolved against the registry on **every** `docker agent run`: each unpinned external sub-agent triggers a digest lookup at startup, even when that sub-agent is never invoked in the session. On a healthy connection this typically adds a second or two per reference (it depends on your network and registry), and it is one of the paths that can stall if the registry or credential helper misbehaves. + +Pinning a reference to an immutable digest (`@sha256:…`) makes the runtime serve it straight from the local cache with no network round-trip, so startup stays fast and your team is fully reproducible: + +```yaml + sub_agents: + - reviewer:docker.io/myorg/review-agent@sha256:44117e73263afa5c861bdf3730dae7925918ffdd146827eee5bcff20bc55e8fa +``` + +Copy the digest from your registry (Docker Hub shows it next to the tag) or read it with a standard OCI tool such as `docker buildx imagetools inspect <reference>`. Docker Agent logs a startup warning for any external OCI reference that still uses a tag instead of a digest. + +External references in `handoffs` and `force_handoff` carry the same per-run cost, so pin those to a digest too. + +> [!TIP] +> External sub-agents work with any OCI-compatible registry. See [Agent Distribution](../distribution/index.md) for more on registry references. +> +> See [`examples/sub-agents-from-registry.yaml`](https://github.com/docker/docker-agent/blob/main/examples/sub-agents-from-registry.yaml) for a complete example mixing local and external sub-agents. + +## Harness-Backed Sub-Agents + +Sub-agents can be backed by external coding CLIs — Claude Code, Codex, opencode, or pi — instead of a model API. Add a `harness:` block in place of a `model:` field to create a harness sub-agent: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Orchestrator that plans and delegates + instruction: | + Break down coding tasks and delegate to the coding agents. + sub_agents: + - claude-coder + - codex-coder + + claude-coder: + description: Claude Code specialist + harness: + type: claude-code + effort: high + + codex-coder: + description: Codex specialist + harness: + type: codex +``` + +The orchestrator uses `transfer_task` to send work to a harness sub-agent just like any other sub-agent. Docker Agent handles the orchestration and hooks; the external CLI drives the coding loop. + +> [!TIP] +> **Learn more** +> +> See [Coding Harnesses](../../features/harnesses/index.md) for the full field reference, parallel dispatch patterns, and what does not work inside harness agents. + +## Example: Development Team + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Technical lead coordinating development + instruction: | + You are a technical lead managing a development team. + Analyze requests and delegate to the right specialist. + Ensure quality by reviewing results before responding. + sub_agents: [developer, reviewer, tester] + toolsets: + - type: think + + developer: + model: anthropic/claude-sonnet-4-5 + description: Expert software developer + instruction: | + You are an expert developer. Write clean, efficient code + and follow best practices. + toolsets: + - type: filesystem + - type: shell + - type: think + + reviewer: + model: openai/gpt-5 + description: Code review specialist + instruction: | + You review code for quality, security, and maintainability. + Provide actionable feedback. + toolsets: + - type: filesystem + + tester: + model: openai/gpt-5 + description: Quality assurance engineer + instruction: | + You write tests and ensure software quality. Run tests + and report results. + toolsets: + - type: shell + - type: todo +``` + +## Example: Research Team + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Research coordinator + instruction: | + Coordinate research tasks. Delegate web searches to + the researcher and writing to the writer. + sub_agents: [researcher, writer] + toolsets: + - type: think + + researcher: + model: openai/gpt-5 + description: Web researcher + instruction: Search the web and gather information. + toolsets: + - type: mcp + ref: docker:duckduckgo + - type: memory + path: ./research.db + + writer: + model: anthropic/claude-sonnet-4-5 + description: Content writer + instruction: Write clear, well-structured content. + toolsets: + - type: filesystem +``` + +## Multi-Model Teams + +A key advantage of multi-agent systems is using different models for different roles — picking the best model for each job: + +```yaml +models: + fast: + provider: openai + model: gpt-5-mini + temperature: 0.2 # precise + + creative: + provider: openai + model: gpt-5 + temperature: 0.8 # creative + + local: + provider: dmr + model: ai/qwen3 # runs locally, no API cost + +agents: + analyst: + model: fast # cheap and fast for analysis + writer: + model: creative # creative for content + helper: + model: local # free for simple tasks +``` + +## Shared Tools + +Tools like `todo` can be shared between agents for collaborative task tracking: + +```yaml +toolsets: + - type: todo + shared: true # all agents see the same todo list +``` + +## Best Practices + +- **Keep agents focused** — Each agent should have a clear, narrow role +- **Write clear descriptions** — The coordinator uses descriptions to decide who to delegate to +- **Give minimal tools** — Only give each agent the tools it needs for its specific role +- **Use the think tool when needed** — For models without native reasoning, give coordinators the think tool so they reason about delegation. Models with built-in thinking (e.g., via `thinking_budget`) don't need it +- **Use the right model** — Use capable models for complex reasoning, cheap models for simple tasks +- **Choose the right pattern** — Use `sub_agents` for hierarchical task delegation, `handoffs` for pipeline workflows and conversational routing + +> [!NOTE] +> **Beyond Docker Agent** +> +> For interoperability with other agent frameworks, Docker Agent supports the [A2A protocol](../../features/a2a/index.md) and can expose agents via [MCP Mode](../../features/mcp-mode/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/concepts/tools/index.md b/_vendor/github.com/docker/docker-agent/docs/concepts/tools/index.md new file mode 100644 index 000000000000..149e876d9a7a --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/concepts/tools/index.md @@ -0,0 +1,78 @@ +--- +title: "Tools" +description: "Tools give agents the ability to interact with the world — read files, run commands, search the web, query databases, and more." +keywords: docker agent, ai agents, concepts, tools +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/concepts/tools/ +--- + +_Tools give agents the ability to interact with the world — read files, run commands, search the web, query databases, and more._ + +## How Tools Work + +When an agent needs to perform an action, it makes a **tool call**. The Docker Agent runtime executes the tool and returns the result to the agent, which can then use it to continue its work. + +1. Agent receives a user message +2. Agent decides it needs to use a tool (e.g., read a file) +3. Docker Agent executes the tool and returns the result +4. Agent incorporates the result and responds + +> [!NOTE] +> **Tool Confirmation** +> +> By default, Docker Agent asks for user confirmation before executing tools that have side effects (shell commands, file writes). Use `--yolo` to auto-approve all tool calls. + +## Built-in Tools + +Docker Agent ships with several built-in tools that require no external dependencies. Each is enabled by adding its `type` to the agent's `toolsets` list: + +| Tool | Description | +| --- | --- | +| [Filesystem](../../tools/filesystem/index.md) | Read, write, list, search, and navigate files and directories | +| [Shell](../../tools/shell/index.md) | Execute shell commands synchronously | +| [Background Jobs](../../tools/background-jobs/index.md) | Run and manage long-running shell commands | +| [Think](../../tools/think/index.md) | Step-by-step reasoning scratchpad for planning and decision-making | +| [Todo](../../tools/todo/index.md) | Task list management for complex multi-step workflows | +| [Tasks](../../tools/tasks/index.md) | Persistent task database shared across sessions | +| [Memory](../../tools/memory/index.md) | Persistent key-value storage backed by SQLite | +| [Fetch](../../tools/fetch/index.md) | Read content from HTTP/HTTPS URLs (GET only) | +| [Script](../../tools/script/index.md) | Define custom shell scripts as named tools | +| [LSP](../../tools/lsp/index.md) | Connect to Language Server Protocol servers for code intelligence | +| [API](../../tools/api/index.md) | Create custom tools that call HTTP APIs without writing code | +| [OpenAPI](../../tools/openapi/index.md) | Generate tools from an OpenAPI 3.x document | +| [RAG](../../tools/rag/index.md) | Retrieval-augmented generation over indexed sources | +| [Model Picker](../../tools/model-picker/index.md) | Let the agent pick between several models per turn | +| [User Prompt](../../tools/user-prompt/index.md) | Ask users questions and collect interactive input | +| [Open URL](../../tools/open-url/index.md) | Open a fixed URL in the user's default browser | +| [Transfer Task](../../tools/transfer-task/index.md) | Delegate tasks to sub-agents (auto-enabled with `sub_agents`) | +| [Background Agents](../../tools/background-agents/index.md) | Dispatch work to sub-agents concurrently | +| [Handoff](../../tools/handoff/index.md) | Hand the conversation off to another local agent in the same config (auto-enabled with `handoffs:`) | +| [A2A](../../tools/a2a/index.md) | Connect to remote agents via the Agent-to-Agent protocol | +| [MCP Catalog](../../tools/mcp-catalog/index.md) | Discover and activate remote MCP servers from the Docker MCP Catalog on demand | +| [Git](../../tools/git/index.md) | Read-only git repository inspection | +| [Scheduler](../../tools/scheduler/index.md) | Schedule instructions to run at a time or on a recurring interval | +| [Webhook](../../tools/webhook/index.md) | Outbound notifications to Slack, Discord, Telegram, IFTTT, and more | +| [Plan](../../tools/plan/index.md) | Shared persistent scratchpad for multi-agent collaboration | +| [Session Plan](../../tools/session_plan/index.md) | Per-session plan tracker for the draft/review/execute workflow | +| [Session Context](../../tools/session_context/index.md) | Reference a previous session as context | + +## MCP Tools + +Docker Agent supports the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) for extending agents with external tools. There are three ways to connect MCP tools: + +- **Docker MCP** (recommended) — Run MCP servers in Docker containers via the [MCP Gateway](https://github.com/docker/mcp-gateway). Browse the [Docker MCP Catalog](https://hub.docker.com/search?q=&type=mcp). +- **Local MCP (stdio)** — Run MCP servers as local processes communicating over stdin/stdout. +- **Remote MCP (Streamable HTTP / SSE)** — Connect to MCP servers running on a network. See [Remote MCP Servers](../../features/remote-mcp/index.md). + +```yaml +toolsets: + - type: mcp + ref: docker:duckduckgo +``` + +See [Tool Config](../../configuration/tools/index.md#mcp-tools) for full MCP configuration reference. + +> [!TIP] +> **See also** +> +> For full configuration reference, see [Tool Config](../../configuration/tools/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/_index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/_index.md new file mode 100644 index 000000000000..7b70d5fcfd0f --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/_index.md @@ -0,0 +1,5 @@ +--- +title: "Configuration" +description: "Complete reference for configuring agents in YAML or HCL." +weight: 30 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/agents/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/agents/index.md new file mode 100644 index 000000000000..9da240a9cb06 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/agents/index.md @@ -0,0 +1,618 @@ +--- +title: "Agent Configuration" +description: "Complete reference for defining agents in your YAML configuration." +keywords: docker agent, ai agents, configuration, yaml, agent configuration +linkTitle: "Agent Config" +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/configuration/agents/ +--- + +_Complete reference for defining agents in your YAML configuration._ + +A configuration must define at least one agent under `agents`. + +## Full Schema + +<!-- yaml-lint:skip --> +```yaml +agents: + agent_name: + model: string # Required: model reference + description: string # Required: what this agent does + instruction: string # Required (unless instruction_file): system prompt + instruction_file: string | [list] # Optional: load the system prompt from one or more files relative to this config (mutually exclusive with instruction) + sub_agents: [list] # Optional: local or external sub-agent references + toolsets: [list] # Optional: tool configurations (use `type: rag` for RAG sources) + fallback: # Optional: fallback config + models: [list] + retries: 2 + cooldown: 1m + add_date: boolean # Optional: add date to context + add_environment_info: boolean # Optional: add env info to context + add_prompt_files: [list] # Optional: include additional prompt files + add_description_parameter: bool # Optional: add description to tool schema + redact_secrets: boolean # Optional: scrub detected secrets out of tool args, outgoing chat messages, and tool output + code_mode_tools: boolean # Optional: let the agent write JavaScript to orchestrate tool calls (see Code Mode) + max_iterations: int # Optional: max tool-calling loops + max_consecutive_tool_calls: int # Optional: max identical consecutive tool calls + max_old_tool_call_tokens: int # Optional: token budget for old tool call content (disabled unless positive) + max_tool_result_tokens: int # Optional: per-tool-result token cap with middle-out truncation (disabled unless positive) + num_history_items: int # Optional: limit conversation history + session_compaction: boolean # Optional: disable automatic session compaction (default: true) + compaction_threshold: float # Optional: context-window fraction that triggers auto-compaction (0–1, default: 0.9) + compaction_model: string # Optional: model used for session-compaction (summary generation) + use_toolsets: [list] # Optional: names of top-level toolsets to merge into this agent + readonly: boolean # Optional: restrict all toolsets to read-only tools only + skills: boolean | [list] # Optional: enable skill discovery (true/false or list of names and/or sources) + use_commands: [list] # Optional: names of top-level commands groups to merge into this agent + use_skills: [list] # Optional: names of top-level skills groups to merge into this agent + commands: # Optional: named prompts + name: "prompt text" # or {instruction: "prompt", agent: "sub_agent_name"} or {url: "https://..."} (TUI only) + welcome_message: string # Optional: message shown at session start + handoffs: [list] # Optional: agent names this agent can hand off to + force_handoff: string # Optional: agent that always receives the conversation when this agent stops + hooks: # Optional: lifecycle hooks + pre_tool_use: [list] + tool_response_transform: [list] + post_tool_use: [list] + session_start: [list] + session_end: [list] + on_user_input: [list] + stop: [list] + notification: [list] + structured_output: # Optional: constrain output format + name: string + schema: object + cache: # Optional: response cache (skip the model on repeat questions) + enabled: boolean + case_sensitive: boolean + trim_spaces: boolean + path: string + harness: # Optional: delegate to an external coding CLI (Claude Code, Codex, opencode, pi) + type: string # Required: claude-code | codex | opencode | pi + model: string # Optional: model override forwarded to the CLI (omit for the CLI's own default) + effort: string # claude-code only: low | medium | high | xhigh | max (omit for the Claude Code default) + agent: string # opencode only: agent profile name + thinking: boolean # opencode only: enable extended thinking +``` + +> [!TIP] +> **See also** +> +> For model parameters, see [Model Config](../models/index.md). For tool details, see [Tool Config](../tools/index.md). For multi-agent patterns, see [Multi-Agent](../../concepts/multi-agent/index.md). + +## Properties Reference + +| Property | Type | Required | Description | +| --------------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | string | ✓ | Model reference. Either inline (`openai/gpt-5`) or a named model from the `models` section. | +| `description` | string | ✓ | Brief description of the agent's purpose. Used by coordinators to decide delegation. | +| `instruction` | string | ✓ | System prompt that defines the agent's behavior, personality, and constraints. Required unless `instruction_file` is set. | +| `instruction_file` | string \| array | ✗ | Path(s) to a file or files (relative to the config file's directory) whose contents become the agent's instruction, loaded at startup. Accepts a single path or a list; multiple files are concatenated in order, separated by a blank line. Mutually exclusive with `instruction`. Each path must be a local relative path inside the config directory (absolute paths and `..` traversal are rejected). Only supported for local file-based configs, not OCI/URL sources. See [External Instruction Files](#external-instruction-files) below. | +| `sub_agents` | array | ✗ | List of agent names or external OCI references this agent can delegate to. Supports local agents, registry references (e.g., `myorg/agent:tag`), and named references (`name:reference`). Automatically enables the `transfer_task` tool. Pin external OCI references to a digest (`name@sha256:…`) to skip the per-run registry lookup that tag references incur. See [External Sub-Agents](../../concepts/multi-agent/index.md#external-sub-agents-from-registries). | +| `toolsets` | array | ✗ | List of tool configurations. See [Tool Config](../tools/index.md). | +| `fallback` | object | ✗ | Automatic model failover configuration. | +| `add_date` | boolean | ✗ | When `true`, injects the current date into the agent's context. | +| `add_environment_info` | boolean | ✗ | When `true`, injects working directory, OS, CPU architecture, and git info into context. | +| `add_prompt_files` | array | ✗ | List of file paths whose contents are appended to the system prompt. Useful for including coding standards, guidelines, or additional context. | +| `add_description_parameter` | boolean | ✗ | When `true`, adds agent descriptions as a parameter in tool schemas. Helps with tool selection in multi-agent scenarios. | +| `redact_secrets` | boolean | ✗ | When `true`, scrubs detected secrets (API keys, tokens, private keys, etc.) out of tool-call arguments, outgoing chat messages, and tool output before they reach a tool, the model, or downstream consumers. See [Redacting Secrets](#redacting-secrets) below. | +| `code_mode_tools` | boolean | ✗ | When `true`, replaces the agent's individual tools with a single tool that runs a JavaScript script calling as many of them as needed in one turn. See [Code Mode](../../features/code-mode/index.md). | +| `max_iterations` | int | ✗ | Maximum number of tool-calling loops. Default: unlimited (0). Set this to prevent infinite loops. | +| `max_consecutive_tool_calls` | int | ✗ | Maximum consecutive identical tool calls before the agent is terminated, preventing degenerate loops. Default: `5`. | +| `max_old_tool_call_tokens` | int | ✗ | Maximum number of tokens to keep from old tool call arguments and results. Older tool calls beyond this budget have their content replaced with a placeholder, saving context space. Tokens are approximated as `len/4`. Truncation is disabled by default; set a positive value to enable it. Set to `-1` to disable truncation (unlimited). | +| `max_tool_result_tokens` | int | ✗ | Maximum number of tokens to keep from each tool result when it is added to the session. Oversized results are truncated middle-out: the head and tail are kept and the removed middle is replaced with a truncation marker. Textual documents attached to the result share the same budget. Tokens are approximated as `len/4`. The cap is disabled by default; set a positive value to enable it. `0` and `-1` both leave tool results unbounded. | +| `num_history_items` | int | ✗ | Limit the number of conversation history messages sent to the model. Useful for managing context window size with long conversations. Default: unlimited (all messages sent). | +| `session_compaction` | boolean | ✗ | When `false`, disables automatic session compaction for this agent: neither the proactive threshold trigger nor the post-overflow auto-recovery runs. The manual `/compact` command remains available. Default: `true`. See the [Context & Compaction guide](../../guides/compaction/index.md). | +| `compaction_threshold` | float | ✗ | Fraction of the model's context window at which proactive auto-compaction triggers. Must be greater than `0` and at most `1`. A `compaction_threshold` set on the agent's model takes precedence. Default: `0.9`. See the [Context & Compaction guide](../../guides/compaction/index.md). | +| `compaction_model` | string | ✗ | Model used for session compaction (summary generation). Can be a named model or an inline `provider/model` string. This agent-level value takes precedence over a `compaction_model` set on the agent's model or provider; when none is set, the agent's own model compacts. See the [Context & Compaction guide](../../guides/compaction/index.md). | +| `skills` | bool/array | ✗ | Enable automatic skill discovery. `true` loads all discovered local skills, `false` disables them. A list can mix skill sources (`local` or `https://…` URLs) and skill names to include — see [Skills](../../features/skills/index.md). | +| `commands` | object | ✗ | Named prompts that can be run with `docker agent run config.yaml /command_name`. Can be simple strings or objects with `instruction` and/or `agent` fields for agent switching, or a `url` field to open a link in the browser (TUI only). See [Named Commands](#named-commands) below. | +| `use_commands` | list of string | ✗ | Names of top-level `commands` groups to merge into this agent. Inline `commands` entries take precedence on name conflicts. Default: `[]`. | +| `use_skills` | list of string | ✗ | Names of top-level `skills` groups to merge into this agent. Inline skills are deduplicated by name against merged entries. Default: `[]`. | +| `use_toolsets` | list of string | ✗ | Names of top-level `toolsets` groups to merge into this agent. See [Reusable Toolsets](../overview/index.md#reusable-toolsets-toolsets). Default: `[]`. | +| `readonly` | boolean | ✗ | When `true`, every toolset on this agent is filtered to expose only read-only tools (those annotated with a read-only hint). Mutating tools are removed at load time and cannot be called even if the model tries. See [Read-Only Agents](#read-only-agents) below. | +| `welcome_message` | string | ✗ | Message displayed to the user when a session starts. Rendered as Markdown in the TUI. **Not sent to the model** — it exists purely for the user's benefit. Useful for telling users what the agent can do and what commands are available. | +| `handoffs` | array | ✗ | List of agent names this agent can hand off the conversation to. Enables the `handoff` tool. See [Handoffs Routing](../../concepts/multi-agent/index.md#handoffs-routing). | +| `force_handoff` | string | ✗ | Name of an agent that unconditionally receives the conversation whenever this agent produces a final response. The runtime performs the switch itself, bypassing the LLM's tool-calling, guaranteeing deterministic pipelines. Must not reference the agent itself, and chains must not form a cycle. See [Forced Handoffs](../../concepts/multi-agent/index.md#forced-handoffs). | +| `hooks` | object | ✗ | Lifecycle hooks for running commands at various points. See [Hooks](../hooks/index.md). | +| `structured_output` | object | ✗ | Constrain agent output to match a JSON schema. See [Structured Output](../structured-output/index.md). | +| `cache` | object | ✗ | Response cache. When the same user question is asked again, the previous answer is replayed verbatim and the model is not called. See [Response Cache](#response-cache) below. | +| `harness` | object | ✗ | Run this agent through an external coding CLI instead of a model. **Note:** Any `toolsets:` defined on the same agent are silently ignored when `harness:` is set — the external CLI brings its own tools. See [Coding Harnesses](../../features/harnesses/index.md). | + +> [!WARNING] +> **max_iterations** +> +> Default is `0` (unlimited). Always set `max_iterations` for agents with powerful tools like `shell` to prevent infinite loops. A value of 20–50 is typical for development agents. + +> [!TIP] +> **Managing long sessions** +> +> `max_old_tool_call_tokens`, `max_tool_result_tokens`, `num_history_items`, `session_compaction`, and `compaction_threshold` all help keep long-running sessions inside the model's context window. See the [Context & Compaction guide](../../guides/compaction/index.md) for how to combine them. + +## External Instruction Files + +Long system prompts can be kept in their own files instead of being inlined in +the YAML, using `instruction_file`. This separates infrastructure configuration +(models, providers, tools) from behavioral content (the prompt), which keeps +version-control diffs focused, reduces merge conflicts on shared configs, and +lets instruction content be edited without risking YAML syntax errors. + +```yaml +agents: + coordinator: + model: openai/gpt-5-mini + description: Routes work between specialist agents + instruction_file: instructions/coordinator.md + sub_agents: + - writer + writer: + model: openai/gpt-5-mini + description: Drafts and edits written content + instruction_file: instructions/writer.md +``` + +The path is resolved relative to the config file's directory and the file's +contents are loaded as the agent's instruction when the config is loaded. Notes: + +- **Mutually exclusive** with `instruction`. Setting both is an error. +- Each path must be a **local relative path inside the config directory**. + Absolute paths and `..` traversal are rejected. +- A **list** of files is also accepted; their contents are concatenated in + order, separated by a blank line. This lets a shared preamble be reused + across agents while each agent appends its own specifics: + + ```yaml + agents: + writer: + model: openai/gpt-5-mini + description: Drafts and edits written content + instruction_file: + - instructions/shared-preamble.md + - instructions/writer.md + ``` + +- Only supported for **local file-based configs**, not agents loaded from OCI + registries or URLs. When an agent is pushed with `docker agent share push`, + the file contents are inlined into the pushed artifact, so the published + agent stays self-contained. + +A runnable example lives in [`examples/instruction_file.yaml`](https://github.com/docker/docker-agent/blob/main/examples/instruction_file.yaml). + +## Prompt Files + +`add_prompt_files` injects the contents of one or more files into the agent's +context at the start of every turn — handy for repo-wide conventions like +`AGENTS.md` or `CLAUDE.md` that should stay available without being pasted +into `instruction`: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: A helpful coding assistant + instruction: You are an expert software developer. + add_prompt_files: + - AGENTS.md +``` + +For each name, the agent loads the closest match found by walking up from the +current working directory, plus (if it's a different file) a copy at that +name directly under the user's home directory — so a personal `~/AGENTS.md` +can layer on top of a repo-local one. Missing files are skipped rather than +erroring. Because resolution and the read happen on every turn, edits to the +file are picked up without restarting the agent. + +Use `--prompt-file` to add files for a single run without editing the +config. It's merged with any `add_prompt_files` already set on the agent, +with duplicates dropped: + +```bash +$ docker agent run agent.yaml --prompt-file CONTRIBUTING.md +``` + +Resolved prompt files show up as their own entries in the `/context` dialog — see [File Attachments](../../features/tui/index.md#file-attachments) in the Terminal UI guide. + +See [Choosing a Large-Input Strategy](../../guides/headless/index.md#choosing-a-large-input-strategy) for how prompt files compare to `@`/`/attach` attachments, the `rag` toolset, and sending content over the API/chat server. + +## Response Cache + +The response cache short-circuits the model when the same user question is asked again. The first time a question is asked, the agent calls the model normally and stores the assistant's reply. Subsequent identical questions skip the model entirely and replay the stored reply verbatim. + +```yaml +agents: + root: + model: openai/gpt-5 + description: Cached assistant + instruction: You are a helpful assistant. + cache: + enabled: true # required to turn the cache on + case_sensitive: false # default: false ("Hello" == "hello") + trim_spaces: true # default: false (" hello " == "hello") + path: ./cache.json # optional: persist to disk; omit for in-memory +``` + +| Property | Type | Default | Description | +| ---------------- | ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `enabled` | boolean | `false` | Master switch. When `false` (or when the `cache` section is omitted), no caching is performed. | +| `case_sensitive` | boolean | `false` | When `true`, questions must match exactly (including case) to hit the cache. | +| `trim_spaces` | boolean | `false` | When `true`, leading and trailing whitespace is stripped from the question before it is compared. | +| `path` | string | _empty_ | When set, cache entries are persisted to a JSON file at the given path and reloaded on startup so the cache survives restarts. Relative paths resolve against the agent config directory. When empty, the cache lives in memory only. | + +**How it works** + +- The cache key is the latest user message in the session, normalized according to `case_sensitive` and `trim_spaces`. +- On a hit, the cached reply is added to the session as the assistant message and stop hooks fire normally — the rest of the agent (tools, sub-agents, the model) is bypassed. +- On a miss, the agent runs normally; the final assistant message produced by the first stop of the run is then stored under the question's key. +- Only the response to the original user question of a run is cached; follow-up turns inside the same `RunStream` are not. + +**File-backed storage** + +When `path` is set, every `Store` rewrites the entire cache file. Writes are **atomic**: the new content is written to a sibling temp file, `fsync`'d, and renamed over the destination, so a concurrent reader (or a process that crashes mid-write) will always see either the previous content or the new content in full — never a partially written file. The parent directory is also `fsync`'d after the rename so the rename itself is durable. + +**Cross-process sharing** + +Multiple processes can share the same `path:` cache file safely. Every `Store` takes an exclusive advisory lock on a sibling `<path>.lock` file (POSIX `flock(2)` on Unix, `LockFileEx` on Windows), reloads the current on-disk state under the lock, merges the new entry, and writes back atomically. Two processes that store *different* keys at the same time both see their writes preserved on disk; the lock window is short (one read + one fsync'd write). + +`Lookup` watches the file's modification time and reloads the in-memory map when the file has advanced since its last load, so writes from a sibling process become visible without a restart. The `<path>.lock` sentinel file is created on first write and never deleted: removing it would let two processes lock different inodes and lose mutual exclusion. + +## Redacting Secrets + +The `redact_secrets` flag is a single agent-level switch that scrubs accidentally leaked credentials, tokens, and private keys out of an agent's I/O. It wires up three complementary defenses: + +1. A `pre_tool_use` built-in hook that scrubs detected secrets from the **arguments of every tool call**, before the tool sees them. +2. A `before_llm_call` built-in hook that scrubs the same patterns from **outgoing chat messages** — message content, multi-part text content, prior reasoning content, and the JSON-encoded arguments of any tool call still in the conversation — before they reach the model provider. +3. A `tool_response_transform` built-in hook that scrubs **tool output at the source**, so the secret never reaches event consumers, the persisted session file, the `post_tool_use` hook input, or the next LLM call. + +```yaml +agents: + root: + model: openai/gpt-5 + description: A helpful assistant that scrubs secrets before they leak + instruction: | + You are a helpful assistant. If the user accidentally pastes a token, + do your best work without echoing the secret back. + redact_secrets: true + toolsets: + - type: shell +``` + +Detection uses the [portcullis](https://github.com/docker/portcullis) ruleset, which recognises common secret patterns including: + +- GitHub Personal Access Tokens (`ghp_*`, `gho_*`, `ghu_*`, `ghs_*`, `ghr_*`, fine-grained `github_pat_*`) +- AWS access keys (`AKIA*`, `ASIA*`, …) and secret access keys +- GitLab PATs (`glpat-*`), Hugging Face tokens (`hf_*`) +- Stripe (`sk_live_*`, `pk_test_*`, …), Slack (`xoxb-*`, …), Shopify, Twilio, Discord, Atlassian, Mailchimp, SendGrid, and many more +- JWTs, GCP service-account JSON, Heroku keys, Docker Hub PATs (`dckr_pat_*`) +- PEM-encoded private keys (`-----BEGIN … PRIVATE KEY-----` blocks) + +Each detected span is replaced with the literal string `[REDACTED]`; the surrounding text is preserved so a redacted argument still looks like a legitimate flag (e.g. `--token=[REDACTED]`). Redaction is idempotent — applying it twice yields the same result. + +> [!NOTE] +> **False positives vs. false negatives** +> +> False positives are extremely rare: every rule pairs a regex with a discriminating keyword, so plain English never trips detection. **False negatives are possible** — only patterns the ruleset recognises are scrubbed, so this is a defense-in-depth feature, not a substitute for keeping secrets out of the conversation in the first place. Pair it with a proper [secret manager](../../guides/secrets/index.md) for the credentials your agent actually needs. + +> [!NOTE] +> **Equivalent hook entry** +> +> Setting `redact_secrets: true` on the agent is shorthand for auto-registering all three legs of the feature as hook entries. They share the _same_ built-in name (`type: builtin`, `command: redact_secrets`) on `pre_tool_use`, `before_llm_call`, and `tool_response_transform` respectively — the implementation dispatches on the hook event. You can spell them out by hand to scope a leg to a subset of tools (set `matcher:` to a regex), stack them with other rewriters in a specific order, or enable just one or two legs. See [`examples/redact_secrets_hooks.yaml`](https://github.com/docker/docker-agent/blob/main/examples/redact_secrets_hooks.yaml) for a complete manual wiring and the [Hooks reference](../hooks/index.md#available-built-ins) for the builtin's event coverage. + +## Welcome Message + +Display a message when users start a session: + +```yaml +agents: + assistant: + model: openai/gpt-5 + description: Development assistant + instruction: You are a helpful coding assistant. + welcome_message: | + 👋 Welcome! I'm your development assistant. + + I can help you with: + - Writing and reviewing code + - Running tests and debugging + - Explaining concepts + + What would you like to work on? +``` + +## Deferred Tool Loading + +Toolsets support `defer` to load tools on-demand and speed up agent startup. See [Deferred Tool Loading](../tools/index.md#deferred-tool-loading) for details. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Multi-purpose assistant + instruction: You have access to many tools. + toolsets: + - type: mcp + ref: docker:github-official + defer: true + - type: filesystem +``` + +## Fallback Configuration + +Automatically switch to backup models when the primary fails: + +| Property | Type | Default | Description | +| ---------- | ------ | ------- | ---------------------------------------------------------- | +| `models` | array | `[]` | Fallback models to try in order | +| `retries` | int | `2` | Retries per model for 5xx errors. `-1` to disable. | +| `cooldown` | string | `1m` | How long to stick with a fallback after a rate limit (429) | + +**Error handling:** + +- **Retryable** (same model with backoff): HTTP 5xx, 408, network timeouts +- **Non-retryable** (skip to next model): HTTP 429, 4xx client errors + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + fallback: + models: + - openai/gpt-5 + - google/gemini-3.5-flash + retries: 2 + cooldown: 1m +``` + +## Named Commands + +> [!TIP] +> **Full reference** +> +> This section covers the basics. For URL commands, agent-switching commands, reusable top-level `commands:` groups, and hiding commands with `--disable-commands`, see [Custom Commands](../commands/index.md). + +Define reusable prompt shortcuts that can send prompts to the current agent, switch to a different sub-agent, or open a URL in the browser: + +> **Note:** Named slash commands execute immediately, even while the agent is processing another message. Unlike regular chat messages (which are queued), slash commands interrupt or direct the agent even while it is mid-response. + +```yaml +agents: + root: + model: openai/gpt-5 + instruction: You are a system administrator. + commands: + df: "Check how much free space I have on my disk" + logs: "Show me the last 50 lines of system logs" + greet: "Say hello to ${env.USER}" + deploy: "Deploy ${env.PROJECT_NAME || 'app'} to ${env.ENV || 'staging'}" + + # Advanced format with agent switching + plan: + agent: planner # Switch to the 'planner' agent + instruction: "Create a detailed plan for: ${args.join(\" \")}" # Optional: send this prompt after switching + + # Agent switching without instruction - forwards remaining text as prompt + review: + agent: reviewer # Any text after /review is sent to the reviewer agent + + # URL command - opens a link in the browser instead of messaging the agent + docs: + description: "Open the documentation" + url: https://docs.docker.com/ +``` + +### Command Formats + +Commands support three formats: + +1. **Simple string format**: The string becomes the instruction sent to the current agent + + ```yaml + df: "Check disk space" + ``` + +2. **Advanced object format**: Supports agent switching and optional instructions + + ```yaml + plan: + agent: planner # Required: name of any agent defined in the team + instruction: "Plan: ${args.join(\" \")}" # Optional: prompt to send after switching + description: "Switch to planning mode" # Optional: shown in help text + ``` + +3. **URL format**: Opens a link in the browser instead of messaging the agent + + ```yaml + docs: + url: https://docs.docker.com/ # Required: URL to open + description: "Open the documentation" # Optional: shown in help text + ``` + +When `agent` is set without `instruction`, any text typed after the slash command (e.g., `/plan build a web app`) is forwarded as a prompt to the target agent. The target agent can be **any agent defined in the team configuration** — it does not need to be listed in the current agent's `sub_agents` array. + +**Argument and expansion syntax** + +An `instruction` string can reference the command's arguments and expand tool calls: + +- `${args[0]}`, `${args[1]}`, … — individual positional arguments, in the order the user typed them after the command +- `${args.join(" ")}` — all arguments joined into a single string +- `${tool_name({...})}` — calls a tool and inlines its return value (any tool available to the agent) +- `!tool_name(key=value)` — legacy tool-call form: calls a tool with plain `key=value` arguments and inlines its output + +### Agent-Switching Commands + +Commands with an `agent` field switch the active agent for that command's scope. This is useful for building workflow shortcuts where `/plan`, `/review`, `/deploy` each route the user to the appropriate specialist. + +```yaml +agents: + root: + model: openai/gpt-5 + description: Main assistant + instruction: You are a project coordinator. + sub_agents: [planner, reviewer] + commands: + # Switch to planner with a pre-filled prompt + plan: + agent: planner + instruction: "Create a detailed plan for: ${args.join(\" \")}" + # Switch to reviewer; any text after /review is forwarded + review: + agent: reviewer + # Simple prompt command (no switching) + status: "Summarize what we have accomplished so far" + + planner: + model: openai/gpt-5 + description: Planning specialist + instruction: You create detailed project plans. + + reviewer: + model: anthropic/claude-sonnet-4-5 + description: Code review specialist + instruction: You review code and suggest improvements. +``` + +**Agent-switching vs. `handoff`** + +| | Agent-switching command | `handoff` tool | +| --- | --- | --- | +| **Trigger** | User runs `/command` | Model calls `handoff()` | +| **Session** | Stays in the same session | Stays in the same session | +| **History** | Target agent sees full conversation | Target agent sees full conversation | +| **Return** | User must explicitly switch back | Target agent can chain to another agent | + +**Agent-switching vs. `transfer_task`** + +`transfer_task` launches a **sub-session**: the root agent sends a task, the child runs in isolation, and the result is returned to the root. The root agent stays in control and the child's work is never in the main conversation. Use `transfer_task` (via `sub_agents`) when you want delegation with a clean result; use agent-switching commands when you want to *become* a different agent for the rest of the conversation. + +See [`examples/agent_switching_commands.yaml`](https://github.com/docker/docker-agent/blob/main/examples/agent_switching_commands.yaml) for a complete example. + +```bash +# Run commands from the CLI +$ docker agent run agent.yaml /df +$ docker agent run agent.yaml /greet +$ PROJECT_NAME=myapp ENV=production docker agent run agent.yaml /deploy +``` + +Commands use JavaScript template literal syntax (`${env.VAR}`) for environment variable interpolation. Undefined variables expand to empty strings. + +The same syntax is also expanded in agent and toolset instructions: `agents.<name>.instruction` and `toolsets[*].instruction` support `${env.X}` placeholders (with optional `||` defaults and ternary expressions). `agents.<name>.description` and `agents.<name>.welcome_message` also support it. + +Note that path-like fields (`working_dir`, `path`) primarily use a shell-style syntax (`$VAR`, `${VAR}`, `~`), and also accept `${env.X}` as an alias (though not richer JS expressions). See [Variable Expansion in Config Fields](../overview/index.md#variable-expansion-in-config-fields) for the full table. + +### URL Commands + +A command with a `url` field opens that URL in the user's default browser instead of sending a prompt to the agent. Any URI scheme the OS knows how to dispatch works — both standard web URLs and custom schemes such as `docker-desktop://` for deep links. URL commands are TUI-only — they have no effect when run from the CLI. + +```yaml +agents: + root: + model: openai/gpt-5 + description: An agent with handy URL shortcuts. + instruction: You are a helpful assistant. + commands: + feedback: + description: "Open the feedback site for this session" + url: https://example.com/feedback?session={{session_id}} + docs: + description: "Open the documentation" + url: https://docs.docker.com/ + desktop: + description: "Open this session in Docker Desktop" + url: docker-desktop://dashboard/session/{{session_id}} +``` + +The `{{session_id}}` token is replaced at invocation time with the current session ID (URL-query-escaped so it can't break the URL or inject extra query parameters), letting a command deep-link to something scoped to the conversation. This token deliberately uses `{{...}}` rather than the `${...}` JS-expansion syntax, since the session ID is only known at dispatch time. + +URLs are validated before being handed to the OS opener: a parseable URL with a non-empty scheme is required, and flag-like inputs (those starting with `-`) are rejected to prevent argument injection. + +See [`examples/url_commands.yaml`](https://github.com/docker/docker-agent/blob/main/examples/url_commands.yaml) for a complete example. + +## Read-Only Agents + +Set `readonly: true` on an agent to restrict all of its toolsets to tools that are annotated as read-only. Mutating tools are filtered out at load time — the agent cannot list or call them, even if the model hallucinates a call. + +You can also set `readonly: true` on an individual toolset to restrict only that toolset while leaving others unrestricted. + +```yaml +agents: + # Agent-level readonly: every toolset is restricted to read-only tools. + inspector: + model: anthropic/claude-sonnet-4-5 + description: Read-only inspector that can explore but never modify. + instruction: Explore the project. Do not make changes. + readonly: true + toolsets: + - type: filesystem + - type: shell + + # Toolset-level readonly: only the filesystem toolset is restricted; + # the shell toolset keeps all of its tools. + mixed: + model: anthropic/claude-sonnet-4-5 + description: Read-only file access, full shell access. + instruction: You can read files and run any shell command. + toolsets: + - type: filesystem + readonly: true + - type: shell +``` + +See [`examples/readonly.yaml`](https://github.com/docker/docker-agent/blob/main/examples/readonly.yaml) for a complete example. + +> [!NOTE] +> **Which tools are read-only?** +> +> Whether a tool is read-only is determined by its `ReadOnlyHint` annotation. For built-in tools, read-only operations (list/read/search) carry the hint; mutating operations (write/delete/execute) do not. Custom and MCP tools expose the hint via their own annotations. + +## Complete Example + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 64000 + +agents: + root: + model: claude + description: Technical lead coordinating development + instruction: | + You are a technical lead. Analyze requests and delegate + to the right specialist. Always review work before responding. + welcome_message: "👋 I'm your tech lead. How can I help today?" + sub_agents: [developer, researcher] + add_date: true + add_environment_info: true + fallback: + models: [openai/gpt-5] + toolsets: + - type: think + commands: + review: "Review all recent code changes for issues" + hooks: + session_start: + - type: command + command: "./scripts/setup.sh" + + developer: + model: claude + description: Expert software developer + instruction: Write clean, tested, production-ready code. + max_iterations: 30 + toolsets: + - type: filesystem + - type: shell + - type: think + - type: todo + + researcher: + model: openai/gpt-5 + description: Web researcher with memory + instruction: Search for information and remember findings. + toolsets: + - type: mcp + ref: docker:duckduckgo + - type: memory + path: ./research.db +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/agentsignore/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/agentsignore/index.md new file mode 100644 index 000000000000..67bbcf96ee75 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/agentsignore/index.md @@ -0,0 +1,105 @@ +--- +title: "Ignoring files" +description: "Hide files from the agent with a .agentsignore file, using the same syntax as .gitignore." +keywords: docker agent, ai agents, configuration, agentsignore, gitignore, ignore, secrets +weight: 75 +canonical: https://docs.docker.com/ai/docker-agent/configuration/agentsignore/ +--- + +_Hide files from the agent with a `.agentsignore` file, using the same syntax as `.gitignore`._ + +## Overview + +Put a `.agentsignore` file in your project and the agent stops seeing the paths it lists. Matched files are absent from directory listings and searches, and reads, writes and edits targeting them are refused. + +```text +# .agentsignore +secrets.env +*.key +.env.* +build/ +docs/**/*.draft.md +!public.key +``` + +There is nothing to configure. The file's presence is the opt-in, and it is picked up automatically by the [filesystem toolset](../../tools/filesystem/index.md). + +## Syntax + +The syntax is `.gitignore` syntax — parsed with the same library git uses, so patterns behave identically to `.gitignore` and `.dockerignore`: + +| Pattern | Matches | +| --- | --- | +| `secrets.env` | that name at any depth (`secrets.env`, `config/secrets.env`) | +| `/secrets.env` | that name at the project root only | +| `*.key` | any file with the extension | +| `build/` | the directory and everything under it | +| `docs/**/*.draft.md` | nested matches via `**` | +| `!public.key` | re-includes a path an earlier pattern excluded | +| `# comment` | ignored, as are blank lines | + +## Where the file is found + +The nearest `.agentsignore` at or above the working directory is used, so starting a run in a subdirectory still honours the project's file. Patterns are anchored to the directory containing the file, exactly as git anchors to the directory containing `.gitignore`. + +Unlike `.gitignore`, **a git repository is not required** — `.agentsignore` works in any directory. + +## What it affects + +| Behaviour | Effect | +| --- | --- | +| `list_directory`, `directory_tree` | matched entries are omitted | +| `search_files_content` | matched files are skipped | +| `read_file`, `read_multiple_files` | refused | +| `write_file`, `edit_file` | refused, including for files that do not exist yet | +| `create_directory`, `remove_directory` | refused | +| `permissions` | matching deny rules are derived automatically, so `/permissions` shows them | + +Paths are resolved before matching — symlinks, `./` prefixes and `..` segments are all normalised — so an ignored file cannot be reached by spelling it differently. + +The `.agentsignore` file is itself always hidden: it names the very things being kept back, so handing it to the agent would be a map of what to look for. + +> [!NOTE] +> `.agentsignore` is independent of the filesystem toolset's [`ignore_vcs`](../tools/index.md) option. Setting `ignore_vcs: false` turns off `.gitignore` filtering but does **not** un-hide `.agentsignore` entries. + +## Relationship to `.gitignore` + +They are separate, and they do different amounts of work. + +`.gitignore` is respected by default (`ignore_vcs`), but only as a **display filter**: gitignored files are hidden from listings and searches while `read_file` still opens them. That is reasonable for build output, which is noise rather than secret. + +`.agentsignore` is for content the agent should not have at all, so it blocks reads and writes as well. Use `.gitignore` for noise, `.agentsignore` for secrets. + +## Limits + +> [!WARNING] +> `.agentsignore` governs the filesystem toolset. It is **not** a sandbox. +> +> An agent with the [`shell`](../../tools/shell/index.md) toolset can still run `cat secrets.env`, because the shell runs commands the toolset never inspects. The same applies to any toolset that reaches the filesystem on its own, such as [`lsp`](../../tools/lsp/index.md). +> +> Treat `.agentsignore` as a strong default that keeps sensitive files out of the agent's view and context — not as a boundary against an agent actively trying to reach them. When you need a real boundary, combine it with [permissions](../permissions/index.md) that restrict `shell`, or run in [sandbox mode](../sandbox/index.md). + +The derived permission rules are best-effort for the same reason: permission patterns match the argument string as the model wrote it, without resolving it first, so `./secrets.env` can slip past a rule written for `secrets.env`. The filesystem toolset's own check resolves paths first and is the part that actually enforces. + +## Example + +```text +# .agentsignore + +# Secrets +.env +.env.* +secrets.env +*.pem +*.key +!public.key # this one is safe to read + +# Credentials directories +.aws/ +.ssh/ + +# Large build output the agent doesn't need +build/ +dist/ +node_modules/ +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/budget/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/budget/index.md new file mode 100644 index 000000000000..07086c2c5d8e --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/budget/index.md @@ -0,0 +1,217 @@ +--- +title: "Budget" +description: "Cap what a single run may spend in money, tokens, or working time." +keywords: docker agent, ai agents, configuration, yaml, budget, cost, limits +weight: 75 +canonical: https://docs.docker.com/ai/docker-agent/configuration/budget/ +--- + +_Cap what a single run may spend in money, tokens, or working time._ + +## Overview + +A budget sets ceilings on a run. When a ceiling is crossed the run stops with a message naming the exact limit that tripped, and the TUI tracks consumption live while the run is still going. + +Every limit is optional and an unset limit is unlimited, so you can cap money, tokens, time, or any combination. Declare no budget at all and runs are unbudgeted, which is the default. + +There are two ways to declare one, and they compose: + +| Block | Scope | +| --- | --- | +| `budget` | One run-wide ceiling, charged for every agent. | +| `budgets` | Named budgets an agent opts into by name. | + +### A run-wide budget + +```yaml +agents: + root: + model: openai/gpt-4o-mini + description: An agent on a short leash. + instruction: You are a helpful assistant. + +budget: + max_cost: 0.50 + max_tokens: 100000 + max_time: 10m +``` + +| Field | Type | Description | +| --- | --- | --- | +| `max_cost` | number | Maximum spend, in USD. | +| `max_tokens` | integer | Maximum cumulative input+output tokens. | +| `max_time` | string | Maximum time the agents spend working, in Go duration format (`10m`, `30s`, `1h30m`). | + +### Named budgets + +Define budgets by name under the top-level `budgets` key, then have each agent opt in by listing names in its own `budgets` field. The fields are the same three. + +```yaml +budgets: + shell-work: + max_cost: 0.03 + max_tokens: 8000 + research: + max_time: 1m + +agents: + root: + model: openai/gpt-4o-mini + description: Does shell work. + instruction: You are a helpful assistant. + budgets: [shell-work] + researcher: + model: openai/gpt-4o-mini + description: Answers questions. + instruction: You answer questions concisely. + budgets: [shell-work, research] +``` + +An agent may list several budgets; all of them apply, and the first to be exhausted stops the run. A run-wide `budget` applies on top of any named budget, so the ceiling that binds is whichever runs out first. + +Referencing a budget name that isn't defined is a config error, caught at parse time rather than silently leaving the agent uncapped. + +## A name is one shared pot + +When several agents reference the same budget name they draw from the **same** ceiling — not a copy each. Above, `root` and `researcher` share `shell-work`: together they cannot spend more than `$0.03`. + +This is deliberate, and it is the whole reason budgets are worth having. If each agent received its own allowance, a run could spend `max_cost` × N simply by fanning out to N sub-agents, and the ceiling would mean nothing for exactly the workloads that most need one. + +Give agents **distinct budget names** when you want independent pots. + +The same applies to the run-wide `budget`: every sub-session inside a run (transferred tasks, sub-agents, skills) spends from that one wallet. + +## Scope: a budget spans the session + +Spend accumulates for the life of the **session**, across every message you send — it does not reset each time you hit enter. A `max_cost: 0.50` you could re-spend on every message would not be a ceiling at all. + +Starting a new session starts a fresh budget. It is a per-session ceiling, not a lifetime quota across sessions. + +> [!NOTE] +> `max_time` measures the time the agents actually spend **working** — the sum of their turn durations — not wall-clock since the session opened. Because a budget spans a session, and a session sits idle while you read and type, wall-clock would let a budget expire during a coffee break: leave the TUI open for ten minutes and your next message would instantly trip a `max_time` of `2m` without the agent having done anything. + +## What stops a run + +Crossing any limit — run-wide or named — stops the run and produces: + +- an assistant message in the transcript naming the limit and the amounts, +- a `budget_exceeded` event carrying `budget`, `limit`, `used`, `max`, `config_path` and, under `stop_message`, the assistant stop message itself (agent name, role, content and timestamp only), +- a `notification` hook at `warning` level, +- a stream end reason of `budget_exceeded`, so a stopped run is distinguishable from a completed one in telemetry. + +The message names the exact YAML path to raise, so there is no ambiguity about which of several budgets tripped: + +```text +Execution stopped after reaching the configured budgets.shell-work.max_cost +limit (used $0.0312 of $0.0300). +``` + +Unlike [`max_iterations`](../agents/index.md), a budget stop is **terminal** — there is no prompt offering to continue. A budget is a ceiling you set deliberately, so raising it means editing the config rather than answering a dialog. + +## Budget stops in evaluation output + +When a budgeted agent is exercised with `docker agent eval`, a budget stop is recorded as a structured termination. It is not an error, and it is distinct from an ordinary stream stop: the run output JSON exposes it as an optional `eval_result.termination` object on the affected session. + +```json +"eval_result": { + "passed": true, + "termination": { + "reason": "budget_exceeded", + "budget": "run", + "limit": "max_cost", + "used": "$0.0312", + "max": "$0.0300", + "config_path": "budget.max_cost", + "message": "Execution stopped after reaching the configured budget.max_cost limit (used $0.0312 of $0.0300)." + } +} +``` + +- `reason` is always `budget_exceeded`. The other fields are optional and are copied from the runtime's `budget_exceeded` event through an allow-list: only `budget`, `limit`, `used`, `max`, `config_path`, and `message` are ever taken, each sanitized (invalid UTF-8 and control characters stripped, bounded length) and omitted when missing or unusable. +- The stored session (SQLite database and sessions JSON) keeps the stop marker at its chronological position, followed exactly once by the assistant stop message rebuilt from the event's embedded `stop_message` (again only agent name, role, content, and timestamp are taken, sanitized the same way). When the event carries no usable `stop_message`, the marker stands alone; nothing is invented from `termination.message`. +- The termination is informational: it does not change `passed`, `failures`, or `error`. A run that completed normally or failed with an error simply has no `termination` field, and older outputs written before the field existed load unchanged. + +## Tracking spend in the TUI + +The sidebar's Token Usage panel lists every active budget by name, with consumption against each ceiling it declares: + +```text +run $0.12/$0.50 · 12.3K/100.0K · 2m14s/10m +shell-work $0.09/$0.10 · 4.3K/20.0K +``` + +Only the ceilings you configured appear. Each reading is colored by the sidebar's shared gauge bands — the same ones a context gauge uses as it nears compaction — so a budget turns amber well before its ceiling and red just short of it, and a run about to be stopped is visible before it stops. + +For a per-agent view of who spent what, set **Sidebar info mode** to `Detailed` in `/settings` → Appearance: the Agents section then reports each agent's cost alongside its effort and context. The budget line deliberately does not repeat that breakdown — the same numbers twice would crowd the sidebar's narrowest column. The per-agent split is still carried on the `budget_usage` event for programmatic consumers, and `/cost` has a **By Agent** section. + +## Limits and caveats + +### Unpriced models do not count towards `max_cost` + +Only responses the runtime can price count towards `max_cost`. A model with no pricing data — an unknown model ID, or a custom endpoint such as a local or private deployment — contributes nothing, because there is no honest number to add. + +Such a run emits a warning and the TUI marks the reading `(unpriced spend)`, rather than silently reading low because the spend is invisible. To make a custom endpoint count, price it explicitly with a model-level [`cost`](../models/index.md#custom-token-pricing) block: + +```yaml +models: + local: + provider: openai + model: my-model + base_url: http://localhost:8000/v1 + cost: + input: 0.15 + output: 0.60 + +agents: + root: + model: local + description: A locally-served agent with real cost accounting. + instruction: You are a helpful assistant. + +budget: + max_cost: 0.50 +``` + +### Limits are checked at turn boundaries + +A run is checked between turns, so it can overshoot by at most the turn already in flight. `max_time` in particular will not interrupt a model call or tool that has already started; the run stops at the first boundary after the limit is reached. + +This is the same granularity [`max_iterations`](../agents/index.md) has, and it keeps the ceiling out of the streaming hot path. Set limits with a little headroom rather than at the exact number you cannot exceed. + +### `max_tokens` here is not the model's `max_tokens` + +The `max_tokens` in a budget is a **cumulative** count of input+output tokens across the whole run. It is unrelated to the provider- or model-level [`max_tokens`](../models/index.md), which caps the output of a single response. + +It is also not the session's context length: compaction resets that, while the budget keeps counting. + +## Examples + +Cap money only, and let the run take as long as it needs: + +```yaml +agents: + root: + model: openai/gpt-4o + description: A cost-capped agent. + instruction: You are a helpful assistant. + +budget: + max_cost: 5.00 +``` + +Cap working time for an unattended job: + +```yaml +agents: + root: + model: openai/gpt-4o-mini + description: A time-boxed agent. + instruction: You are a helpful assistant. + toolsets: + - type: shell + +budget: + max_time: 15m +``` + +See [`examples/budget.yaml`](https://github.com/docker/docker-agent/blob/main/examples/budget.yaml) for a runnable configuration. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/commands/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/commands/index.md new file mode 100644 index 000000000000..1b621b1f1a6e --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/commands/index.md @@ -0,0 +1,218 @@ +--- +title: "Custom Commands" +description: "Define slash commands that send prompts, open URLs, or switch agents, and reuse them across agents with top-level command groups." +keywords: docker agent, ai agents, configuration, yaml, custom commands, slash commands +linkTitle: "Custom Commands" +weight: 55 +canonical: https://docs.docker.com/ai/docker-agent/configuration/commands/ +--- + +_Define slash commands that send prompts, open URLs, or switch agents._ + +## What Slash Commands Are + +A slash command is a named shortcut a user types in the TUI (`/df`, `/deploy`, `/plan`) or on the CLI (`docker agent run agent.yaml /df`) instead of typing out a full prompt. Every agent can declare its own commands under `commands:`, and top-level `commands:` groups let multiple agents share the same set without duplicating them. + +Unlike regular chat messages — which are queued while the agent is busy — slash commands (both built-in and named) execute immediately, even mid-response. + +Commands come in three shapes: + +| Shape | What it does | +| --- | --- | +| [Prompt command](#prompt-commands) | Sends a prompt to the current agent | +| [URL command](#url-commands) | Opens a link in the user's browser (full TUI only) | +| [Agent-switching command](#agent-switching-commands) | Switches the active agent, optionally with a prompt (full TUI and CLI) | + +> [!IMPORTANT] +> **Behavior differs by frontend** +> +> `url` and `agent` are only fully honored in the **full TUI**, which checks `url` before `agent` (a URL command opens the browser and stops there; an agent-switching command switches before sending any instruction). The **lean TUI** doesn't special-case either field — it only resolves a command's expanded text and sends it as a chat message, so a URL-only command silently sends whatever trailing text followed the slash (often nothing, opening no browser) and an agent-switching command sends its instruction to the *current* agent instead of the target. The **CLI** (`docker agent run agent.yaml /command`) switches agents like the full TUI, but has no browser to open, so `url` has no effect there. The **HTTP API** (`POST /api/sessions/:id/agent/:agent`) resolves agent-switching commands server-side: if the message content starts with a slash command whose `agent` field is set, the active agent is switched and the message is rewritten before the turn runs. Prompt-only and URL commands are not resolved server-side and pass through to the model unchanged. + +## Prompt Commands + +The simplest form: a string value that becomes the instruction sent to the current agent. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: A system administrator assistant. + instruction: You are a system administrator. + commands: + df: "Check how much free space I have on my disk" + logs: "Show me the last 50 lines of system logs" + greet: "Say hello to ${env.USER}" +``` + +For more control, use the object form with an `instruction:` field, plus an optional `description:` shown in completion dialogs and help text: + +```yaml +commands: + deploy: + description: "Deploy the application to staging" + instruction: "Deploy ${env.PROJECT_NAME || 'app'} to ${env.ENV || 'staging'}" +``` + +Commands support JavaScript template literal syntax (`${env.VAR}`) for environment variable interpolation, with optional `||` defaults and ternary expressions — the same syntax as agent `instruction` and `description`. Undefined variables expand to the empty string. See [Variable Expansion in Config Fields](../overview/index.md#variable-expansion-in-config-fields) for the full picture. + +Prompt commands can also reference the text typed after the slash and call tools, using the same `${...}` expansion engine as `${env.VAR}`: + +- `${args[0]}`, `${args[1]}`, … — individual positional arguments (whitespace-tokenized; quoted substrings keep their spaces together). +- `${args}` or `${args.join(" ")}` — the full argument list. +- `${tool_name({key: value, ...})}` — calls an agent tool and inlines its output. JS expressions are evaluated before tool commands, so tool output is never itself re-evaluated as JS. +- `` !tool_name(key=value) `` — legacy bang syntax for the same tool-call inlining; still supported alongside `${tool_name({...})}`. + +If `instruction` uses none of the `${args...}` placeholders, any text typed after the slash is appended to the resolved instruction automatically. + +```yaml +commands: + fix: + description: "Fix a file, with optional extra options" + instruction: "Fix the file ${args[0]} with options ${args[1]}" + run: + description: "Run a command with all the typed arguments" + instruction: 'Run command with args: ${args.join(" ")}' + lint: + description: "Show the current lint output" + instruction: 'Lint: ${shell({cmd: "task lint"})}' +``` + +```bash +# Run commands from the CLI too +$ docker agent run agent.yaml /df +$ docker agent run agent.yaml /greet +$ docker agent run agent.yaml /fix main.go --verbose +$ PROJECT_NAME=myapp ENV=production docker agent run agent.yaml /deploy +``` + +## URL Commands + +A command with a `url` field opens that URL in the user's default browser instead of sending a prompt to the agent. Any URI scheme the OS knows how to dispatch works — standard web URLs and custom schemes such as `docker-desktop://` for deep links. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: An agent with handy URL shortcuts. + instruction: You are a helpful assistant. + commands: + feedback: + description: "Open the feedback site for this session" + url: https://example.com/feedback?session={{session_id}} + docs: + description: "Open the documentation" + url: https://docs.docker.com/ + desktop: + description: "Open this session in Docker Desktop" + url: docker-desktop://dashboard/session/{{session_id}} +``` + +The `{{session_id}}` token is replaced at invocation time with the current session ID (URL-query-escaped so it can't break the URL or inject extra query parameters), letting a command deep-link to something scoped to the conversation. This token deliberately uses `{{...}}` rather than the `${...}` JS-expansion syntax, since the session ID is only known at dispatch time. + +URLs are validated before being handed to the OS opener: a parseable URL with a non-empty scheme is required, and flag-like inputs (those starting with `-`) are rejected to prevent argument injection. + +> [!NOTE] +> **Full TUI only** +> +> URL commands only open a browser in the full TUI. The CLI and lean TUI don't check the `url` field at all, so `docker agent run agent.yaml /docs` never opens a browser there — but the command is still dispatched: its resolved text (usually empty, for a URL-only command) is sent as a prompt and can trigger a model turn. + +See [`examples/url_commands.yaml`](https://github.com/docker/docker-agent/blob/main/examples/url_commands.yaml) for a complete example. + +## Agent-Switching Commands + +A command with an `agent` field switches the active agent for the rest of the conversation. This is useful for building workflow shortcuts where `/plan`, `/review`, `/deploy` each route the user to the right specialist. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Main assistant + instruction: You are a project coordinator. + sub_agents: [planner, reviewer] + commands: + # Switch to planner with a pre-filled prompt + plan: + agent: planner + instruction: "Create a detailed plan for: ${args.join(' ')}" + # Switch to reviewer; any text after /review is forwarded + review: + agent: reviewer + + planner: + model: anthropic/claude-sonnet-4-5 + description: Planning specialist + instruction: You create detailed project plans. + + reviewer: + model: anthropic/claude-sonnet-4-5 + description: Code review specialist + instruction: You review code and suggest improvements. +``` + +When `agent` is set **without** `instruction`, any text typed after the slash command (e.g. `/review fix the auth bug`) is forwarded as a prompt to the target agent. When both are set, the agent is switched first, then the instruction is sent to the new agent. Either way, the target can be **any agent defined in the team**, not just one of the current agent's own `sub_agents` — `sub_agents` above is shown because `planner` and `reviewer` also happen to be delegation targets, not because `agent:` requires it. + +Agent switching stays in the same session — the target agent sees the full conversation history, and the user must explicitly switch back (there's no automatic return). This is different from the two other ways agents hand off work: + +| | Agent-switching command | `handoff` tool | `transfer_task` | +| --- | --- | --- | --- | +| **Trigger** | User runs `/command` | Model calls `handoff()` | Model calls `transfer_task()` | +| **Session** | Stays in the same session | Stays in the same session | Launches an isolated sub-session | +| **History** | Target agent sees full conversation | Target agent sees full conversation | Child runs in isolation; only the result returns | +| **Control** | User must explicitly switch back | Target agent can chain to another agent | Root agent stays in control | + +Use `transfer_task` (via `sub_agents`) when you want delegation with a clean result; use agent-switching commands when you want to *become* a different agent for the rest of the conversation. + +See [`examples/agent_switching_commands.yaml`](https://github.com/docker/docker-agent/blob/main/examples/agent_switching_commands.yaml) for a complete example. + +## Reusable Command Groups + +Repeated command sets across agents can be hoisted into the top-level `commands:` section and pulled in by name with `use_commands:` — the same reuse pattern as `mcps:` for MCP servers and `toolsets:` for shared toolsets. + +```yaml +commands: + ci: + deploy: "Deploy the application" + test: "Run the test suite" + +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Lead developer + instruction: You are the lead developer. Coordinate the team. + use_commands: [ci] # reuse the "ci" command group + commands: + lint: "Run the linter" # inline command, merged in (wins on conflict) + + docs-writer: + model: anthropic/claude-sonnet-4-5 + description: Documentation writer + instruction: You write and maintain the project documentation. + use_commands: [ci] # same group, reused without duplication +``` + +An agent's own inline `commands:` entries take precedence over merged `use_commands:` entries on name conflicts. See [`examples/shared-commands-skills.yaml`](https://github.com/docker/docker-agent/blob/main/examples/shared-commands-skills.yaml) for a complete example that also covers the equivalent `skills:` / `use_skills:` pattern. + +## Hiding Commands + +Use `--disable-commands` to hide and disable specific slash commands in the TUI — built-in ones (`/cost`, `/eval`, `/model`, …) or your own named ones. Accepts a comma-separated list; the leading slash is optional and matching is case-insensitive. + +```bash +$ docker agent run agent.yaml --disable-commands="/cost,/eval,/model" +``` + +This is useful for shipping a distributed agent with a narrower command surface — for example, hiding `/model` so a published agent always runs its intended model. + +## Built-in Commands + +The TUI ships its own slash commands (`/new`, `/compact`, `/sessions`, `/settings`, …) alongside whatever an agent defines. See [Slash Commands](../../features/tui/index.md#slash-commands) in the TUI reference for the full list. + +## Command Configuration Reference + +| Property | Type | Description | +| --- | --- | --- | +| `description` | string | Shown in completion dialogs and help text. | +| `instruction` | string | The prompt sent to the agent. Supports argument expansion (`${args[0]}`, `${args.join(" ")}`, …), tool calls (`${tool_name({...})}`), and the legacy bang syntax `!tool_name(...)`. | +| `agent` | string | Name of an agent in the team to switch to when this command is invoked — any agent in the team's `agents:` map, not just one of the current agent's `sub_agents`. When set without `instruction`, any text typed after the slash command is forwarded as a prompt to the target agent. | +| `url` | string | URL to open in the user's default browser when this command is invoked, instead of sending a prompt to the agent (full TUI only — see [URL Commands](#url-commands)). The token `{{session_id}}` is replaced at invocation time with the current session ID (URL-query-escaped). | + +`instruction` and `agent` can be combined (the agent is switched first, then the instruction is sent to the new agent). In the full TUI, if `url` is set, it takes precedence over `agent` and `instruction` — the command only opens the browser; the lean TUI and CLI don't check `url` at all, so a URL-only command instead sends its (usually empty) resolved text as a prompt. See [Behavior differs by frontend](#what-slash-commands-are) above. The simple string form is shorthand for `{ instruction: "..." }`. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/flavors/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/flavors/index.md new file mode 100644 index 000000000000..05be0fcf499b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/flavors/index.md @@ -0,0 +1,172 @@ +--- +title: "Flavors" +description: "Ship one agent file with named variants, enabled at run time as YAML patches." +keywords: docker agent, ai agents, configuration, yaml, flavors, patch, variants, overrides +weight: 95 +canonical: https://docs.docker.com/ai/docker-agent/configuration/flavors/ +--- + +_Ship one agent file with named variants, enabled at run time as YAML patches._ + +## Overview + +A flavor is a named YAML patch declared in the agent file itself, under the +top-level `flavors` section. Enabling a flavor applies its patch on top of the +rest of the document before the config is parsed, so one file can carry +several variants — a cheaper model for local runs, extra tools for CI, a more +verbose instruction for debugging — without duplicating the whole config. + +```yaml +agents: + root: + model: claude + instruction: You are a helpful assistant. + +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + +flavors: + cheap: + models: + claude: + model: claude-3-5-haiku-latest +``` + +Enable flavors with the repeatable `--flavor` flag: + +```bash +$ docker agent run agent.yaml --flavor cheap +``` + +The flag works on every command that runs an agent — `run`, `chat`, `eval`, +`serve api`, `serve a2a`, `serve mcp` — and order matters: patches apply in +the order the flavors are requested, each on top of the previous result. + +```bash +$ docker agent run agent.yaml --flavor cheap --flavor verbose +``` + +Flavors the file does not define are ignored (with a debug log), so you can +enable the same flavor set across a fleet of agents and each file only reacts +to the names it declares. External sub-agents loaded from OCI or URL +references receive the same enabled flavors. + +## Merge Semantics + +Patches follow [JSON Merge Patch](https://www.rfc-editor.org/rfc/rfc7386) +semantics, with two extensions for arrays: + +| Patch value | Effect | +| --- | --- | +| Object | Merged recursively into the existing object. | +| Scalar or array | Replaces the existing value. | +| `null` | Deletes the key. | +| Key ending in `+` | Appends the items to the existing array. | +| Key ending in `-` | Removes matching entries from an array or object. | + +### Merging and replacing + +An object patch only touches the keys it names — siblings survive: + +```yaml +flavors: + verbose: + agents: + root: + instruction: Explain your reasoning in detail. # model, tools, ... unchanged +``` + +### Deleting a key + +Set it to `null`: + +```yaml +flavors: + no-limit: + models: + claude: + max_tokens: null +``` + +### Appending to an array + +Plain arrays replace wholesale. To add entries instead, suffix the key +with `+`: + +```yaml +agents: + root: + toolsets: + - type: think + +flavors: + with-shell: + agents: + root: + toolsets+: + - type: shell +``` + +With `--flavor with-shell` the root agent gets both `think` and `shell`. + +### Removing entries + +Suffix the key with `-`. Each item in the patch value selects what to remove: + +- From an **array**: a scalar removes equal elements; an object removes every + element it partially matches (all of the matcher's keys must be present + with matching values). +- From an **object**: items are key names to drop. + +```yaml +flavors: + slim: + agents: + root: + toolsets-: + - type: shell # drop every shell toolset, however configured + sub_agents-: + - checker # drop by value + models-: + - spare # drop the named model definition +``` + +> [!NOTE] +> The `+` and `-` suffixes are reserved inside flavor patches: a patch cannot +> set a literal key ending in either character. Base documents are unaffected. + +## Inspecting the Result + +`docker agent debug config` prints the config exactly as the runtime sees it, +flavors applied: + +```bash +$ docker agent debug config agent.yaml --flavor cheap --flavor with-shell +``` + +## HCL + +Flavors work in [HCL configs](../hcl/index.md) too, as labeled blocks. The +append/remove operators need quoted attribute names inside object +expressions: + +```hcl +flavors "with-shell" { + agents = { + root = { + "toolsets+" = [{ type = "shell" }] + } + } +} +``` + +## Notes + +- Flavors require config schema version 13 or later; older versions reject + the `flavors` key with a hint to bump the top-level `version` field. +- Patches apply before validation, so a flavored config is validated exactly + like a hand-written one. +- `docker agent push` publishes the raw document, `flavors` section included, + so consumers of a pushed agent can enable its flavors too. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/hcl/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/hcl/index.md new file mode 100644 index 000000000000..7a465e47a1c0 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/hcl/index.md @@ -0,0 +1,306 @@ +--- +title: "HCL Configuration" +description: "Write Docker Agent configs in HCL instead of YAML, using labeled blocks, heredocs, and the same underlying schema." +keywords: docker agent, ai agents, configuration, yaml, hcl configuration +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/configuration/hcl/ +--- + +_Write Docker Agent configs in HCL instead of YAML. It maps to the same Docker Agent schema and validation rules._ + +`docker-agent` supports `.hcl` config files anywhere it supports `.yaml` or `.yml` files. HCL is useful if you prefer labeled blocks, less punctuation, and heredocs for long prompts. + +> [!TIP] +> **Same config model, different syntax** +> +> YAML and HCL are just two syntaxes for the same Docker Agent configuration model. Docker Agent converts HCL to the equivalent YAML structure internally, then runs the normal schema validation and loading pipeline. + +## Minimal Example + +```hcl +#!/usr/bin/env docker agent run + +agent "root" { + model = "openai/gpt-5" + description = "A helpful assistant" + instruction = <<-EOT + You are a helpful assistant. + EOT + + toolset "think" {} +} +``` + +Run it exactly like a YAML config: + +```bash +$ docker agent run agent.hcl +$ docker agent run --exec agent.hcl "Summarize this repository" +$ docker agent serve api ./agents/ # directories may mix .yaml, .yml, and .hcl files +``` + +> [!TIP] +> **See also** +> +> HCL changes the syntax, not the meaning of fields. For what each field does, see [Agent Config](../agents/index.md), [Model Config](../models/index.md), and [Tool Config](../tools/index.md). + +## YAML vs HCL + +These two configs are equivalent: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + +agents: + root: + model: claude + description: Coding assistant + instruction: You help with software development. + toolsets: + - type: filesystem + - type: shell +``` + +```hcl +model "claude" { + provider = "anthropic" + model = "claude-sonnet-4-5" +} + +agent "root" { + model = "claude" + description = "Coding assistant" + instruction = "You help with software development." + + toolset "filesystem" {} + toolset "shell" {} +} +``` + +## Core Conventions + +HCL follows a few simple mapping rules: + +| HCL syntax | YAML shape | +| --- | --- | +| `agent "root" { ... }` | `agents.root` | +| `model "claude" { ... }` | `models.claude` | +| `provider "team" { ... }` | `providers.team` | +| `mcp "github" { ... }` | `mcps.github` | +| `rag "docs" { ... }` | `rag.docs` | +| `command "fix" { ... }` inside an agent | `commands.fix` | +| `toolset "shell" {}` | list item in `toolsets` with `type: shell` | +| `metadata { ... }`, `permissions { ... }` | singleton blocks with the same top-level name | + +### Top-level keyed maps become labeled blocks + +In YAML, several sections are maps keyed by name. In HCL, those become labeled blocks: + +```hcl +model "claude" { + provider = "anthropic" + model = "claude-sonnet-4-5" +} + +agent "root" { + model = "claude" + description = "Primary assistant" + instruction = "You are helpful." +} +``` + +The supported top-level labeled blocks are: + +- `agent` +- `model` +- `provider` +- `mcp` +- `rag` + +The supported top-level singleton blocks are: + +- `metadata` +- `permissions` + +### Toolsets use the block label as `type` + +Instead of writing list entries with `type: ...`, HCL uses a `toolset` block whose label becomes the tool type: + +```hcl +agent "root" { + model = "openai/gpt-5" + description = "Dev assistant" + instruction = "You can inspect and modify code." + + toolset "filesystem" {} + + toolset "mcp" { + ref = "docker:github-official" + } +} +``` + +### Commands use labeled blocks too + +Agent commands are often nicer to write in HCL because each command gets its own block: + +```hcl +agent "root" { + model = "openai/gpt-5" + description = "Build helper" + instruction = "You help with builds." + + command "fix-lint" { + description = "Fix lint issues" + instruction = "Run the linter, then fix any problems." + } +} +``` + +## Strings and Heredocs + +Use quoted strings for short values and heredocs for long prompts, welcome messages, or embedded JSON. + +```hcl +agent "root" { + model = "openai/gpt-5" + description = "Friendly assistant" + + instruction = <<-EOT + You are a helpful assistant. + + Keep answers concise and practical. + EOT +} +``` + +### Escaping literal `${...}` + +HCL treats `${...}` inside strings and heredocs as template interpolation. If you need the literal text `${...}` in your prompt, escape it as `$${...}`. + +This matters for command prompts that intentionally show Docker Agent template snippets: + +```hcl +command "fix-lint" { + instruction = <<-EOT + Run the linter and inspect the result: + + $${shell({cmd: "task lint"})} + EOT +} +``` + +The model will receive the literal `${shell({cmd: "task lint"})}` text. + +## Loading Files with `file()` + +The `file()` function reads a UTF-8 text file and returns its contents as a string. Relative paths are resolved from the HCL config file's directory, and reads are restricted to that directory. + +This keeps long prompts out of the config: + +```hcl +agent "root" { + model = "openai/gpt-5" + description = "Coding assistant" + instruction = file("prompts/coding.md") +} +``` + +With a single argument, the file contents are returned exactly as written — any `${...}` in the file stays literal, so runtime snippets like `${shell({cmd: "..."})}` pass through untouched. + +### Rendering files as templates + +Pass an object as the second argument to render the file as an HCL template. Each key becomes a variable available inside the file: + +```hcl +agent "reviewer" { + model = "openai/gpt-5" + description = "Go reviewer" + instruction = file("prompts/reviewer.md", { + language = "Go" + strictness = "high" + }) +} + +agent "py_reviewer" { + model = "openai/gpt-5" + description = "Python reviewer" + instruction = file("prompts/reviewer.md", { + language = "Python" + strictness = "relaxed" + }) +} +``` + +With `prompts/reviewer.md` containing: + +```markdown +You review ${language} code with ${strictness} strictness. +``` + +Templates support the full HCL template syntax, including `%{ for }` and `%{ if }` directives: + +```markdown +Rules: +%{ for rule in rules ~} +- ${rule} +%{ endfor ~} +``` + +Two things to keep in mind: + +- Referencing a variable that is not in the object is an error. +- No functions are available inside templates, so a template cannot call `file()` again. If the file needs a literal `${...}` while being rendered as a template, escape it as `$${...}` inside the file. + +## Repeated Blocks Become Lists + +Some YAML sections are lists. In HCL, those are written as repeated blocks. + +For example, model routing rules become repeated `routing { ... }` blocks: + +```hcl +model "smart_router" { + provider = "openai" + model = "gpt-5" + + routing { + model = "anthropic/claude-sonnet-4-5" + examples = [ + "Write a detailed technical document", + "Review this code for security issues", + ] + } + + routing { + model = "openai/gpt-5" + examples = [ + "Generate some creative ideas", + "Help me brainstorm", + ] + } +} +``` + +The same idea applies to other list-shaped sections such as RAG `strategy` blocks and hook event entries. + +## Important Differences from Terraform + +Docker Agent uses HCL as a configuration syntax, not as Terraform: + +- There are no modules, `locals`, or `variable` blocks. +- The only function available in expressions is [`file()`](#loading-files-with-file); Terraform's function library (including `templatefile()`, which `file()` with a vars object replaces) is not available. +- Prefer normal literal values: strings, numbers, booleans, lists, objects, and nested blocks. +- After conversion, the result is validated exactly like the equivalent YAML config. + +If you already know Terraform, think of Docker Agent HCL as a thin block-based syntax over the existing config schema. + +## Examples + +See these real configs in the repository: + +- [`examples/pirate.hcl`](https://github.com/docker/docker-agent/blob/main/examples/pirate.hcl) +- [`examples/gopher.hcl`](https://github.com/docker/docker-agent/blob/main/examples/gopher.hcl) +- [`examples/instructions_from_file.hcl`](https://github.com/docker/docker-agent/blob/main/examples/instructions_from_file.hcl) diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/hooks/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/hooks/index.md new file mode 100644 index 000000000000..34efe9d2b8e4 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/hooks/index.md @@ -0,0 +1,952 @@ +--- +title: "Hooks" +description: "Run shell commands at various points during agent execution for deterministic control over behavior." +keywords: docker agent, ai agents, configuration, yaml, hooks +weight: 60 +canonical: https://docs.docker.com/ai/docker-agent/configuration/hooks/ +--- + +_Run shell commands at various points during agent execution for deterministic control over behavior._ + +## Overview + +Hooks allow you to execute shell commands or scripts at key points in an agent's lifecycle. They provide deterministic control that works alongside the LLM's behavior, enabling validation, logging, environment setup, and more. + +> [!NOTE] +> **Use Cases** +> +> - Validate or transform tool inputs before execution +> - Log all tool calls to an audit file +> - Block dangerous operations based on custom rules +> - Validate, redact, or enrich user prompts before they reach the model +> - Programmatically approve or deny tool calls without prompting the user +> - Steer or veto context-window compaction +> - Audit sub-agent handoffs in multi-agent setups +> - Set up the environment when a session starts +> - Clean up resources when a session ends +> - Log or validate model responses before returning to the user +> - Send external notifications on agent errors or warnings + +## Hook Types + +Docker Agent dispatches the following hook events: + +| Event | When it fires | Can block? | +| --------------------------- | --------------------------------------------------------------------------------- | ---------- | +| `pre_tool_use` | Before a tool call executes | Yes | +| `tool_response_transform` | Between a tool's execution and the runtime's emission/record of the response | No | +| `post_tool_use` | After a tool completes — fires for both success and failure | Yes | +| `permission_request` | Just before the runtime would prompt the user to approve a tool | Yes | +| `session_start` | When a session begins or resumes | No | +| `user_prompt_submit` | Once per user message, after submission and before the model runs | Yes | +| `user_steering_messages_submit` | Each time queued steering messages are drained (mid-turn, after stop, or while idle) | Yes | +| `user_followup_submit` | Each time a queued follow-up message starts a fresh turn (end-of-turn) | Yes | +| `turn_start` | At the start of every agent turn (each model call) | No | +| `turn_end` | At the end of every agent turn — fires no matter why the turn ended | No | +| `before_llm_call` | Just before every model call (after `turn_start`) | Yes | +| `after_llm_call` | After every successful model call, before the response is recorded | No | +| `session_end` | When a session terminates | No | +| `pre_compact` | Just before the runtime compacts the session transcript | Yes | +| `before_compaction` | Just before a compaction runs — can veto or supply a custom summary | Yes | +| `after_compaction` | After a successful compaction (summary applied to the session) | No | +| `subagent_stop` | When a sub-agent (transferred task / background / skill sub-session) finishes | No | +| `on_user_input` | When the agent is waiting for user input | No | +| `stop` | When the model finishes responding | No | +| `notification` | When the agent emits a notification (error or warning) | No | +| `on_error` | When the runtime hits an error during a turn (fires alongside `notification`) | No | +| `on_max_iterations` | When the runtime reaches its configured `max_iterations` limit | No | +| `on_agent_switch` | When the runtime moves the active agent (transfer_task, handoff, return) | No | +| `on_session_resume` | When the user explicitly approves continuation past `max_iterations` | No | +| `on_tool_approval_decision` | After the runtime's approval chain (permissions / yolo / readonly / ask) resolves | No | +| `worktree_create` | After `docker agent run --worktree` creates a git worktree, before the session | Yes | + +> [!NOTE] +> **Two compaction events** +> +> `pre_compact` and `before_compaction` both fire just before a compaction. `pre_compact` is the original event and is best-suited to _steering_ the LLM-generated summary by appending guidance via `additional_context`. `before_compaction` is the newer, structured event: it carries the input/output token counts, the model's context limit, and a `compaction_reason` so handlers can decide based on real session pressure, and it can _replace_ the LLM-generated summary verbatim via `hook_specific_output.summary`. + +## Configuration + +You can configure hooks directly in an agent YAML file under the agent's `hooks:` block: + +```yaml +agents: + root: + model: openai/gpt-4o + description: An agent with hooks + instruction: You are a helpful assistant. + hooks: + # Run before specific tools + pre_tool_use: + - matcher: "shell|edit_file" + hooks: + - type: command + command: "./scripts/validate-command.sh" + timeout: 30 + + # Run after all tool calls + post_tool_use: + - matcher: "*" + hooks: + - type: command + command: "./scripts/log-tool-call.sh" + + # Run when session starts + session_start: + - type: command + command: "./scripts/setup-env.sh" + + # Run when session ends + session_end: + - type: command + command: "./scripts/cleanup.sh" + + # Run when agent is waiting for user input + on_user_input: + - type: command + command: "./scripts/notify.sh" + + # Run when the model finishes responding + stop: + - type: command + command: "./scripts/log-response.sh" + + # Run on agent errors and warnings + notification: + - type: command + command: "./scripts/alert.sh" +``` + +Each event takes a list of hooks. A single hook can also be written directly +as a mapping, without the list dash: + +```yaml +stop: + type: command + command: "./scripts/log-response.sh" +``` + +## Global (user-level) hooks + +Global hooks let you apply the same hook configuration to every agent you run. Define them in your user config file at `~/.config/cagent/config.yaml` under `settings.hooks`: + +```yaml +# ~/.config/cagent/config.yaml +settings: + hooks: + session_start: + - type: command + command: "~/.config/cagent/hooks/session-start.sh" + pre_compact: + - type: command + command: "~/.config/cagent/hooks/pre-compact.sh" + pre_tool_use: + - matcher: "shell" + hooks: + - type: command + command: "~/.config/cagent/hooks/check-shell.sh" +``` + +Global hooks use the same schema as agent-level hooks and are additive. If an event is configured in multiple places, all matching hooks run in this order: + +1. Agent-config hooks from the agent YAML +2. Global hooks from `settings.hooks` +3. Hook drop-ins from `<config-dir>/hooks.d/` (lexicographic file order) +4. CLI hooks from `--hook-*` flags + +Global hooks cannot be suppressed by an individual agent. Use them for user-wide audit logging, personal guardrails, notifications, and setup/cleanup behavior that should apply everywhere. + +### Hook drop-in files (`hooks.d`) + +External tools that integrate with Docker Agent (terminal emulators, IDEs, audit or observability sidecars) shouldn't have to rewrite your `config.yaml` to install a hook. Instead, Docker Agent also loads every `*.yaml` / `*.yml` file from the `hooks.d` directory next to your user config (default: `~/.config/cagent/hooks.d/`). Each file is a standalone hooks block with the same schema as the content of `settings.hooks`: + +```yaml +# ~/.config/cagent/hooks.d/50-mytool.yaml +session_start: + - type: command + command: mytool notify --event session-start +stop: + - type: command + command: mytool notify --event stop +``` + +- Files are loaded in lexicographic order and merged additively after `settings.hooks` (use numeric prefixes like `10-`, `50-` to control ordering). +- A malformed file is skipped with a logged warning; a broken drop-in never breaks a run. +- Installing an integration means writing one self-contained file; uninstalling means deleting it. No shared-file edits, no conflicts between tools. + +The config directory can be relocated with the `--config-dir` flag or the `DOCKER_AGENT_CONFIG_DIR` (legacy `CAGENT_CONFIG_DIR`) environment variable, which external tools can use to locate `hooks.d` under non-default config dirs. + +## Built-in Hooks + +In addition to shell `command` hooks, Docker Agent ships a small library of **built-in hooks** — in-process Go functions that run without spawning a subprocess. They're invoked with `type: builtin`, where `command` is the builtin's registered name and `args` are passed through as the builtin's parameters. + +```yaml +hooks: + turn_start: + - type: builtin + command: add_date + - type: builtin + command: add_prompt_files + args: + - GUIDELINES.md + - PROJECT.md + session_start: + - type: builtin + command: add_environment_info + before_llm_call: + - type: builtin + command: max_iterations + args: ["50"] +``` + +Built-ins are typically zero-config and faster than equivalent shell hooks because they don't fork a process. They cover the common "inject context into every turn / session" patterns out of the box. + +### Available built-ins + +| Builtin | Event | Args | What it does | +| ----------------------- | ----------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `add_date` | `turn_start` | _none_ | Prepends `Today's date: YYYY-MM-DD` so the model always knows the current date. | +| `add_environment_info` | `session_start` | _none_ | Adds the working directory, git-repo status, OS, and CPU architecture. | +| `add_prompt_files` | `turn_start` | `[file1, file2, ...]` | Reads each named file from the workdir hierarchy (walking up) and the home directory, and appends their contents. | +| `add_git_status` | `turn_start` | _none_ | Adds the output of `git status --short --branch` (no-op outside a git repo or when git isn't installed). | +| `add_git_diff` | `turn_start` | _none_, or `["full"]` | Adds `git diff --stat` by default. Pass `args: ["full"]` to emit the full unified diff. Output is capped to 4 KB. | +| `add_directory_listing` | `session_start` | _none_ | Adds an alphabetical listing of the cwd's top-level entries (skips dot-files, capped at 100 with a "... and N more"). | +| `add_user_info` | `session_start` | _none_ | Adds the current OS user (username and full name) and the hostname. | +| `add_recent_commits` | `session_start` | _none_, or `["<N>"]` | Adds `git log --oneline -n N`. `N` defaults to 10; pass a positive integer to override. | +| `max_iterations` | `before_llm_call` | `["<N>"]` (required) | Hard-stops the agent after `N` model calls. Stateless: the runtime supplies the iteration counter on every dispatch. | +| `snapshot` | `session_start`, `turn_start`, `turn_end`, `pre_tool_use`, `post_tool_use`, `session_end` | _none_ | Records filesystem snapshots in a shadow git repo under the Docker Agent data directory. No-op outside git repos; respects the source repo's ignore rules and skips newly-added files larger than 2 MiB. | +| `redact_secrets` | `pre_tool_use`, `before_llm_call`, `tool_response_transform` | _none_ | Scrubs detected secrets (API keys, tokens, private keys, …) out of tool call arguments, outgoing chat content, and tool output. The same builtin handles all three events and dispatches on the event name. Auto-registered on all three events by `redact_secrets: true` on the agent — see [`examples/redact_secrets_hooks.yaml`](https://github.com/docker/docker-agent/blob/main/examples/redact_secrets_hooks.yaml) for the manual wiring. | +| `limit_large_tool_results` | `tool_response_transform`, `session_end` | _none_ | **Always-on safety hook** — automatically injected by the runtime, no configuration required. When a tool result from the `filesystem`, `shell`, `mcp`, or `a2a` categories exceeds 2,000 lines or 50 KiB, the full payload is written to a per-session temp file and replaced in the conversation with a notice plus a bounded excerpt (2,000 lines, up to 50 KiB): the tail for most tools, but the head for the built-in filesystem `read_file`, whose notice suggests a follow-up call with `line`/`limit` to continue reading. The `session_end` leg deletes the temp directory. Internal toolsets (`memory`, `plan`, `tasks`, `think`, …) are not affected. | +| `safer_shell` | `pre_tool_use` | _none_ | **Deprecated compatibility shim.** The runtime now classifies every shell command natively (`safe` / `destructive` / `unknown`) and gates it through the session's [safety mode](../permissions/index.md#safety-modes), so this builtin no longer emits verdicts. Pinned entries keep working as pure labellers that attach classification metadata (`safety_label`, `blast_radius`, `category`, `reason`) to the call. Filters by tool name internally (no-op for non-shell calls). | +| `unload` | `on_agent_switch` | _none_ | POSTs `{"model": "<id>"}` to each of the previous agent's DMR model endpoints (`/_unload` by default, overridable per-model via `unload_api`) to free the GPU/RAM the just-departing model was holding. Pure HTTP — reads the model snapshot the runtime ships on `on_agent_switch` and depends on no provider-specific runtime state. Non-DMR providers (OpenAI, Anthropic, …) are silently skipped, so cross-provider chains are safe. Errors are logged and swallowed; agent switching never blocks on a slow or unreachable engine (each call has a 10 s timeout). See [`examples/unload_on_switch.yaml`](https://github.com/docker/docker-agent/blob/main/examples/unload_on_switch.yaml). | + +> [!NOTE] +> **Per-turn vs. per-session** +> +> `turn_start` built-ins recompute every turn and contribute **transient** context that is _not_ persisted to the session — perfect for fast-moving signals like the date or current git state. `session_start` built-ins run once per session and their context **persists** across turns and resumes — pick this for stable context like the OS user or the initial directory listing. + +> [!NOTE] +> **Auto-injected built-ins** +> +> The agent flags `add_date: true`, `add_environment_info: true`, `add_prompt_files: [...]`, and `redact_secrets: true` are shorthands that auto-register the matching built-in hook. You don't need to repeat them under `hooks:` — set the flag _or_ the hook entry(ies), not both. `redact_secrets: true` auto-registers the same builtin on all three of `pre_tool_use`, `before_llm_call`, and `tool_response_transform`; you can also wire any subset of them by hand for finer-grained control (per-tool matchers, ordering with other rewriters, …). +> +> `limit_large_tool_results` is injected unconditionally by the runtime — it is always active and cannot be removed from config. + +A minimal snapshot wiring looks like this: + +```yaml +hooks: + turn_start: + - type: builtin + command: snapshot + turn_end: + - type: builtin + command: snapshot + session_end: + - type: builtin + command: snapshot +``` + +The shadow repository stores tree objects only; it never writes commits or touches the source repository's `.git` directory. The source repository's `.gitignore` and `info/exclude` rules are mirrored before each capture so ignored files do not appear in snapshots. The built-in only records undo checkpoints when files changed, so a final no-op model response does not hide the last changed snapshot. + +You can also enable snapshots globally for every agent with user config: + +```yaml +settings: + snapshot: true +``` + +Omit `snapshot` or set it to `false` to leave automatic snapshots off; manually configured snapshot hooks still run. + +See [`examples/snapshot_hooks.yaml`](https://github.com/docker/docker-agent/blob/main/examples/snapshot_hooks.yaml) for a complete snapshot hook configuration. For an overview of the snapshot feature and the `/undo` / `/snapshots` commands, see [Snapshots](../../features/snapshots/index.md). + +> [!WARNING] +> **Two flavors of `max_iterations`** +> +> The `max_iterations` agent field has its own UX (it pauses and asks the user to resume past the limit). The `max_iterations` built-in hook is a **hard stop with no resume** — when its counter trips, the agent terminates with a block decision. Use the agent field for interactive sessions and the built-in hook to enforce non-negotiable caps in unattended runs. + +## Matcher Patterns + +The `matcher` field uses regex patterns to match tool names: + +| Pattern | Matches | +| ------------------ | ----------------------------- | +| `*` | All tools | +| `shell` | Only the `shell` tool | +| `shell\|edit_file` | Either `shell` or `edit_file` | +| `mcp:.*` | All MCP tools (regex) | + +## Hook Input + +Hooks receive JSON input via stdin with context about the event: + +```json +{ + "session_id": "abc123", + "cwd": "/path/to/project", + "hook_event_name": "pre_tool_use", + "tool_name": "shell", + "tool_use_id": "call_xyz", + "tool_input": { + "cmd": "rm -rf /tmp/cache", + "cwd": "." + } +} +``` + +### Common Fields + +Every hook event carries: + +| Field | Description | +| ----------------- | ------------------------------------- | +| `session_id` | The current session's ID. | +| `cwd` | The runtime's working directory. | +| `hook_event_name` | The event name (e.g. `pre_tool_use`). | + +### Per-Event Extra Fields + +In addition to the common fields, each event ships its own payload: + +| Event | Extra fields | +| --------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `pre_tool_use` | `agent_name`, `tool_name`, `tool_use_id`, `tool_input` | +| `tool_response_transform` | `tool_name`, `tool_use_id`, `tool_input`, `tool_response` | +| `post_tool_use` | `agent_name`, `tool_name`, `tool_use_id`, `tool_input`, `tool_response`, `tool_error` | +| `permission_request` | `agent_name`, `tool_name`, `tool_use_id`, `tool_input` | +| `session_start` | `source` — one of `startup`, `resume`, `clear`, `compact` | +| `user_prompt_submit` | `prompt` — the text the user just submitted | +| `user_steering_messages_submit` | `steering_messages` — the drained steering messages, in submission order | +| `user_followup_submit` | `prompt` — the text of the dequeued follow-up message | +| `turn_start` | _none_ (just the common fields) | +| `turn_end` | `agent_name`, `reason` — one of `normal`, `continue`, `steered`, `error`, `canceled`, `hook_blocked`, `loop_detected` | +| `before_llm_call` | `iteration` — 1-based run-loop iteration counter (the model call this hook is gating), `model_id` | +| `after_llm_call` | `agent_name`, `stop_response`, `last_user_message`, `model_id`, `usage`, `cost` | +| `session_end` | `reason` — one of `clear`, `logout`, `prompt_input_exit`, `other` | +| `pre_compact` | `source` — one of `manual`, `auto`, `overflow`, `tool_overflow` | +| `before_compaction` | `input_tokens`, `output_tokens`, `context_limit`, `compaction_reason` (one of `threshold`/`overflow`/`manual`) | +| `after_compaction` | `input_tokens`, `output_tokens`, `context_limit`, `compaction_reason`, `summary` | +| `subagent_stop` | `agent_name` (the sub-agent), `parent_session_id`, `stop_response` | +| `on_user_input` | _none_ | +| `stop` | `agent_name`, `stop_response`, `last_user_message` | +| `notification` | `notification_level` (`error` or `warning`), `notification_message` | +| `on_error` | `notification_level` (always `error`), `notification_message` | +| `on_max_iterations` | `notification_level` (always `warning`), `notification_message` | +| `on_agent_switch` | `from_agent`, `to_agent`, `agent_switch_kind` (`transfer_task`, `transfer_task_return`, `handoff`, or `force_handoff`) | +| `on_session_resume` | `previous_max_iterations`, `new_max_iterations` | +| `on_tool_approval_decision` | `tool_name`, `tool_use_id`, `tool_input`, `approval_decision`, `approval_source` | +| `worktree_create` | `worktree_path`, `worktree_branch`, `worktree_source_dir` (`cwd` is also set to the new worktree) | + +Notes: + +- `tool_response` for `post_tool_use` carries the tool's result; `tool_error` is `true` when the tool failed (the failure detail is surfaced inside `tool_response`). +- `agent_name` on `pre_tool_use`, `post_tool_use`, and `permission_request` identifies the agent that issued the tool call — in multi-agent setups this follows the active sub-agent, not always the root agent. +- `prompt` is only populated for `user_prompt_submit`. Sub-sessions (transferred tasks, background agents, skills) do **not** fire this event because their kick-off message is synthesised by the runtime, not authored by the user. +- `steering_messages` is only populated for `user_steering_messages_submit`. It carries the user messages the runtime just drained from the steering queue — messages submitted while the agent was already working (mid-turn, after the model stopped, or while idle before the first model call). +- `prompt` is also populated for `user_followup_submit`, carrying the text of the dequeued follow-up message (a user message queued for end-of-turn processing via the FollowUp API / queue, as opposed to mid-turn steering). +- `stop_response` carries the model's final assistant text for `stop`, `after_llm_call`, and `subagent_stop`. `last_user_message` carries the latest user message at dispatch time. +- `model_id` is populated for `after_llm_call` (and `before_llm_call`) in the canonical `<provider>/<model>` form (e.g. `anthropic/claude-sonnet-4-5`). For harness agents, `model_id` is the harness label (e.g. `claude-code`) rather than a canonical model name — see [Coding Harnesses](../../features/harnesses/index.md). +- `usage` and `cost` are populated for `after_llm_call` only. `usage` is the per-call token usage object (`input_tokens`, `output_tokens`, `cached_input_tokens`, `cached_write_tokens`, and `reasoning_tokens` — the last is itself omitted for non-reasoning models); the whole object is absent when the provider reported no usage. `cost` is the USD price of that one model response. For a **native model call** it is the price computed from `usage` and the model's pricing table, and equals the cost the session records for the turn: it is **absent** when the response is unpriced (no pricing data on file, or no usage) and an explicit `0` for a priced call that was free — so a present `cost` is authoritative and an absent one means "unpriced", with no need to cross-check `usage`. Models the catalogue does not price (custom endpoints, local models) can be priced explicitly with the model-level [`cost`](../models/index.md#custom-token-pricing) config. (For harness agents the meaning differs — see the next note.) A cost ledger can therefore record per-call spend from the payload alone, without subscribing to the runtime event channel. +- For [harness agents](../../features/harnesses/index.md), `cost` is the harness's own reported total for the call rather than a computed price, and is present only when the harness reported a non-zero cost (some harnesses, e.g. `codex`, report token counts but no cost — those turns carry `usage` with `cost` absent, even though the recorded message stores `0`). +- `after_llm_call` fires for **every** model call, including calls made inside sub-sessions (transferred tasks, background agents, skills). For those, `session_id` is the sub-session's id. Summing `cost` across `after_llm_call` events therefore captures **all** spend, including sub-sessions (and even sub-sessions that error before their cost is persisted). Do **not** add a separately-queried session cost total on top: the runtime's own total already recurses into and includes completed sub-session spend, so combining the two double-counts. Pick one source — the summed hook costs — as the authoritative ledger. +- `context_limit` is `0` when the model definition is unavailable (treat `0` as "unknown", not as a real limit). +- `approval_decision` is one of `allow`, `deny`, `canceled`. `approval_source` is a stable classifier of which step decided (e.g. `yolo`, `session_permissions_allow`, `session_permissions_deny`, `team_permissions_allow`, `team_permissions_deny`, `pre_tool_use_hook_allow`, `pre_tool_use_hook_deny`, `readonly_hint`, `user_approved`, `user_approved_session`, `user_approved_safe`, `user_approved_tool`, `user_rejected`, `context_canceled`). + +## Hook Output + +Hooks communicate back via JSON output to stdout: + +```json +{ + "continue": true, + "stop_reason": "Optional message when continue=false", + "suppress_output": false, + "system_message": "Warning message to show user", + "decision": "block", + "reason": "Explanation for the decision", + "hook_specific_output": { + "hook_event_name": "pre_tool_use", + "permission_decision": "allow", + "permission_decision_reason": "Command is safe", + "updated_input": { "cmd": "modified command" } + } +} +``` + +All fields are optional. Returning `{}` (or no output at all) means "do nothing, continue normally". + +### Output Fields + +| Field | Type | Description | +| ----------------- | ------- | ----------------------------------------------- | +| `continue` | boolean | Whether to continue execution (default: `true`) | +| `stop_reason` | string | Message to show when `continue=false` | +| `suppress_output` | boolean | Hide stdout from transcript | +| `system_message` | string | Warning message to display to user | +| `decision` | string | For blocking: `block` to prevent operation | +| `reason` | string | Explanation for the decision | + +### Pre-Tool-Use / Permission-Request Specific Output + +The `hook_specific_output` for `pre_tool_use` (and `permission_request`) supports: + +| Field | Type | Description | +| ---------------------------- | ------ | --------------------------------------- | +| `permission_decision` | string | `allow`, `deny`, or `ask` | +| `permission_decision_reason` | string | Explanation for the decision | +| `updated_input` | object | Modified tool input (replaces original) | +| `metadata` | object | (`permission_request` and `pre_tool_use` entries with `preempt_yolo: true` only) string key/value annotations merged onto the tool-call confirmation prompt — see below | + +### Preempting auto-approval from `pre_tool_use` + +`pre_tool_use` entries default to firing AFTER the deterministic approval +pipeline (custom allow rules / safety mode), so an auto-approved call +skips them entirely. For security-critical checks that MUST run on every +call regardless of the safety mode (including `autonomous`, the legacy +`--yolo`), set `preempt_yolo: true` on the matcher entry: + +```yaml +hooks: + pre_tool_use: + - matcher: "*" + preempt_yolo: true + hooks: + - type: command + command: ./security-check.sh +``` + +The entry then fires in a dedicated stage 0 BEFORE `Decide()`: + +- `deny` rejects the call outright; the user is not prompted. +- `ask` forces user confirmation. The default `pre_tool_use` lane and + `permission_request` are skipped on this path so a policy-level + allow there can't override the security verdict. The one exception + is a session-scoped allow grant (the interactive "always allow this + tool" decision) — an informed user opt-in made in response to this + very prompt. +- `allow` is advisory — the pipeline still runs `Decide()` and the + rest of `pre_tool_use`. Same shape as a regular `allow` on the + default lane, just observed earlier. +- No verdict (empty `permission_decision`) falls through. + +Hook crashes on a `preempt_yolo: true` entry fail closed (deny), matching +the default `pre_tool_use` posture. + +Preempting entries can attach structured context via +`hook_specific_output.metadata` (`map[string]string`). The runtime merges +that into the tool-call confirmation event, on top of the metadata it +already derives from its own safety classification (`safety_label`, +`blast_radius`, `category`, `reason`). Key conventions with special +rendering in the TUI confirmation prompt: + +- `safety_label` — the three-value taxonomy: `safe`, `destructive`, or + `unknown`. +- `blast_radius` — one of `safe`, `low`, `medium`, `high`, `unknown`. + Rendered as a colored severity badge (green / yellow / red / muted). +- `category` — taxonomy tag (e.g. `fs-delete`, `dk-volume-del`). + +Plus a free-form `reason` key that the dialog shows as supporting +context. Other keys render as plain text. Last writer wins on key +clashes across hooks, and preempting entries win over the runtime's own +classification. + +### Tool-Response-Transform Specific Output + +The `hook_specific_output` for `tool_response_transform` supports: + +| Field | Type | Description | +| ----------------------- | ------ | --------------------------------------------- | +| `updated_tool_response` | string | Rewritten tool output (replaces the original) | + +This is the symmetric counterpart of `pre_tool_use`'s `updated_input`, applied to tool **results** instead of tool **arguments**. The rewrite reaches every downstream consumer — event subscribers, the persisted session file, the `post_tool_use` hook input, and the next LLM call. Use it to truncate excessive output, scrub PII, or normalise tool dialects. The built-in `redact_secrets` registers itself on this event as the third leg of the redact_secrets feature. + +### Context-Contributing Events + +For `session_start`, `user_prompt_submit`, `user_steering_messages_submit`, `user_followup_submit`, `turn_start`, `post_tool_use`, `pre_compact`, and `stop`, hooks may set `hook_specific_output.additional_context` to inject text into the conversation. `turn_start` context is **transient** (recomputed every turn, never persisted); `session_start` context **persists** for the life of the session. `user_steering_messages_submit` and `user_followup_submit` context is **transient** like `user_prompt_submit` — it is spliced into the steered/follow-up turn only and never persisted. (`worktree_create` also surfaces stdout, but to the CLI user rather than the conversation — the session doesn't exist yet.) + +### Before-Compaction Specific Output + +For `before_compaction`, the `hook_specific_output.summary` field, when non-empty, replaces the LLM-generated compaction summary. The runtime applies the string verbatim and skips the model call. + +```json +{ + "hook_specific_output": { + "hook_event_name": "before_compaction", + "summary": "User asked to refactor pkg/foo. Done in commit abc123." + } +} +``` + +Returning `decision: "block"` (or exit code 2) instead vetoes the compaction entirely. Be cautious about denying when `compaction_reason` is `overflow`: the runtime is recovering from a context-overflow error and a denial there will leave the session unable to make progress. + +### Plain Text Output + +For `session_start`, `user_prompt_submit`, `user_steering_messages_submit`, `user_followup_submit`, `turn_start`, `post_tool_use`, `pre_compact`, and `stop` hooks, plain text written to stdout (i.e., output that is not valid JSON) is captured as additional context for the agent. For `pre_compact` it is appended to the compaction prompt; for the others it is spliced into the conversation as a (transient or persisted) system message depending on the event. + +## Exit Codes + +Hook exit codes have special meaning: + +| Exit Code | Meaning | +| --------- | -------------------------------------- | +| `0` | Success — continue normally | +| `2` | Blocking error — stop the operation | +| Other | Error — logged but execution continues | + +## Per-hook options + +Hooks have a default timeout of 60 seconds. You can also give hooks a name, add environment variables, choose a working directory, and control how non-security hook failures behave: + +```yaml +hooks: + post_tool_use: + - matcher: "shell" + hooks: + - name: "summarize shell output" + type: command + command: "./summarize.sh" + timeout: 120 # 2 minutes + working_dir: ./hooks + env: + PROFILE: dev + on_error: warn # warn | ignore | block +``` + +`pre_tool_use` is fail-closed for safety: a failed pre-tool hook blocks the tool call regardless of `on_error`. + +`working_dir` and `env` apply to `command` and `builtin` hooks. For `builtin` hooks, `working_dir` is resolved with the same logic as `command` hooks (absolute path wins; relative paths join onto the executor directory). `working_dir` accepts `~`, `$VAR`, `${VAR}` and `${env.VAR}`; `env` values expand only the plain `${env.VAR}` form (resolved from the OS process environment), keeping any other `$` literal (see [Variable Expansion in Config Fields](../overview/index.md#variable-expansion-in-config-fields)). A `working_dir` that expands to an empty string (e.g. an unset variable) falls back to the executor's directory with a warning. For `model` hooks, both fields are accepted by the schema but have no effect: model hooks render a prompt template and call the LLM API directly — no subprocess is spawned and no file I/O is performed, so working directory and environment variables have no applicable semantics. + +> [!WARNING] +> **Performance** +> +> Hooks run synchronously and can slow down agent execution. Keep hook scripts fast and efficient. Consider using `suppress_output: true` for logging hooks to reduce noise. + +> [!NOTE] +> **Session End and Cancellation** +> +> `session_end` hooks are designed to run even when the session is interrupted (e.g., Ctrl+C). They are still subject to their configured timeout. + +## Examples + +### Validation Script + +A simple pre-tool-use hook that blocks dangerous shell commands: + +```bash +#!/bin/bash +# scripts/validate-command.sh + +# Read JSON input from stdin +INPUT=$(cat) +TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name') +CMD=$(echo "$INPUT" | jq -r '.tool_input.cmd // empty') + +# Block dangerous commands +if [[ "$TOOL_NAME" == "shell" ]]; then + if [[ "$CMD" =~ ^sudo ]] || [[ "$CMD" =~ rm.*-rf ]]; then + echo '{"decision": "block", "reason": "Dangerous command blocked by policy"}' + exit 2 + fi +fi + +# Allow everything else (returning {} means "do nothing, continue normally") +echo '{}' +exit 0 +``` + +### Audit Logging + +A post-tool-use hook that logs all tool calls: + +```bash +#!/bin/bash +# scripts/log-tool-call.sh + +INPUT=$(cat) +TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") +TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name') +SESSION_ID=$(echo "$INPUT" | jq -r '.session_id') + +# Append to audit log +echo "$TIMESTAMP | $SESSION_ID | $TOOL_NAME" >> ./audit.log + +# Don't block execution +echo '{"continue": true}' +exit 0 +``` + +### Session Lifecycle + +Session start and end hooks for environment setup and cleanup: + +```yaml +hooks: + session_start: + - type: command + timeout: 10 + command: | + INPUT=$(cat) + SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // "unknown"') + echo "Session $SESSION_ID started at $(date)" >> /tmp/agent-session.log + echo '{"hook_specific_output":{"additional_context":"Session initialized."}}' + + session_end: + - type: command + timeout: 10 + command: | + INPUT=$(cat) + SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // "unknown"') + REASON=$(echo "$INPUT" | jq -r '.reason // "unknown"') + echo "Session $SESSION_ID ended ($REASON) at $(date)" >> /tmp/agent-session.log +``` + +### Response Logging with Stop Hook + +Log every model response for analytics or compliance: + +```yaml +hooks: + stop: + - type: command + timeout: 10 + command: | + INPUT=$(cat) + SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // "unknown"') + RESPONSE_LENGTH=$(echo "$INPUT" | jq -r '.stop_response // ""' | wc -c | tr -d ' ') + echo "[$(date)] Session $SESSION_ID - Response: $RESPONSE_LENGTH chars" >> /tmp/agent-responses.log +``` + +The `stop` hook is useful for: + +- **Response quality checks** — validate that responses meet criteria before returning +- **Analytics** — track response lengths, patterns, or content +- **Compliance logging** — record all agent outputs for audit + +### Error Notifications + +Send alerts when the agent encounters errors: + +```yaml +hooks: + notification: + - type: command + timeout: 10 + command: | + INPUT=$(cat) + LEVEL=$(echo "$INPUT" | jq -r '.notification_level // "unknown"') + MESSAGE=$(echo "$INPUT" | jq -r '.notification_message // "no message"') + echo "[$(date)] [$LEVEL] $MESSAGE" >> /tmp/agent-notifications.log +``` + +The `notification` hook fires when: + +- The model returns an error (all models failed) — also fires `on_error` +- A degenerate tool call loop is detected — also fires `on_error` +- The maximum iteration limit is reached — also fires `on_max_iterations` + +Use `on_error` and `on_max_iterations` instead of `notification` when you want a structured handler for one of these conditions without parsing `notification_level`. + +### Turn-Start: per-turn context + +`turn_start` fires at the start of every agent turn (each model call). Anything you contribute via `additional_context` (or plain stdout) is appended as a **transient** system message for that turn only — it is *not* persisted to the session. Use it for fast-moving signals like the date, current git state, or per-turn prompt files. The built-in hooks `add_date`, `add_prompt_files`, `add_git_status`, and `add_git_diff` all target this event. + +### Turn-End: per-turn finalizer + +`turn_end` is the symmetric counterpart of `turn_start`. It fires once per turn when the iteration finishes — no matter why. The runtime guarantees the dispatch on every exit path (a normal stop, an error, a hook-driven shutdown, the loop detector, even context cancellation), and it uses `context.WithoutCancel` internally so handlers run to completion on Ctrl+C. + +The `reason` field classifies the exit: + +| `reason` | When | +| --------------- | ------------------------------------------------------------ | +| `normal` | Model finished cleanly with no follow-up | +| `continue` | More iterations to come (e.g. tool calls, follow-up message) | +| `steered` | Drained steered messages prompted a re-entry | +| `error` | Model call failed (`handleStreamError` exited the loop) | +| `canceled` | Context was cancelled (e.g. Ctrl+C) | +| `hook_blocked` | `before_llm_call` or `post_tool_use` denied the call | +| `loop_detected` | The consecutive-tool-call loop detector terminated the turn | + +`turn_end` is observational — the result is ignored. Use it to time turns, accumulate per-turn metrics (token usage, tool counts), or notify external observability pipelines symmetrically with `turn_start`. + +### Before/After-LLM-Call: budget guards and model auditing + +`before_llm_call` fires immediately before every model call (after `turn_start` has assembled the messages). It cannot contribute context — use `turn_start` for that — but it can **stop the run** by returning `decision: block` (or exit code 2). The built-in `max_iterations` hook implements a hard cap on top of this event. + +`after_llm_call` fires immediately after each successful model call, before the response is recorded into the session and tool calls are dispatched. The assistant text is in `stop_response`, and the call's `usage` and `cost` carry the per-turn token usage and computed USD spend (see the field notes above). Use it for response auditing, redaction logging, quality metrics, or a sidecar cost ledger that records per-call spend without subscribing to the runtime event channel. Failed model calls fire `on_error` instead. + +### Before/After-Compaction: structured compaction control + +`before_compaction` fires immediately before a compaction. Unlike `pre_compact`, it carries structured token-pressure data: `input_tokens`, `output_tokens`, `context_limit`, and a `compaction_reason` (`threshold`, `overflow`, or `manual`). Hooks can either: + +- veto compaction by returning `decision: block` (the runtime skips compaction entirely), or +- replace the LLM-generated summary by returning `hook_specific_output.summary` (the runtime applies that summary verbatim and skips the model call). + +`after_compaction` fires after a successful compaction. It carries the produced `summary` along with the *pre-compaction* `input_tokens` / `output_tokens` so observability handlers can naturally express "compacted from X to Y". `after_compaction` is purely observational; output is ignored. + +### Agent-Switch and Session-Resume: observability for multi-agent and long runs + +`on_agent_switch` fires whenever the runtime moves the active agent to a new one — `transfer_task`, `handoff`, `force_handoff`, or the return after a transferred task completes. The cause is in `agent_switch_kind`, the source and destination in `from_agent` and `to_agent`. Use it for audit, transcript, and metrics pipelines that track which agent ran which tools. + +The built-in [`unload`](#available-built-ins) hooks into this event to release the resources held by the previous agent's models. It's the canonical way to run two heavy local models on a GPU that can only fit one at a time: + +```yaml +agents: + coder: + model: qwen3-large + handoffs: [reviewer] + hooks: + on_agent_switch: + - type: builtin + command: unload + reviewer: + model: qwen3-coder + handoffs: [coder] + hooks: + on_agent_switch: + - type: builtin + command: unload + +models: + qwen3-large: + provider: dmr + model: ai/qwen3-large + qwen3-coder: + provider: dmr + model: ai/qwen3-coder +``` + +At every transfer the runtime ships a snapshot of the previous agent's model endpoints on the `on_agent_switch` hook input, and the `unload` builtin POSTs `{"model": "<id>"}` to each DMR endpoint's `/_unload` URL over plain HTTP. For cloud providers (OpenAI, Anthropic, …) the hook is a silent no-op since they don't expose an HTTP unload endpoint. Cross-provider chains are safe — only DMR endpoints are touched. See [`examples/unload_on_switch.yaml`](https://github.com/docker/docker-agent/blob/main/examples/unload_on_switch.yaml) for the full file. + +`on_session_resume` fires when the user explicitly approves the runtime to continue past its configured `max_iterations` limit. `previous_max_iterations` carries the cap that was reached and `new_max_iterations` carries the new cap after approval. Useful for alerting on extended-runtime sessions or for billing / quota pipelines that meter resumes. + +### Tool-Approval-Decision: who-approved-what audit trail + +`on_tool_approval_decision` fires after the runtime's tool-approval chain (permissions / yolo / readonly / pre_tool_use hooks / interactive prompt) has resolved a verdict for a tool call. `approval_decision` is `allow`, `deny`, or `canceled`; `approval_source` is a stable classifier of which step produced the verdict. Observational only — it gives audit pipelines a single, structured "who approved what" record without re-implementing the chain. + +### Worktree-Create: prepare an isolated checkout + +`worktree_create` fires once, just after `docker agent run --worktree[=name]` creates a fresh [git worktree](../../features/cli/index.md) and **before** the session starts. Each hook runs **inside** the new worktree — its working directory (and `cwd` in the input) is the fresh checkout — so setup commands operate on the new tree rather than your original one. The worktree path and branch are in `worktree_path` and `worktree_branch`, and `worktree_source_dir` carries the repository root it was branched from. + +Use it to prepare the checkout before the agent begins: copy untracked files git won't carry over (`.env`, local config), install dependencies, or warm caches. Because the worktree lives under the Docker Agent data directory — not next to your checkout — resolve the original files through `worktree_source_dir` rather than a relative path. A hook may **abort the run** by returning `decision: block` / `{"continue": false}` / exit code 2 (for example, when a setup step fails); plain stdout is surfaced as additional context. + +```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 +``` + +Unlike most events, `worktree_create` is dispatched from the CLI rather than the run loop, because the worktree (and the working directory the runtime, session, tools, and snapshot machinery all capture) must be settled before the runtime and session exist. See [`examples/worktree_create_hook.yaml`](https://github.com/docker/docker-agent/blob/main/examples/worktree_create_hook.yaml) for the full file. + +### Pre-Compact: steer the summary + +`pre_compact` fires just before the runtime compacts the session transcript. Its `source` field tells you why compaction was triggered: + +- `manual` — the user invoked `/compact` +- `auto` — proactive compaction at the configured threshold +- `overflow` — emergency compaction after a context-overflow error +- `tool_overflow` — proactive compaction triggered by tool results pushing the estimated context past the threshold + +Return `additional_context` (or plain stdout) to append guidance to the compaction prompt without modifying the agent's instruction. Block the event (`decision: block` / exit code 2) to cancel compaction — useful when you want to handle truncation yourself. + +### User-Prompt-Submit: gate or enrich every user message + +`user_prompt_submit` fires once per user message, after the prompt is recorded in the session and before the first model call. The submitted text is in `prompt`. Use it to: + +- block prompts that violate policy (`decision: block` / exit code 2), +- inject per-prompt context (`additional_context` is spliced as a transient system message for that turn), +- audit user prompts to a log. + +It does **not** fire for sub-sessions (transferred tasks, background agents, skill sub-sessions) because their kick-off message is synthesised by the runtime. + +### User-Steering-Messages-Submit: gate or enrich mid-flight steering + +`user_steering_messages_submit` is the steering-queue analogue of `user_prompt_submit`. It fires each time the runtime drains the steering queue — messages the user submitted while the agent was already working: mid-turn (after a batch of tool calls), after the model stopped, or while idle before the first model call. The drained messages arrive as a JSON array in `steering_messages`. Use it to: + +- block a run when steering violates policy (`decision: block` / exit code 2), +- inject context in response to the steering (`additional_context` is spliced as a transient system message for the steered turn — never persisted, exactly like `user_prompt_submit`), +- audit steering messages to a log. + +Unlike `turn_end` with `reason: steered`, which only observes the mid-turn and post-stop drains, this event fires on **every** drain — including steering applied while the agent was idle before its first model call. + +```yaml +hooks: + user_steering_messages_submit: + - type: command + timeout: 5 + command: | + INPUT=$(cat) + COUNT=$(echo "$INPUT" | jq -r '.steering_messages | length') + echo "$INPUT" | jq -r '.steering_messages[]' >> /tmp/agent-steering.log + if [ "$COUNT" -gt 0 ]; then + echo '{"hook_specific_output":{"additional_context":"The user sent new instructions while you were working — re-read the latest user messages and adjust course before continuing."}}' + fi +``` + +### User-Followup-Submit: gate or enrich queued follow-ups + +`user_followup_submit` is the follow-up-queue analogue of `user_prompt_submit`. It fires each time the runtime dequeues a follow-up message at the end of a turn and starts a fresh turn for it. Follow-ups are user messages queued for end-of-turn processing (the FollowUp API / queue) — distinct from mid-turn steering: the model sees a follow-up as fresh input, not an interruption, and each follow-up gets a full undivided turn. The follow-up text is in `prompt`. Use it to: + +- block a queued follow-up that violates policy (`decision: block` / exit code 2), +- inject per-follow-up context (`additional_context` is spliced as a transient system message for the follow-up turn — never persisted, exactly like `user_prompt_submit`), +- audit follow-up messages to a log. + +This closes the gap left by `user_prompt_submit`, which fires only for the first interactive prompt and never for queued follow-ups. + +```yaml +hooks: + user_followup_submit: + - type: command + timeout: 5 + command: | + INPUT=$(cat) + echo "$INPUT" | jq -r '.prompt' >> /tmp/agent-followups.log +``` + +### Subagent-Stop: observe handoff completions + +`subagent_stop` fires whenever a sub-agent finishes — `transfer_task` returns, a background agent completes, or a skill sub-session ends. It runs against the *parent* agent's hooks executor, so handlers configured on the orchestrator see every child completion in one place. The sub-agent's name is in `agent_name`, the parent's session ID in `parent_session_id`, and the child's final assistant message in `stop_response`. + +### Permission-Request: programmatic tool approval + +`permission_request` fires just before the runtime would prompt the user to approve a tool call (i.e. when neither the safety mode nor a permissions rule short-circuited the decision). Use the same `hook_specific_output.permission_decision` shape as `pre_tool_use` to auto-approve or auto-deny the call: + +```yaml +hooks: + permission_request: + - matcher: "shell" + hooks: + - type: command + command: | + INPUT=$(cat) + CMD=$(echo "$INPUT" | jq -r '.tool_input.cmd // ""') + if echo "$CMD" | grep -qE '^(ls|pwd|cat) '; then + echo '{"hook_specific_output":{"permission_decision":"allow","permission_decision_reason":"safe read-only command"}}' + fi +``` + +Return nothing to fall through to the usual interactive confirmation. + +When the hook falls through (returns no `permission_decision`), it can still attach key/value `metadata` to the confirmation prompt the runtime shows the user. The runtime merges it onto any static metadata the toolset attached to the tool (hook keys win on a clash) and emits it on the tool-call confirmation message, so clients (TUI, HTTP) can render extra per-call context. Keys from multiple matching hooks are merged; the last hook in config order wins on a clash. + +```yaml +hooks: + permission_request: + - matcher: "shell" + hooks: + - type: command + command: | + INPUT=$(cat) + CMD=$(echo "$INPUT" | jq -r '.tool_input.cmd // ""') + if echo "$CMD" | grep -qE '\brm\b'; then + echo '{"hook_specific_output":{"metadata":{"risk":"high","note":"deletes files"}}}' + fi +``` + +### LLM as a Judge (Auto-Approving Tool Calls) + +The `model` hook type asks an LLM and translates its reply into the +hook's native output — no Go code, no shell glue, no JSON parsing on +your side. Combined with the well-known `pre_tool_use_decision` +schema it gives you a fully-configurable LLM judge that decides +`allow` / `ask` / `deny` per tool call. + +```yaml +hooks: + pre_tool_use: + - matcher: "shell|edit_file|mcp:.*" + hooks: + - type: model + model: openai/gpt-4o-mini + timeout: 15 + schema: pre_tool_use_decision + prompt: | + You are a security judge for an autonomous agent. + Decide whether this tool call is safe to auto-approve. + + Tool: {{ .ToolName }} + Args: {{ .ToolInput | toJSON }} + + Project rules: + - Reads under the working directory are safe. + - Writes to ~/.ssh / ~/.aws / ~/.docker are deny. +``` + +| Field | Required | Description | +| --------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model` | yes | Model spec (`provider/model`, e.g. `openai/gpt-4o-mini`). The judge model — small/cheap is recommended. | +| `prompt` | yes | Go [`text/template`](https://pkg.go.dev/text/template) body. Sees the hook [Input](#hook-input) as data, plus the `toJSON` and `truncate <n>` helpers. | +| `schema` | no | Well-known response interpretation. `pre_tool_use_decision` produces a `permission_decision` verdict; omit for free-form text injected as `additional_context`. | +| `timeout` | no (default 60s) | Per-call timeout. **Timeouts fail closed (deny) for `pre_tool_use`** regardless of any other setting. Match it to your judge model's typical latency plus a small buffer. | + +The `pre_tool_use_decision` schema constrains the judge to reply with +strict `{decision, reason}` JSON. Providers that honor structured +output (OpenAI, ...) are asked to emit that shape directly; on +providers that ignore it the framework still parses tolerant +JSON-in-text. Anything unparseable propagates as a hook error and the +executor falls closed (deny) on `pre_tool_use`. + +Pair it with deterministic `permissions:` rules so destructive calls +(e.g. `sudo`, `rm -rf`) are blocked even if the judge is misled, and +obvious read-only calls bypass the LLM entirely. See +[`examples/llm_judge.yaml`](https://github.com/docker/docker-agent/blob/main/examples/llm_judge.yaml) +for a complete configuration. + +**Security considerations**: + +- **Sensitive data**: Tool arguments (including file paths, command + arguments, and any other parameters) are sent to the judge LLM. Avoid + using the judge on tools that handle secrets, or ensure your judge + model is self-hosted. +- **Defense in depth**: The judge should not be your only security + layer. Use deterministic `permissions:` rules to block obviously + dangerous operations (e.g., `sudo`, `rm -rf`) before the judge sees + them, as shown in the example configuration. + +## CLI Flags + +You can add hooks from the command line without modifying the agent's YAML file. This is useful for one-off debugging, audit logging, or layering hooks onto an existing agent. + +| Flag | Description | +| ---------------------- | ------------------------------------------------ | +| `--hook-pre-tool-use` | Run a command before every tool call | +| `--hook-post-tool-use` | Run a command after every tool call | +| `--hook-session-start` | Run a command when a session starts | +| `--hook-session-end` | Run a command when a session ends | +| `--hook-on-user-input` | Run a command when waiting for input | +| `--hook-stop` | Run a command when the model finishes responding | + +All flags are repeatable — pass multiple to register multiple hooks. + +```bash +# Add a session-start hook +$ docker agent run agent.yaml --hook-session-start "./scripts/setup-env.sh" + +# Combine multiple hooks +$ docker agent run agent.yaml \ + --hook-pre-tool-use "./scripts/validate.sh" \ + --hook-post-tool-use "./scripts/log.sh" + +# Add hooks to an agent from a registry +$ docker agent run myorg/coder \ + --hook-pre-tool-use "./audit.sh" +``` + +> [!NOTE] +> **Merging behavior** +> +> Agent-config, global, drop-in, and CLI hooks are additive. For each event, hooks run in this order: agent-config hooks first, then global hooks from `settings.hooks`, then [hook drop-ins](#hook-drop-in-files-hooksd) from `hooks.d/`, then CLI hooks. No source replaces another, and individual agents cannot opt out of global hooks. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/models/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/models/index.md new file mode 100644 index 000000000000..0626bd48ef43 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/models/index.md @@ -0,0 +1,639 @@ +--- +title: "Model Configuration" +description: "Complete reference for defining models with providers, parameters, and reasoning settings." +keywords: docker agent, ai agents, configuration, yaml, model configuration +linkTitle: "Model Config" +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/configuration/models/ +--- + +_Complete reference for defining models with providers, parameters, and reasoning settings._ + +## Full Schema + +<!-- yaml-lint:skip --> +```yaml +models: + model_name: + first_available: [list] # Optional: candidate model refs, tried in order by available credentials. + # Mutually exclusive with other model settings. + provider: string # Required unless using first_available. One of: openai, anthropic, google, amazon-bedrock, + # dmr, mistral, xai, nebius, nvidia, minimax, baseten, ovhcloud, groq, fireworks, deepseek, cerebras, together, huggingface, moonshot, vercel, cloudflare-workers-ai, cloudflare-ai-gateway, requesty, openrouter, + # azure, ollama, github-copilot, or a named provider defined + # under the top-level `providers:` section. + model: string # Required: model identifier + description: string # Optional: human-readable summary of the model's purpose or strengths + temperature: float # Optional: 0.0–2.0 (provider-dependent; e.g. Anthropic caps at 1.0) + max_tokens: integer # Optional: response length limit + top_p: float # Optional: 0.0–1.0 + frequency_penalty: float # Optional: -2.0–2.0 + presence_penalty: float # Optional: -2.0–2.0 + base_url: string # Optional: custom API endpoint + token_key: string # Optional: env var for API token + thinking_budget: string|int # Optional: reasoning effort + task_budget: int|object # Optional: total task token budget (Anthropic) + parallel_tool_calls: boolean # Optional: allow parallel tool calls + track_usage: boolean # Optional: track token usage + routing: [list] # Optional: rule-based model routing + capabilities: # Optional: override attachment capabilities + image: boolean # Optional: whether the model accepts image attachments + pdf: boolean # Optional: whether the model accepts PDF attachments + cost: # Optional: explicit token pricing (USD per 1M tokens) + input: float # Optional: price per 1M input tokens + output: float # Optional: price per 1M output tokens + cache_read: float # Optional: price per 1M cached input tokens + cache_write: float # Optional: price per 1M cache-write tokens + provider_opts: # Optional: provider-specific options + key: value + title_model: string # Optional: model used for session-title generation + compaction_model: string # Optional: model used for session-compaction (summary generation) + compaction_threshold: float # Optional: context-window fraction that triggers auto-compaction (0–1, default: 0.9) + bypass_models_gateway: boolean # Optional: skip the models gateway for this model (implied by a custom base_url) +``` + +## Properties Reference + +| Property | Type | Required | Description | +| --------------------- | ---------- | -------- | ------------------------------------------------------------------------------------- | +| `first_available` | array | ✗ | Candidate model references tried in order; selects the first whose credentials are configured. Mutually exclusive with other model settings. | +| `provider` | string | ✓/✗ | Required for regular model definitions; omitted for `first_available` selectors. Provider: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, `mistral`, `xai`, `nebius`, `nvidia`, `minimax`, `baseten`, `ovhcloud`, `groq`, `fireworks`, `deepseek`, `cerebras`, `together`, `huggingface`, `moonshot`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `azure`, `ollama`, `github-copilot`, `chatgpt`, or any [named provider](../../providers/custom/index.md). | +| `model` | string | ✓/✗ | Required for regular model definitions; omitted for `first_available` selectors. Model name (e.g., `gpt-4o`, `claude-sonnet-4-5`, `gemini-3.5-flash`) | +| `description` | string | ✗ | Informational, human-readable summary of the model's purpose or strengths (e.g., "fast and cheap, good for summaries"). Not sent to the model. Can be combined with `first_available` (a selector's description is kept when it resolves). | +| `temperature` | float | ✗ | Sampling randomness. Range is provider-dependent — typically `0.0–2.0` (Anthropic caps at `1.0`). `0.0` is deterministic. | +| `max_tokens` | int | ✗ | Maximum response length in tokens | +| `top_p` | float | ✗ | Nucleus sampling threshold (`0.0–1.0`) | +| `frequency_penalty` | float | ✗ | Penalize repeated tokens (`-2.0–2.0`) | +| `presence_penalty` | float | ✗ | Encourage topic diversity (`-2.0–2.0`) | +| `base_url` | string | ✗ | Custom API endpoint URL (for self-hosted or proxied endpoints) | +| `token_key` | string | ✗ | Environment variable name containing the API token (overrides provider default) | +| `thinking_budget` | string/int | ✗ | Reasoning effort control | +| `task_budget` | int/object | ✗ | Total token budget for an agentic task (forwarded to Anthropic; see [Task Budget](#task-budget)). | +| `parallel_tool_calls` | boolean | ✗ | Allow model to call multiple tools at once | +| `track_usage` | boolean | ✗ | Track and report token usage for this model | +| `routing` | array | ✗ | Rule-based routing to different models. See [Model Routing](../routing/index.md). | +| `capabilities` | object | ✗ | Override attachment capabilities for this model. See [Attachment Capability Overrides](#attachment-capability-overrides). | +| `cost` | object | ✗ | Explicit token pricing in USD per 1M tokens, overriding the built-in catalogue. See [Custom Token Pricing](#custom-token-pricing). | +| `provider_opts` | object | ✗ | Provider-specific options (see provider pages) | +| `title_model` | string | ✗ | Model used for session-title generation. Can be a named model from the `models:` section or an inline `provider/model` string. When omitted, the agent's primary model generates titles. Cannot be combined with `first_available`. | +| `compaction_model` | string | ✗ | Model used for session compaction (summary generation). Can be a named model or an inline `provider/model` string. The agent-level `compaction_model` takes precedence over this value, which in turn takes precedence over a provider-level default. When none is set, the primary model compacts. Cannot be combined with `first_available`. See the [Context & Compaction guide](../../guides/compaction/index.md). | +| `compaction_threshold` | float | ✗ | Fraction of the context window at which proactive auto-compaction triggers for agents running this model. Must be greater than `0` and at most `1`. Takes precedence over the agent-level `compaction_threshold`. Cannot be combined with `first_available`. Default: `0.9`. See the [Context & Compaction guide](../../guides/compaction/index.md). | +| `bypass_models_gateway` | boolean | ✗ | When `true`, this model connects directly to its provider even when a models gateway (`--models-gateway` / `DOCKER_AGENT_MODELS_GATEWAY`) is configured. Implied by a custom `base_url`. See [Gateway Bypass](#gateway-bypass). | + +## Attachment Capability Overrides + +For custom OpenAI-compatible providers, local models (Ollama, DMR), and any +model the built-in catalogue does not describe, Docker Agent cannot +auto-detect whether the endpoint accepts image or PDF attachments. When the +model is absent from the catalogue, Docker Agent logs a diagnostic and falls +back to text-only, silently dropping attachments. + +Declare `capabilities` to make the model's attachment support authoritative +and skip the catalogue lookup entirely: + +```yaml +models: + llava-local: + provider: ollama + model: llava + capabilities: + image: true # accepts image attachments + pdf: false # does not accept PDFs + + proxy-vision: + provider: vision-proxy + model: gpt-4o + capabilities: + image: true + pdf: true +``` + +| Field | Type | Description | +| ---------------------- | ------- | ------------------------------------------------- | +| `capabilities.image` | boolean | Whether the model accepts image attachments | +| `capabilities.pdf` | boolean | Whether the model accepts PDF attachments | + +The flags must match what the endpoint actually accepts. Claiming a modality +that the endpoint does not support leads to a provider-side API error. When +`capabilities` is omitted the behaviour is unchanged (catalogue lookup then +conservative text-only fallback). + +See [`examples/capability-overrides.yaml`](https://github.com/docker/docker-agent/blob/main/examples/capability-overrides.yaml) for a complete example. + +## Custom Token Pricing + +Docker Agent prices each model call from the [models.dev](https://models.dev/) +catalogue. Models the catalogue does not know — custom OpenAI-compatible +providers, local models, private deployments — are "unpriced": every call is +recorded at $0 despite consuming tokens, with only a log warning. + +Declare `cost` to price a model explicitly, in **USD per one million tokens**. +When set, it takes precedence over the catalogue and makes an uncatalogued +model priced: + +```yaml +models: + internal-gpt: + provider: internal-llm + model: gpt-4o + cost: + input: 1.25 # USD per 1M input tokens + output: 5.00 # USD per 1M output tokens + cache_read: 0.125 # USD per 1M cached input tokens + cache_write: 1.5625 # USD per 1M cache-write tokens + + # Also works for catalogued models, e.g. a negotiated enterprise discount: + discounted-sonnet: + provider: anthropic + model: claude-sonnet-4-5 + cost: + input: 2.4 + output: 12.0 +``` + +| Field | Type | Description | +| ------------------ | ----- | --------------------------------------- | +| `cost.input` | float | USD price per 1M input tokens | +| `cost.output` | float | USD price per 1M output tokens | +| `cost.cache_read` | float | USD price per 1M cached input tokens | +| `cost.cache_write` | float | USD price per 1M cache-write tokens | + +The declared prices feed per-turn cost computation, session cost tracking, the +`/model` picker, and the [`after_llm_call` hook](../hooks/index.md)'s `cost` +field. Prices must not be negative; omitted fields default to `0`. An all-zero +table means "priced, free" — distinct from omitting `cost` entirely +(unpriced). Cannot be combined with `first_available` (set it on the candidate +models instead). + +See [`examples/custom-pricing.yaml`](https://github.com/docker/docker-agent/blob/main/examples/custom-pricing.yaml) for a complete example. + +## Delegating Session-Title Generation + +The `title_model` field lets a heavyweight primary model hand off the cheap +title-generation call to a smaller, faster model: + +```yaml +model: anthropic/claude-opus-4-7 +title_model: anthropic/claude-haiku-4-5 +``` + +The value can be a named entry from the `models` stanza or an inline +`provider/model` string. When omitted, the agent's primary model generates +titles. + +> [!WARNING] +> **Constraint** +> +> `title_model` cannot be combined with `first_available` model selection — the combination is rejected at validation time. + +## Delegating Session Compaction + +> [!TIP] +> **Full guide** +> +> For a task-oriented walkthrough of automatic vs. on-demand compaction, trimming tool results, and reading the context gauge, see [Managing Context & Compaction](../../guides/compaction/index.md). This section covers the `compaction_model` and `compaction_threshold` fields themselves. + +The `compaction_model` field lets a heavyweight primary model hand off the expensive +compaction (summary generation) call to a smaller, faster model: + +```yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + compaction_model: fast + fast: + provider: anthropic + model: claude-haiku-4-5 +``` + +The value can be a named entry from the `models` stanza or an inline +`provider/model` string. Resolution priority: an agent-level `compaction_model` +wins, then the model-level value, then a provider-level default set in the +`providers` section; when none is set, the primary model compacts. For an +agent listing several models (`model: a,b`), the first listed model that sets +a value (or whose provider sets a default) wins at that level. + +```yaml +providers: + my_anthropic: + provider: anthropic + # Default for every agent whose model uses this provider. + compaction_model: anthropic/claude-haiku-4-5 +``` + +If the compaction model has a **smaller context window** than the primary, +Docker Agent triggers compaction against the smaller window so the summary +call can always ingest the full conversation. Pair the primary with a +compaction model whose window is at least as large to keep the proactive +trigger aligned with the primary's window. + +By default the proactive trigger fires when the estimated token usage crosses +**90%** of the context window. The `compaction_threshold` field tunes that +fraction (greater than `0`, at most `1`): lower values compact earlier and +keep requests smaller, higher values compact later and keep more verbatim +history. It can be set on the model (as above, taking precedence) or on the +agent, and automatic compaction can be disabled entirely per agent with +`session_compaction: false` — see [Agent Config](../agents/index.md#properties-reference). + +```yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + compaction_model: fast + # Compact at 80% of the window instead of the default 90%. + compaction_threshold: 0.8 +``` + +> [!WARNING] +> **Constraint** +> +> `compaction_model` cannot be combined with `first_available` model selection — the combination is rejected at validation time. + +See [`examples/compaction_model.yaml`](https://github.com/docker/docker-agent/blob/main/examples/compaction_model.yaml) +and [`examples/compaction_threshold.yaml`](https://github.com/docker/docker-agent/blob/main/examples/compaction_threshold.yaml) +for complete examples. + +## Gateway Bypass + +When a models gateway (`--models-gateway` / `DOCKER_AGENT_MODELS_GATEWAY`) is configured, +models without a custom `base_url` route through it by default. Set +`bypass_models_gateway: true` on a specific model to make it connect directly +to its provider instead: + +```yaml +models: + gateway-model: + provider: openai + model: gpt-5 + + direct-model: + provider: anthropic + model: claude-sonnet-4-5 + bypass_models_gateway: true # uses ANTHROPIC_API_KEY directly +``` + +The bypassed model authenticates with the provider's own credentials +(`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `token_key`, etc.) rather than the +gateway's short-lived token. The rest of the agent's models continue routing +through the gateway as before. + +Bypass is propagated transparently through router models: a bypass-flagged routing +model passes the flag to all of its routed targets automatically. + +> [!WARNING] +> **Security note** +> +> On an untrusted config, a malicious `base_url` combined with `bypass_models_gateway: true` could route provider credentials to an attacker-controlled endpoint. Only enable this on configs you control. + +> [!WARNING] +> **Constraint** +> +> `bypass_models_gateway: true` cannot be combined with `first_available` — the combination is rejected at validation time. + +See [`examples/bypass_models_gateway.yaml`](https://github.com/docker/docker-agent/blob/main/examples/bypass_models_gateway.yaml) for a complete example. + +## First Available Models + +Use `first_available` when the same agent should work with whichever provider credentials are available in the current environment. Docker Agent checks the candidates in order at load time and replaces the selector with the first candidate whose required environment variables are configured. + +```yaml +models: + smart: + first_available: + - anthropic/claude-sonnet-4-6 + - openai/gpt-5 + - google/gemini-3.5-flash + - dmr/ai/qwen3 # local fallback; no API key required + +agents: + root: + model: smart + instruction: You are a helpful assistant. +``` + +Candidates can be inline `provider/model` references or names from the same `models:` section. Local providers such as `dmr` and `ollama` do not require credentials, so they are useful as final fallbacks. + +If none of the candidates has credentials configured, Docker Agent reports the missing environment variables grouped by candidate. You only need to configure one group of credentials, not every provider in the list. + +A `first_available` model is only a selector. Except for the informational `description`, it cannot be combined with `provider`, `model`, `routing`, `token_key`, budgets, sampling options, or other model settings. Put those settings on named candidate models instead: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-6 + max_tokens: 64000 + + gpt: + provider: openai + model: gpt-5 + thinking_budget: low + + smart: + first_available: + - claude + - gpt + - dmr/ai/qwen3 +``` + +See [`examples/first_available.yaml`](https://github.com/docker/docker-agent/blob/main/examples/first_available.yaml) for a complete example. + +## Thinking Budget + +Control how much reasoning the model does before responding. This varies by provider: + +### OpenAI + +Uses effort levels as strings: + +```yaml +models: + gpt: + provider: openai + model: gpt-5.6 + thinking_budget: low # none | minimal | low | medium | high | xhigh | max (xhigh needs gpt-5.2+; none/max need gpt-5.6+; minimal dropped on gpt-5.6+) +``` + +### Anthropic + +Uses an integer token budget (1024–32768), or — on adaptive-capable models (Opus 4.6+) — `adaptive`, `adaptive/<effort>`, or a bare effort level: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 16384 # must be < max_tokens + + opus: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: adaptive # or adaptive/<effort>, or low | medium | high | xhigh | max +``` + +### Google Gemini 2.5 + +Uses an integer token budget. `0` disables, `-1` lets the model decide: + +```yaml +models: + gemini: + provider: google + model: gemini-2.5-flash + thinking_budget: -1 # dynamic (default) +``` + +### Google Gemini 3 + +Uses effort levels like OpenAI: + +```yaml +models: + gemini3: + provider: google + model: gemini-3-flash + thinking_budget: medium # minimal | low | medium | high +``` + +### Disabling Thinking + +```yaml +thinking_budget: none # or 0 +``` + +`none` and `0` both clear Docker Agent's local thinking configuration (omitting `thinking_budget` has the same effect); neither is guaranteed to reach the API as a real "off" switch: + +- **OpenAI gpt-5.6+** (Sol/Terra/Luna) is the only case with a genuine API-level `none` reasoning effort: Docker Agent sends it as-is and the model does not reason. +- **Older OpenAI reasoning models** (o-series, gpt-5 through gpt-5.5) have no such switch: `none`/`0` just clear the local config, and the model falls back to the API's own default effort and still reasons internally. Same for other always-reasoning models (Gemini 3). +- Providers with a true optional-thinking switch (Gemini 2.5, Claude, local models) are fully disabled by `none`/`0`. + +```yaml +models: + fast-responder: + provider: openai + model: gpt-5.6 + thinking_budget: none # real API-level disable on gpt-5.6+ +``` + +See the [Thinking / Reasoning guide](../../guides/thinking/index.md) for per-provider details, including AWS Bedrock and Docker Model Runner. + +## Task Budget + +**Anthropic-only.** + +`task_budget` caps the **total** number of tokens the model may spend across a +multi-step agentic task — combining thinking, tool calls, and final output +tokens. It lets long-running agents self-regulate effort without having to +choose a tight per-call `max_tokens`. + +It is forwarded to Anthropic's +[`output_config.task_budget`](https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7) +request field. Docker Agent automatically attaches the required +`task-budgets-2026-03-13` beta header whenever this field is set. + +You can configure `task_budget` on **any** Claude model — Docker Agent never +gates it by model name. At the time of writing only **Claude Opus 4.7** +actually honors the field; other Claude models will reject requests that +include it. Check the Anthropic release notes linked above for the current +list of supported models. + +### Integer shorthand + +```yaml +models: + opus: + provider: anthropic + model: claude-opus-4-7 + task_budget: 128000 # total tokens for the whole task + thinking_budget: adaptive # works nicely together +``` + +### Object form + +Equivalent, and forward-compatible with future budget types: + +```yaml +models: + opus: + provider: anthropic + model: claude-opus-4-7 + task_budget: + type: tokens # only "tokens" is supported today + total: 128000 +``` + +Setting `task_budget: 0` (or omitting the field) disables the feature — the +model falls back to the provider's default behavior. + +Like other inheritable model settings, `task_budget` can also be declared on a +[provider definition](../../providers/custom/index.md) and is +inherited by every model that references that provider. + +See [`examples/task_budget.yaml`](https://github.com/docker/docker-agent/blob/main/examples/task_budget.yaml) for a complete example. + +## Interleaved Thinking + +For Anthropic and Bedrock Claude models, interleaved thinking allows tool calls during model reasoning. It is auto-enabled whenever a thinking budget is configured: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 8192 + # interleaved_thinking is auto-enabled when thinking_budget is set + provider_opts: + interleaved_thinking: false # disable if needed +``` + +## Thinking Display (Anthropic) + +For Anthropic Claude models, `thinking_display` controls whether thinking blocks are returned in responses when thinking is enabled. Newer Claude models (Opus 4.7+, Fable 5) hide thinking content by default (`omitted`); Docker Agent requests `summarized` thinking by default for adaptive/effort-based budgets so reasoning stays visible. Set this provider option to override: + +```yaml +models: + opus-4-7: + provider: anthropic + model: claude-opus-4-7 + thinking_budget: adaptive + provider_opts: + thinking_display: omitted # "summarized" or "omitted" ("display" on pre-4.6 models only) +``` + +`display` (full thinking blocks) is only accepted by pre-4.6 token-thinking models (e.g. Sonnet 4.5, Haiku 4.5); newer models (Opus/Sonnet 4.6+, Sonnet 5, Fable 5) only accept `summarized` and `omitted`, and Docker Agent rejects the configuration at startup. + +See the [Anthropic provider page](../../providers/anthropic/index.md#thinking-display) for details. + +## Custom HTTP Headers + +For OpenAI-compatible providers (`openai`, `github-copilot`, `mistral`, `xai`, +`nebius`, `nvidia`, `minimax`, `baseten`, `ovhcloud`, `groq`, `fireworks`, `deepseek`, `cerebras`, `together`, `huggingface`, `moonshot`, `vercel`, `cloudflare-workers-ai`, `cloudflare-ai-gateway`, `requesty`, `openrouter`, `ollama`, and any custom provider using the OpenAI API), +`provider_opts.http_headers` adds arbitrary HTTP headers to every outgoing +request: + +```yaml +models: + my_model: + provider: openai + model: gpt-4o + provider_opts: + http_headers: + X-Request-Source: docker-agent + X-Tenant-Id: my-team +``` + +Header names are matched case-insensitively. The `github-copilot` provider +automatically sets `Copilot-Integration-Id: copilot-developer-cli` — see the +[GitHub Copilot provider page](../../providers/github-copilot/index.md) +for details. + +## Examples by Provider + +```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 +``` + +For detailed provider setup, see the [Model Providers](../../providers/overview/index.md) section. + +## Custom Endpoints + +Use `base_url` to point to custom or self-hosted endpoints: + +```yaml +models: + # Azure OpenAI + azure_gpt: + provider: openai + model: gpt-4o + base_url: https://my-resource.openai.azure.com/openai/deployments/gpt-4o + token_key: AZURE_OPENAI_API_KEY + + # Self-hosted vLLM + local_llama: + provider: openai # vLLM is OpenAI-compatible + model: meta-llama/Llama-3.2-3B-Instruct + base_url: http://localhost:8000/v1 + + # Proxy or gateway + proxied: + provider: openai + model: gpt-4o + base_url: https://proxy.internal.company.com/openai/v1 + token_key: INTERNAL_API_KEY +``` + +The `model` and `base_url` fields accept `${env.VAR}` (or `${VAR}`) references, which are substituted from the environment when the model is loaded. This keeps the model id or endpoint out of the config when it is supplied by the environment, e.g. a Docker Compose / DMR setup: + +```yaml +models: + nemotron3: + provider: dmr + model: "${env.NEMOTRON3_MODEL}" + base_url: "${env.DMR_BASE_URL}" +``` + +See [Variable Expansion in Config Fields](../overview/index.md#variable-expansion-in-config-fields) for the full set of fields and supported syntaxes. + +See [Local Models](../../providers/local/index.md) for more examples of custom endpoints. + +## Inheriting from Provider Definitions + +Models can reference a named provider to inherit shared defaults. Model-level settings always take precedence: + +```yaml +providers: + my_anthropic: + provider: anthropic + token_key: MY_ANTHROPIC_KEY + max_tokens: 16384 + thinking_budget: 8192 + temperature: 0.5 + +models: + claude: + provider: my_anthropic + model: claude-sonnet-4-5 + # Inherits max_tokens, thinking_budget, temperature from provider + + claude_fast: + provider: my_anthropic + model: claude-haiku-4-5 + thinking_budget: 1024 # Overrides provider default +``` + +See [Provider Definitions](../../providers/custom/index.md) for the full list of inheritable properties. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/overview/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/overview/index.md new file mode 100644 index 000000000000..705a698cf4af --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/overview/index.md @@ -0,0 +1,537 @@ +--- +title: "Configuration Overview" +description: "Docker Agent uses YAML or HCL configuration files to define agents, models, tools, and their relationships." +keywords: docker agent, ai agents, configuration, yaml, configuration overview +linkTitle: "Overview" +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/configuration/overview/ +aliases: + - /ai/docker-agent/reference/config/ +--- + +_Docker Agent uses YAML or HCL configuration files to define agents, models, tools, and their relationships._ + +## File Structure + +A Docker Agent config can be written in YAML or HCL. The examples on this page use YAML; see [HCL Configuration](../hcl/index.md) for the block-based HCL syntax. + +A Docker Agent config has these main sections: + +```bash +# 1. Version — configuration schema version (optional but recommended) +version: 15 + +# 2. Metadata — optional agent metadata for distribution +metadata: + author: my-org + description: My helpful agent + version: "1.0.0" + +# 3. Models — define AI models with their parameters +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 64000 + +# 4. Agents — define AI agents with their behavior (at least one is required) +agents: + root: + model: claude + description: A helpful assistant + instruction: You are helpful. + toolsets: + - type: think + +# 5. RAG — define retrieval-augmented generation sources (optional) +rag: + docs: + docs: ["./docs"] + strategies: + - type: chunked-embeddings + embedding_model: openai/text-embedding-3-small + +# 6. MCPs — reusable MCP server definitions (optional) +mcps: + github: + remote: + url: https://api.githubcopilot.com/mcp + transport_type: sse + +# 7. Providers — optional reusable provider definitions +providers: + my_provider: + provider: anthropic # or openai (default), google, amazon-bedrock, etc. + token_key: MY_API_KEY + max_tokens: 16384 + +# 8. Permissions — agent-level tool permission rules (optional) +# For user-wide global permissions, see ~/.config/cagent/config.yaml +permissions: + allow: ["read_*"] + deny: ["shell:cmd=sudo*"] + +# 9. Commands & Skills — reusable, named groups shared across agents (optional) +commands: + ci: + deploy: "Deploy the application" +skills: + base: [local, git] + +# 10. Toolsets — reusable, named toolset definitions shared across agents (optional) +toolsets: + fs: + type: filesystem +``` + +## Minimal Config + +The simplest possible configuration — a single agent with an inline model: + +```yaml +agents: + root: + model: openai/gpt-5 + description: A helpful assistant + instruction: You are a helpful assistant. +``` + +The same config in HCL: + +```hcl +agent "root" { + model = "openai/gpt-5" + description = "A helpful assistant" + instruction = "You are a helpful assistant." +} +``` + +## Inline vs Named Models + +Models can be referenced inline or defined in the `models` section: + +- **Inline** — quick and simple. Use `provider/model` syntax directly: `model: openai/gpt-5` +- **Named** — full control over parameters, reusable across agents: `model: my_claude` + +## Config Sections + +- [**HCL Configuration**](../hcl/index.md) — write the same agent schema in HCL using labeled blocks, heredocs, and block-based tool definitions. +- [**Agent Config**](../agents/index.md) — all agent properties: model, instruction, tools, sub-agents, hooks, and more. +- [**Model Config**](../models/index.md) — provider setup, parameters, thinking budget, and provider-specific options. +- [**Tool Config**](../tools/index.md) — built-in tools, MCP tools, Docker MCP, LSP, API tools, and tool filtering. + +## Advanced Configuration + +- [**Hooks**](../hooks/index.md) — run shell commands at lifecycle events like tool calls and session start/end. +- [**Permissions**](../permissions/index.md) — control which tools auto-approve, require confirmation, or are blocked. +- [**Sandbox Mode**](../sandbox/index.md) — run agents in an isolated Docker container for security. +- [**Structured Output**](../structured-output/index.md) — constrain agent responses to match a specific JSON schema. +- [**Flavors**](../flavors/index.md) — ship one agent file with named variants, enabled at run time as YAML patches. + +## Environment Variables + +API keys and secrets are read from environment variables — never stored in config files. See [Managing Secrets](../../guides/secrets/index.md) for all the ways to provide credentials (env files, Docker Compose secrets, the Docker Agent env file): + +| Variable | Provider | +| -------------------------- | --------------------------------------------------- | +| `OPENAI_API_KEY` | OpenAI | +| `ANTHROPIC_API_KEY` | Anthropic | +| `GOOGLE_API_KEY` / `GEMINI_API_KEY` | Google Gemini | +| `MISTRAL_API_KEY` | Mistral | +| `XAI_API_KEY` | xAI | +| `NEBIUS_API_KEY` | Nebius | +| `MINIMAX_API_KEY` | MiniMax | +| `REQUESTY_API_KEY` | Requesty | +| `OPENROUTER_API_KEY` | OpenRouter | +| `GITHUB_TOKEN` | GitHub Copilot (PAT with `copilot` scope) | +| `AZURE_API_KEY` | Azure OpenAI (override with `token_key`) | +| `AWS_BEARER_TOKEN_BEDROCK` | AWS Bedrock (or the standard AWS credentials chain) | + +**Tool Auto-Installation:** + +| Variable | Description | +| --------------------- | --------------------------------------------------------------- | +| `DOCKER_AGENT_AUTO_INSTALL` | Set to `false` to disable automatic tool installation | +| `DOCKER_AGENT_TOOLS_DIR` | Override the base directory for installed tools (default: `~/.cagent/tools/`) | + +**Runtime overrides:** + +| Variable | Description | +| ----------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `DOCKER_AGENT_DEFAULT_MODEL` | Default model used when none is specified, in `provider/model` form (e.g. `openai/gpt-5`). | +| `DOCKER_AGENT_MODELS_GATEWAY` | Route model traffic through a gateway. Equivalent to the `--models-gateway` flag. | +| `DOCKER_AGENT_HIDE_TELEMETRY_BANNER`| Set to `1` to suppress the first-run telemetry notice. | +| `DOCKER_AGENT_AUTO_UPDATE` | Set to a truthy value (`1`, `true`, `yes`, `on`) to let standalone release binaries self-update before running. See [Optional Self-Updates](../../getting-started/installation/index.md#optional-self-updates). | +| `DOCKER_AGENT_NO_TOKEN_EXCHANGE` | Set to `1` to stop Docker Agent from exchanging the access token stored by `docker login` for a Docker token. See [Docker authentication](../../guides/secrets/index.md#docker-authentication). | +| `DOCKER_AGENT_HUB_LOGIN_URL` | Point the token exchange at a Docker staging environment. Ignored unless it is an HTTPS `docker.com` URL. | + +> [!NOTE] +> **Legacy `CAGENT_*` aliases** +> +> The same variables are also accepted with the legacy `CAGENT_` prefix (e.g. `CAGENT_DEFAULT_MODEL`, `CAGENT_MODELS_GATEWAY`, `CAGENT_HIDE_TELEMETRY_BANNER`) for backward compatibility. Prefer the `DOCKER_AGENT_*` form in new setups. + +> [!IMPORTANT] +> Model references are case-sensitive: `openai/gpt-5` is not the same as `openai/GPT-5`. + +## Variable Expansion in Config Fields + +Docker Agent expands `${env.VAR}` references in many config fields. This is the **canonical syntax everywhere** — prefer it for every field. Two engines back it: a full JavaScript evaluator for prompt/HTTP fields (where you also get defaults, ternaries, and tool calls), and a simpler path expander for filesystem/env fields (which additionally accepts the legacy `$VAR` / `${VAR}` / `~` shell forms). Picking `${env.VAR}` everywhere always works; the one caveat is that the path expander does not evaluate richer JS expressions. Using a shell-style `$VAR` in a JS-templated field is currently a silent no-op, so the literal string is passed through. Tracking issue: [#2615](https://github.com/docker/docker-agent/issues/2615). + +### JavaScript template literals — `${env.VAR}` + +Used wherever the agent prompt or HTTP traffic is templated. Backed by a JS evaluator, so you also get `||` defaults, ternaries, and tool calls (`${tool({...})}`). + +Applies to: + +- `agents.<name>.description` +- `agents.<name>.welcome_message` +- `agents.<name>.instruction` +- `agents.<name>.commands.*` (string form and `instruction:` field) +- `toolsets[*].instruction` +- `toolsets[*].headers` and `toolsets[*].remote.headers` (MCP, A2A, OpenAPI, fetch, API) + +For `api` toolsets, `api_config.endpoint` and `api_config.headers` are also rendered through the JS expander (the same syntax applies). + +```yaml +agents: + root: + description: "Assistant for ${env.USER || 'guest'}" + commands: + deploy: "Deploy ${env.PROJECT_NAME || 'app'} to ${env.ENV || 'staging'}" + toolsets: + - type: openapi + url: https://api.example.com + headers: + Authorization: "Bearer ${env.INTERNAL_TOKEN}" +``` + +Undefined variables expand to the empty string. + +### Path & env fields — `${env.VAR}` (canonical), `$VAR` / `${VAR}` / `~` (aliases) + +Used for filesystem paths and process environment values. Backed by `os.ExpandEnv` plus tilde expansion against the current user's home directory. The canonical `${env.VAR}` form is accepted here too, so a single syntax works across every field; the bare `$VAR` / `${VAR}` shell forms remain supported as aliases. + +Applies to: + +- `agents.<name>.toolsets[*].working_dir` (MCP, LSP) +- `agents.<name>.toolsets[*].path` (memory, tasks) +- `agents.<name>.toolsets[*].env` values (MCP, shell, script, LSP) +- `agents.<name>.toolsets[*].shell.<tool>.working_dir` (script tools) +- `agents.<name>.hooks.*.working_dir` +- The `~` prefix is also accepted in any path-like field documented as such. + +```yaml +agents: + root: + toolsets: + - type: memory + path: "~/notes/${env.PROJECT}/memory.db" + - type: mcp + command: my-server + working_dir: "${env.HOME}/work" +``` + +Unlike the JS-templated fields above, these accept only a plain variable reference: richer JS expressions (e.g. `${env.VAR || 'default'}`) are **not** evaluated here, and the legacy `$VAR` / `${VAR}` forms keep working for backward compatibility. + +Hook and script-tool `env` values expand only the plain `${env.VAR}` form, resolved against the **OS process environment** (dotenv/secret-provider values are not consulted); a bare `$VAR` or `${VAR}` is passed through **literally**, so values that legitimately contain `$` (passwords, templates) are never mangled: + +```yaml +agents: + root: + hooks: + session_start: + - type: command + command: ./notify.sh + working_dir: "~/scripts" # ~, $VAR, ${VAR}, ${env.VAR} all work + env: + API_TOKEN: "${env.NOTIFY_TOKEN}" # expanded + PASSWORD: "pa$$word" # kept literal +``` + +Model definitions follow the same rule. The `models.<name>.model` and `models.<name>.base_url` fields are expanded when the provider is built, accepting both `${env.VAR}` and `${VAR}`. This is useful when the model id or endpoint is injected by the environment (for example a Docker Compose / DMR setup that exports the model reference as a variable): + +```yaml +models: + nemotron3: + provider: dmr + model: "${env.NEMOTRON3_MODEL}" # resolved from the environment at load time + base_url: "${DMR_BASE_URL}" # ${VAR} is accepted as well +``` + +`token_key` is **not** expanded: it already names the environment variable that holds the API token, so its value is used as a key rather than substituted. An unset variable in `model` or `base_url` is reported as an error instead of dialing with an empty value. + +### Quick reference + +| Field | `${env.X}` | `$X` / `${X}` | `~` | +| --------------------------------------------- | :--------: | :-----------: | :-: | +| `description`, `welcome_message` | ✓ | ✗ | ✗ | +| `instruction` (agent and toolset) | ✓ | ✗ | ✗ | +| `commands.*` | ✓ | ✗ | ✗ | +| `headers`, `remote.headers`, `api_config.headers` | ✓ | ✗ | ✗ | +| `models.*.model`, `models.*.base_url` | ✓ | ✓ | ✗ | +| `working_dir`, `path` (toolset, script tool, hook) | ✓ | ✓ | ✓ | +| `env` values (toolset) | ✓ | ✓ | ✗ | +| `env` values (hook, script tool) | ✓ | literal | ✗ | + +The `~` prefix is meaningful only in path-like fields (`working_dir`, `path`). In hook and script-tool `env` values, "literal" means a bare `$X` / `${X}` is passed to the process unchanged — only `${env.X}` is substituted there, so values containing `$` survive intact. + +Prefer `${env.X}` everywhere. The bare `$X` / `${X}` and `~` forms are accepted only in path and `env` value fields, where they remain supported for backward compatibility. + +## Validation + +Docker Agent validates your configuration at startup: + +- Local `sub_agents` must reference agents defined in the config (external OCI references like `myorg/agent:tag` are pulled from registries automatically; pin them to a digest with `@sha256:…` to avoid a per-run registry lookup) +- Named model references must exist in the `models` section +- Provider names must be valid (`openai`, `anthropic`, `google`, `dmr`, etc.) +- Required environment variables (API keys) must be set +- Tool-specific fields are validated (e.g., `path` is only valid for `memory`) + +## JSON Schema + +For YAML editor autocompletion and validation, use the [Docker Agent JSON Schema](https://github.com/docker/docker-agent/blob/main/agent-schema.json). Add this to the top of your YAML file: + +```bash +# yaml-language-server: $schema=https://raw.githubusercontent.com/docker/docker-agent/main/agent-schema.json +``` + +## Config Versioning + +Docker Agent configs are versioned. The current version is `15`. Add the version at the top of your config: + +```yaml +version: 15 + +agents: + root: + model: openai/gpt-5 + # ... +``` + +When you load an older config, Docker Agent automatically migrates it to the latest schema. It's recommended to include the version to ensure consistent behavior. + +If you use a config key that requires a newer schema version, Docker Agent will fail with a strict-parse error and include a hint like: + +```text +hint: this key is supported by config version 12; update the top-level 'version' field (currently 11) +``` + +Bump the `version` field as directed to enable the new key. + +## Metadata Section + +Optional metadata for agent distribution via OCI registries: + +```yaml +metadata: + author: my-org + license: Apache-2.0 + description: A helpful coding assistant + readme: | # Displayed in registries + This agent helps with coding tasks. + version: "1.0.0" + tags: [coding, review] +``` + +| Field | Description | +| ------------- | ------------------------------------------ | +| `author` | Author or organization name | +| `license` | License identifier (e.g., Apache-2.0, MIT) | +| `description` | Short description for the agent | +| `readme` | Longer markdown description | +| `version` | Semantic version string | +| `tags` | Tags for categorization and discovery | + +See [Agent Distribution](../../concepts/distribution/index.md) for publishing agents to registries. + +## Reusable MCP Servers (`mcps:`) + +The top-level `mcps:` section defines named MCP server configurations that agents can reference with `toolsets: [{type: mcp, ref: <name>}]`. This avoids repeating the same command / URL / headers across agents and keeps credentials in one place. + +```yaml +mcps: + github: + remote: + url: https://api.githubcopilot.com/mcp + transport_type: sse + playwright: + command: npx + args: ["-y", "@modelcontextprotocol/server-playwright"] + +agents: + root: + model: openai/gpt-5 + toolsets: + - type: mcp + ref: github # reuse the definition above + - type: mcp + ref: playwright +``` + +An `mcps` entry accepts every field a regular `type: mcp` toolset accepts (command/args/env, `remote` with `url`/`transport_type`/`headers`/`oauth`, `tools` filter, `instruction`, `defer`, …) — the `type: mcp` is implicit. See the [Tool Config](../tools/index.md) page for all options and the [Remote MCP Servers](../../features/remote-mcp/index.md) guide for remote setups. + +## Reusable Toolsets (`toolsets:`) + +The top-level `toolsets:` map defines named toolset configurations that agents can reference by name through `use_toolsets:`. This avoids repeating the same toolset definition across multiple agents — the same pattern as `mcps:` for MCP servers and `commands:` / `skills:` for reusable prompt groups. + +Any toolset type is supported, including ones that reference MCP or RAG definitions. Shared toolsets are resolved before the MCP/RAG pass, so they can contain `{type: mcp, ref: <name>}` references. + +```yaml +toolsets: + fs: # a named shared toolset + type: filesystem + docs: + type: fetch + allowed_domains: + - docker.com + +agents: + root: + model: openai/gpt-5 + # Pull in shared toolsets by name; inline toolsets come first. + use_toolsets: [fs, docs] + toolsets: + - type: think + + reviewer: + model: openai/gpt-5 + # Reuse the same filesystem toolset without copying its definition. + use_toolsets: [fs] +``` + +Inline `toolsets:` entries listed directly on the agent take precedence in ordering (they come first) and are always included alongside referenced ones. + +See [`examples/shared-toolsets.yaml`](https://github.com/docker/docker-agent/blob/main/examples/shared-toolsets.yaml) for a complete example. + +## Reusable Commands & Skills (`commands:` / `skills:`) + +The top-level `commands:` and `skills:` sections define named, reusable groups that agents pull in by name through `use_commands:` / `use_skills:`. This avoids repeating the same command set or skill configuration across agents. Each group value uses the exact same format as an agent's own `commands` / `skills` field. + +Referenced groups are merged into the agent during config loading. An agent's own inline `commands` / `skills` entries take precedence on name conflicts. + +```yaml +commands: + ci: # a named command group + deploy: "Deploy the application" + test: "Run the test suite" +skills: + base: [local, git] # a named skill group + +agents: + root: + model: openai/gpt-5 + use_commands: [ci] # reuse the "ci" command group + use_skills: [base] # reuse the "base" skill group + commands: + lint: "Run the linter" # inline command, merged in (wins on conflict) + reviewer: + model: openai/gpt-5 + use_commands: [ci] # same group, reused without duplication +``` + +See [`examples/shared-commands-skills.yaml`](https://github.com/docker/docker-agent/blob/main/examples/shared-commands-skills.yaml) for a complete example. + +## Custom Providers Section + +Define reusable provider configurations with shared defaults. Providers can wrap any provider type — not just OpenAI-compatible endpoints: + +```yaml +providers: + # OpenAI-compatible custom endpoint + azure: + api_type: openai_chatcompletions + base_url: https://my-resource.openai.azure.com/openai/deployments/gpt-4o + token_key: AZURE_OPENAI_API_KEY + + # Anthropic with shared model defaults + team_anthropic: + provider: anthropic + token_key: TEAM_ANTHROPIC_KEY + max_tokens: 32768 + thinking_budget: 16384 + +models: + azure_gpt: + provider: azure + model: gpt-4o + + claude: + provider: team_anthropic + model: claude-sonnet-4-5 + # Inherits max_tokens, thinking_budget from provider + +agents: + root: + model: claude +``` + +| Field | Description | +| --------------------- | ---------------------------------------------------------------------------------------- | +| `provider` | Underlying provider type: `openai` (default), `anthropic`, `google`, `amazon-bedrock`, etc. | +| `api_type` | API schema: `openai_chatcompletions` (default) or `openai_responses`. OpenAI-only. | +| `base_url` | Base URL for the API endpoint. Required for OpenAI-compatible providers. | +| `token_key` | Environment variable name for the API token. | +| `temperature` | Default sampling temperature. | +| `max_tokens` | Default maximum response tokens. | +| `thinking_budget` | Default reasoning effort/budget. | +| `task_budget` | Default total token budget for an agentic task (Anthropic; honored by Claude Opus 4.7 today). | +| `top_p` | Default top-p sampling parameter. | +| `frequency_penalty` | Default frequency penalty. | +| `presence_penalty` | Default presence penalty. | +| `parallel_tool_calls` | Enable parallel tool calls by default. | +| `track_usage` | Track token usage by default. | +| `provider_opts` | Provider-specific options. | + +See [Provider Definitions](../../providers/custom/index.md) for more details. + +## Reusable YAML (anchors & aliases) + +YAML anchors (`&name`), aliases (`*name`) and merge keys (`<<`) are part of the YAML spec, and Docker Agent's config parser supports them. Use them to declare a value once and reuse it elsewhere in the same file, instead of copy-pasting the same block across agents. + +This complements the named-reuse sections above (`mcps:`, `commands:` / `skills:`, `providers:`). Reach for anchors when you want to share something those sections don't cover, such as an instruction string or a block of agent settings. + +Reuse a value verbatim with an anchor and an alias: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Coordinator. + instruction: &house_rules | + You are part of the Acme engineering team. + Cite the files you looked at and keep changes minimal. + reviewer: + model: anthropic/claude-sonnet-4-5 + description: Reviews code changes. + instruction: *house_rules # the same instruction, declared once +``` + +Compose a block with a merge key (`<<`), then override individual fields: + +```yaml +agents: + reviewer: &specialist + model: anthropic/claude-sonnet-4-5 + description: Reviews code changes. + instruction: | + You are a meticulous software professional. + toolsets: + - type: filesystem + documenter: + <<: *specialist # inherit model, instruction, toolsets + description: Writes documentation. # then override one field +``` + +> [!WARNING] +> **Where anchors can live** +> +> An anchor has to sit on a real value inside a known section (for example a real agent, model, or MCP entry, as above). Parking anchors in a separate top-level block such as `defaults:` or `prompts:` fails, because the parser rejects unknown top-level keys. + +> [!WARNING] +> **Overriding merged keys** +> +> Overriding a key that a `<<` merge already set works only in the `agents:` section, as shown above. Every other section (`models:`, `mcps:`, `providers:`, `rag:`) is parsed strictly and reports the override as a duplicate key. There, use `<<` only to add new fields, or use the named-reuse sections above when you need per-entry overrides. + +Anchors are for static reuse within a single file, not dynamic values or cross-file composition. For environment-specific settings, see [Variable Expansion in Config Fields](#variable-expansion-in-config-fields), which substitutes `${env.VAR}` at load time. Templating tags such as `!include` are not acted on: the tag is ignored and its argument is kept as a plain string, so no other file is loaded. Circular aliases are not detected, so keep references acyclic. + +See [`examples/yaml-anchors.yaml`](https://github.com/docker/docker-agent/blob/main/examples/yaml-anchors.yaml) for a complete example. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/permissions/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/permissions/index.md new file mode 100644 index 000000000000..c49f5df5501b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/permissions/index.md @@ -0,0 +1,314 @@ +--- +title: "Permissions" +description: "Control which tools can execute automatically, require confirmation, or are blocked entirely." +keywords: docker agent, ai agents, configuration, yaml, permissions +weight: 70 +canonical: https://docs.docker.com/ai/docker-agent/configuration/permissions/ +--- + +_Control which tools can execute automatically, require confirmation, or are blocked entirely._ + +## Overview + +Permissions provide fine-grained control over tool execution. You can configure which tools are auto-approved (run without asking), which require user confirmation, and which are completely blocked. + +> [!NOTE] +> **Evaluation Order** +> +> Permissions are evaluated in this order: **Deny → Allow → Ask**. Deny patterns take priority, then allow patterns, and anything else falls through to the session's [safety mode](#safety-modes). + +## Safety Modes + +Every session runs in a **safety mode** that decides what happens when no permission rule matched a tool call. The runtime labels each call `safe` (safe-listed shell command such as `ls` or `git status`, or a read-only-annotated tool), `destructive` (destructive shell command such as `rm -rf`, or a destructive-annotated tool), or `unknown` — and the mode gates on that label: + +| Mode | safe | destructive | unknown | +| ---- | ---- | ----------- | ------- | +| `strict` | ask | ask | ask | +| `balanced` | **allow** | ask | ask | +| `restricted` | **allow** | deny | deny | +| `autonomous` | **allow** | **allow** | **allow** | + +- **`strict`** prompts for every tool call, read-only ones included. Only an `allow:` rule silences a prompt. +- **`balanced`** runs safe calls silently and asks about everything else. +- **`restricted`** is the fail-closed profile for unattended/headless runs: safe calls run silently and everything else is **denied without asking** — the mode's fallback never prompts. Custom rules still win: an `allow:` rule can approve a destructive/unknown call, a `deny:` rule always blocks, and session-scoped `ask:` rules still prompt (as can a `preempt_yolo` hook). Restricted is defense in depth against unwanted tool calls, not a security boundary — for real isolation use [sandbox mode](../sandbox/index.md). +- **`autonomous`** is the legacy `--yolo` behavior: everything runs. Only `deny:` rules, session-scoped `ask:` rules, and `preempt_yolo` hooks still gate. + +Pick a mode with the `--safety` flag (`docker-agent run --safety balanced ...`), the `safety_policy` field on session create (`POST /api/sessions`) or mid-session (`PATCH /api/sessions/:id/safety-policy`), or escalate directly from a confirmation prompt (`B` switches to balanced, `A` to autonomous; the `restricted` fallback never prompts, so the mode is only selected via flag/config/API). Sessions that never choose a mode keep the historical default: read-only tools auto-approve, everything else asks. + +### Declarative Safety Defaults + +Safety modes can also be declared as **defaults** in YAML, at four scopes: + +| Scope | Location | Owner | +| ----- | -------- | ----- | +| Alias | `aliases.<name>.safety` in `~/.config/cagent/config.yaml` (or `docker agent alias add ... --safety <mode>`) | User | +| Global settings | `settings.safety` in `~/.config/cagent/config.yaml` | User | +| Per-agent | `agents.<name>.safety` in the agent YAML | Agent author | +| Config-wide | `runtime.safety` in the agent YAML | Agent author | + +```yaml +# Agent YAML (author-declared defaults) +runtime: + safety: balanced # config-wide default for new sessions + +agents: + root: + safety: strict # overrides runtime.safety for this agent +``` + +All four fields accept only the four canonical modes — `strict`, `balanced`, `restricted`, `autonomous` (yes, an author may declare `autonomous`) — and any other value fails loading with an error naming the field. The legacy spellings remain as aliases for `autonomous`: `settings.YOLO`, the alias `yolo` option, and the `--yolo` flag. When both are set at the same scope, `safety` wins over the legacy `YOLO`/`yolo`. + +For a **new** root session the first source in this order wins: + +1. explicit `--safety` flag +2. explicit `--yolo` flag +3. alias `safety`/`yolo` option +4. `settings.safety`/`settings.YOLO` (user config) +5. selected agent's `agents.<name>.safety` +6. `runtime.safety` +7. the historical default (read-only tools auto-approve, everything else asks) + +**Resuming a session never re-applies defaults**: the stored mode is kept unless you pass an explicit `--safety` or `--yolo` flag for that run. Agent switches, handoffs, and delegated sub-agent sessions inherit the active session's mode rather than resetting it. + +Sessions created through the API (`POST /api/sessions`) without a `safety_policy` receive the author-declared defaults (5–6) when their first run starts — the earliest point the agent configuration is loaded. If the server restarts before that first run, the session keeps the historical unset default (7). + +> [!WARNING] +> **Trust: author defaults never outrank you.** `runtime.safety` and `agents.<name>.safety` are written by the agent's author — which may be a config you pulled from a URL or an OCI registry. They only fill the gap when you expressed no preference: any user-owned source (CLI flag, alias option, user settings) always takes precedence, and a resumed session keeps its stored mode. Still, an author default of `autonomous` means a fresh session runs every tool call unprompted — review third-party configs before running them, or pin your own floor with `settings.safety` / `--safety`. + +**Custom rules always win over the mode**, with one asymmetry: `ask:` rules written in an agent's YAML (or global config) are agent-author advisories and yield to a user-chosen `balanced`/`restricted`/`autonomous` mode (under `restricted` they resolve to the mode's allow-or-deny verdict rather than introducing a prompt), while `ask:` rules granted at the session level (interactive "always ask" decisions, the session permissions API) always prompt. + +## Permission Levels + +Permissions can be defined at two levels: + +| Level | Location | Scope | +| ----- | -------- | ----- | +| **Agent-level** | Agent YAML config (`permissions:` section) | Applies to that specific agent config | +| **Global (user-level)** | `~/.config/cagent/config.yaml` under `settings.permissions` | Applies to every agent you run | + +Hooks follow the same user-config pattern: agent-level hooks live under `agents.<name>.hooks`, and global hooks live under `settings.hooks`. See [Hooks](../hooks/index.md#global-user-level-hooks). + +Both levels use the same `allow`/`ask`/`deny` pattern syntax. When both are present, they are **merged** at startup -- patterns from both sources are combined into a single checker. See [Merging Behavior](#merging-behavior) for details. + +## Agent-Level Configuration + +```yaml +agents: + root: + model: openai/gpt-4o + description: Agent with permission controls + instruction: You are a helpful assistant. + +permissions: + # Auto-approve these tools (no confirmation needed) + allow: + - "read_file" + - "read_*" # Glob patterns + - "shell:cmd=ls*" # With argument matching + + # Always ask before running these tools, even if an allow pattern would match + ask: + - "shell:cmd=git push*" + - "write_file:path=/home/user/important/*" + + # Block these tools entirely + deny: + - "shell:cmd=sudo*" + - "shell:cmd=rm*-rf*" + - "dangerous_tool" +``` + +The three lists are evaluated in order `deny` → `allow` → `ask`, so an `ask:` entry lets you add a confirmation layer on top of an otherwise-allowed tool. + +## Global Permissions + +Global permissions let you enforce rules across **all** agents, regardless of which agent config you run. Define them in your user config file: + +```yaml +# ~/.config/cagent/config.yaml +settings: + permissions: + deny: + - "shell:cmd=sudo*" + - "shell:cmd=rm*-rf*" + allow: + - "read_*" + - "shell:cmd=ls*" + - "shell:cmd=cat*" +``` + +This is useful for setting personal safety guardrails that apply everywhere -- for example, always blocking `sudo` or always auto-approving read-only tools -- without relying on each agent config to include those rules. + +### Merging Behavior + +When both global and agent-level permissions are present, they are merged into a single set of patterns before evaluation. The merge works as follows: + +- **Deny patterns from either source block the tool.** A global deny cannot be overridden by an agent-level allow, and vice versa. +- **Allow patterns from either source auto-approve the tool** (as long as no deny pattern matches). +- **Ask patterns from either source force confirmation** (as long as no deny or allow pattern matches). + +The evaluation order remains the same after merging: **Deny > Allow > Ask > default Ask**. + +> [!TIP] +> **Example: Global deny + agent allow** +> +> If your global config denies `shell:cmd=sudo*` and an agent config allows `shell:cmd=sudo apt update`, the deny wins. Deny patterns always take priority regardless of source. + +## Pattern Syntax + +Permissions support glob-style patterns with optional argument matching: + +### Simple Patterns + +| Pattern | Matches | +| -------------- | ------------------------------ | +| `shell` | Exact match for `shell` tool | +| `read_*` | Any tool starting with `read_` | +| `github_*` | Any GitHub MCP tool | +| `*` | All tools | + +### Argument Matching + +You can match tools based on their argument values using `tool:arg=pattern` syntax: + +```yaml +permissions: + allow: + # Allow shell only when cmd starts with "ls" or "cat" + - "shell:cmd=ls*" + - "shell:cmd=cat*" + + # Allow edit_file only in specific directory + - "edit_file:path=/home/user/safe/*" + + deny: + # Block shell with sudo + - "shell:cmd=sudo*" + + # Block writes to system directories + - "write_file:path=/etc/*" + - "write_file:path=/usr/*" +``` + +> [!NOTE] +> **Colons inside argument values are preserved.** Only the `:key=` token boundaries between +> argument conditions split a pattern — colons that appear inside a value are treated as +> ordinary characters and do not start a new condition. Check a tool’s actual argument names +> (and whether they accept a string or a list) before writing an argument-matching pattern. + +### Multiple Argument Conditions + +Chain multiple argument conditions with colons. All conditions must match: + +```yaml +permissions: + allow: + # Allow shell with ls in current directory + - "shell:cmd=ls*:cwd=." + + deny: + # Block shell with rm -rf anywhere + - "shell:cmd=rm*:cmd=*-rf*" +``` + +## Glob Pattern Rules + +Patterns follow filepath.Match semantics with some extensions: + +- `*` — matches any sequence of characters (including spaces) +- `?` — matches any single character +- `[abc]` — matches any character in the set +- `[a-z]` — matches any character in the range + +Matching is **case-insensitive**. + +> [!TIP] +> **Trailing Wildcards** +> +> Trailing wildcards like `sudo*` match any characters including spaces, so `sudo*` matches `sudo rm -rf /`. + +## Decision Types + +| Decision | Behavior | +| --------- | --------------------------------------------------- | +| **Allow** | Tool executes immediately without user confirmation | +| **Ask** | User must confirm before tool executes (default) | +| **Deny** | Tool is blocked and returns an error to the agent | + +## Examples + +### Read-Only Agent + +Allow all read operations, block all writes: + +```yaml +permissions: + allow: + - "read_file" + - "read_multiple_files" + - "list_directory" + - "directory_tree" + - "search_files_content" + deny: + - "write_file" + - "edit_file" + - "shell" +``` + +### Safe Shell Agent + +Allow specific safe commands, block dangerous ones: + +```yaml +permissions: + allow: + - "shell:cmd=ls*" + - "shell:cmd=cat*" + - "shell:cmd=grep*" + - "shell:cmd=find*" + - "shell:cmd=head*" + - "shell:cmd=tail*" + - "shell:cmd=wc*" + deny: + - "shell:cmd=sudo*" + - "shell:cmd=rm*" + - "shell:cmd=mv*" + - "shell:cmd=chmod*" + - "shell:cmd=chown*" +``` + +### MCP Tool Permissions + +Control MCP tools by their qualified names: + +```yaml +permissions: + allow: + # Allow all GitHub read operations + - "github_get_*" + - "github_list_*" + - "github_search_*" + deny: + # Block destructive GitHub operations + - "github_delete_*" + - "github_close_*" +``` + +## Combining with Hooks + +Permissions work alongside [hooks](../hooks/index.md). The evaluation order is: + +1. Run **`preempt_yolo` pre_tool_use hooks** — security-critical checks that no mode or allow rule can bypass +2. Check **deny** patterns — if matched, tool is blocked +3. Check **allow** patterns — if matched, tool is auto-approved +4. Check **ask** patterns — if matched, the user is prompted directly, skipping the default `pre_tool_use` lane +5. If no rule matched, apply the **[safety mode](#safety-modes)** to the call's safety label — may auto-approve (or, under `restricted`, deny) +6. On a mode "ask", run **pre_tool_use hooks** — hooks can allow, deny, or ask +7. If no decision, **ask user** for confirmation + +Default-lane hooks only see calls the mode routed to "ask"; they cannot override deny decisions or explicit `ask:` rules. + +> [!WARNING] +> **Security Note** +> +> Permissions are enforced client-side. They help prevent accidental operations but should not be relied upon as a security boundary for untrusted agents. For stronger isolation, use [sandbox mode](../sandbox/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/routing/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/routing/index.md new file mode 100644 index 000000000000..54c187bbf63f --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/routing/index.md @@ -0,0 +1,170 @@ +--- +title: "Model Routing" +description: "Route requests to different models based on the content of user messages." +keywords: docker agent, ai agents, configuration, yaml, model routing +weight: 100 +canonical: https://docs.docker.com/ai/docker-agent/configuration/routing/ +--- + +_Route requests to different models based on the content of user messages._ + +## Overview + +Model routing lets you define a "router" model that automatically selects the best underlying model based on the user's message. This is useful for cost optimization, specialized handling, or load balancing across models. + +> [!NOTE] +> **How It Works** +> +> Docker Agent uses NLP-based text similarity (via Bleve full-text search) to match user messages against example phrases you define. The route with the best-matching examples wins, and that model handles the request. + +## Configuration + +Add `routing` rules to any model definition. The model's `provider`/`model` fields become the fallback when no route matches: + +```yaml +models: + smart_router: + # Fallback model when no routing rule matches + provider: openai + model: gpt-5-mini + + # Routing rules + routing: + - model: anthropic/claude-sonnet-4-5 + examples: + - "Write a detailed technical document" + - "Help me architect this system" + - "Review this code for security issues" + - "Explain this complex algorithm" + + - model: openai/gpt-5 + examples: + - "Generate some creative ideas" + - "Write a story about" + - "Help me brainstorm" + - "Come up with names for" + + - model: openai/gpt-5-mini + examples: + - "What time is it" + - "Convert this to JSON" + - "Simple math calculation" + - "Translate this word" + +agents: + root: + model: smart_router + description: Assistant with intelligent model routing + instruction: You are a helpful assistant. +``` + +## Routing Rules + +Each routing rule has: + +| Field | Type | Required | Description | +| ---------- | ------ | -------- | ------------------------------------------------------------- | +| `model` | string | ✓ | Target model (inline format or reference to `models` section) | +| `examples` | array | ✓ | Example phrases that should route to this model | + +## Matching Behavior + +The router: + +1. Extracts the last user message from the conversation +2. Searches all examples using full-text search +3. Aggregates match scores by route (best score per route wins) +4. Selects the route with the highest overall score +5. Falls back to the base model if no good match is found + +> [!TIP] +> **Writing Good Examples** +> +> - Use diverse phrasing that captures the intent +> - Include keywords users actually use +> - Add 5-10 examples per route for best results +> - Examples don't need to be exact matches — the router uses semantic similarity + +## Use Cases + +### Cost Optimization + +Route simple queries to cheaper models: + +```yaml +models: + cost_optimizer: + provider: openai + model: gpt-5-mini # Cheap fallback + routing: + - model: anthropic/claude-sonnet-4-5 + examples: + - "Complex analysis" + - "Detailed research" + - "Multi-step reasoning" +``` + +### Specialized Models + +Route coding tasks to code-specialized models: + +```yaml +models: + task_router: + provider: openai + model: gpt-5-mini # General fallback + routing: + - model: anthropic/claude-sonnet-4-5 + examples: + - "Write code" + - "Debug this function" + - "Review my implementation" + - "Fix this bug" + - model: openai/gpt-5 + examples: + - "Write a blog post" + - "Help me with writing" + - "Summarize this document" +``` + +### Load Balancing + +Distribute load across equivalent models from different providers: + +```yaml +models: + load_balancer: + provider: openai + model: gpt-5-mini + routing: + - model: anthropic/claude-sonnet-4-5 + examples: + - "First request pattern" + - "Another request type" + - model: google/gemini-2.5-flash + examples: + - "Different request pattern" + - "Alternative query style" +``` + +## Debugging + +Enable debug logging to see routing decisions: + +```bash +$ docker agent run config.yaml --debug +``` + +Look for log entries like: + +```text +"Rule-based router selected model" router=smart_router selected_model=anthropic/claude-sonnet-4-5 +"Route matched" model=anthropic/claude-sonnet-4-5 score=2.45 +``` + +> [!WARNING] +> **Limitations** +> +> - Routing only considers the last user message, not full conversation context +> - Very short messages may not match well — consider your fallback carefully +> - Each routed model creates a separate provider connection diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/sandbox/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/sandbox/index.md new file mode 100644 index 000000000000..ec8cf9540d50 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/sandbox/index.md @@ -0,0 +1,286 @@ +--- +title: "Sandbox Mode" +description: "Run agents in an isolated sandbox VM managed by sbx." +keywords: docker agent, sbx, ai agents, configuration, yaml, sandbox mode +weight: 80 +canonical: https://docs.docker.com/ai/docker-agent/configuration/sandbox/ +--- + +_Run agents in an isolated sandbox VM managed by [`sbx`](https://docs.docker.com/ai/sandboxes/)._ + +## Overview + +Sandbox mode is Docker Agent's integration with +[`sbx`](https://docs.docker.com/ai/sandboxes/), Docker's sandbox product. `sbx` +provides the runtime, CLI, and VM; Docker Agent is one of its built-in agents. +The `--sandbox` flag asks `sbx` to create or reuse a VM and launches Docker +Agent inside it. + +All shell, filesystem, and process activity happens inside that VM, so a +misbehaving agent cannot touch files outside the mounted working directory or +reach long-lived host state. Docker Agent does not implement the sandbox or +start a raw `docker run` container; it orchestrates the installed `sbx` CLI. + +> [!NOTE] +> **Requirements** +> +> Install and configure the [`sbx` CLI](https://docs.docker.com/ai/sandboxes/) before +> using `--sandbox`. + +## Usage + +Enable sandbox mode with the `--sandbox` flag on the `docker agent run` command: + +```bash +docker agent run --sandbox agent.yaml +``` + +Docker Agent asks `sbx` to launch or reuse a sandbox VM, mounts the current +working directory, and runs the agent inside it. + +## Flags + +| Flag | Default | Description | +| ------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `--sandbox` | `false` | Enable sandbox mode. | +| `--template` | `docker/docker-agent-sbx-templates:latest` | OCI image used as the sandbox template. Passed to `sbx create -t`. See [Sandbox templates](#sandbox-templates). | +| `--no-kit` | `false` | Disable the [auto-kit](#auto-kit) — do not stage skills or prompt files into the sandbox. | + +```bash +# Use a custom template image +docker agent run --sandbox --template myorg/custom-agent-template:latest agent.yaml + +# Run without staging skills / prompt files into the sandbox +docker agent run --sandbox --no-kit agent.yaml +``` + +### Always sandbox a given agent + +Add `--sandbox` to an [alias](../../features/cli/index.md#docker-agent-alias) so the +sandbox path is taken automatically whenever that alias is invoked: + +```bash +docker agent alias add safe-coder myorg/coder --sandbox +docker agent run safe-coder +``` + +An explicit `--sandbox=false` on the command line still wins, so you can opt +out of the sandbox for a single run without touching the alias. + +### Bake the default into the agent config + +Agent authors can declare a sandbox default in the YAML itself. Any caller of +the agent then gets the sandbox path automatically, without having to know +(or remember) to pass `--sandbox`: + +```yaml +# agent.yaml +runtime: + sandbox: true + +agents: + root: + model: openai/gpt-4o + description: A helpful assistant + instruction: You are a helpful assistant. + toolsets: + - type: shell +``` + +```bash +docker agent run agent.yaml # runs in a sandbox automatically +``` + +The rule is the same as for aliases: an explicit `--sandbox=false` on the +CLI overrides the config default, so you can debug an agent on the host +without editing its YAML. + +### Declare a network allowlist + +The runner already opens the [tool install hosts](#network-allowlist) and +the [models gateway](#how-it-works) automatically, but agents that talk +to endpoints those resolvers can't infer (custom MCP servers, third-party +APIs, registries not covered by the aqua resolver) would still see a 403 +from the sandbox proxy on first contact. + +Declare those hosts in `runtime.network_allowlist` and they are unioned +with the inferred set, so the agent can reach them on its first request: + +```yaml +# agent.yaml +runtime: + sandbox: true + network_allowlist: + - api.example.com + - registry.npmjs.org +``` + +Each entry is a hostname with an optional `:port` suffix. Commas and +whitespace are rejected to keep a single entry from smuggling several +rules into the policy engine. The runner prints the resulting allowlist +before launch so you can audit exactly which hosts the run opens up. + +### Persist your own allowlist + +For hosts you keep needing across agents (a corporate proxy, a +self-hosted registry, ...) `docker agent sandbox allow` writes the +entry into `~/.config/cagent/config.yaml` once and unions it with the +inferred and agent-declared sets on every subsequent `--sandbox` run: + +```bash +# I just got a `Blocked by network policy` 403 on api.example.com. +docker agent sandbox allow api.example.com + +# See what's currently persisted. +docker agent sandbox list + +# Drop a host you no longer need. +docker agent sandbox deny api.example.com +``` + +When the kit's per-toolset host resolver fails (the `! using fallback +host set` line in the launch summary), the runner now prints a hint +pointing at this command so you can turn the missing host into a +one-line, persistent fix instead of relying on the wider conservative +fallback host set. + +## Sandbox templates + +A sandbox template is the OCI image the sandbox VM boots from. It determines +the base OS and the tools available inside the VM, including whether the +`docker-agent` binary is already there. `--template` (or `-t` on `sbx +create`) selects it. + +### The default template + +`--template` defaults to `docker/docker-agent-sbx-templates:latest`, the +template this repository's own CI builds and publishes from the most recent +`v*` release — see [The repo-published templates](#the-repo-published-templates) +for what it contains and the other available tags. + +### The repo-published templates + +This repository's own CI builds and publishes the sandbox template — from +the `template` stage of the +[`Dockerfile`](https://github.com/docker/docker-agent/blob/main/Dockerfile) — +as `docker/docker-agent-sbx-templates`: + +| Tag | Built from | Use it when | +| --------- | ------------------------------ | ------------------------------------------------------------------- | +| `:latest` | The most recent `v*` release | You want the newest Docker Agent template with release stability (the default). | +| `:edge` | The current `main` branch | You want today's `main` build and can tolerate lower stability. | + +(Each release also publishes a matching version-pinned tag, e.g. +`docker/docker-agent-sbx-templates:1.2.3`.) + +`:latest` is the default. Reach for `:edge` only when you specifically +need an unreleased fix or feature and can tolerate the occasional breakage. +For reproducible runs, pin to a digest instead of a tag, e.g. +`docker/docker-agent-sbx-templates@sha256:...`. + +Select one with `--template`: + +```bash +$ docker agent run --sandbox --template docker/docker-agent-sbx-templates:edge agent.yaml +``` + +Or point the [`sbx`](https://docs.docker.com/ai/sandboxes/) CLI at it +directly, without going through Docker Agent: + +```bash +$ sbx create -t docker/docker-agent-sbx-templates:latest +``` + +> [!TIP] +> The [`sbx` documentation](https://docs.docker.com/ai/sandboxes/) covers the +> sandbox CLI and runtime independently of Docker Agent. + +### What they contain + +The `template` stage in this repository's +[`Dockerfile`](https://github.com/docker/docker-agent/blob/main/Dockerfile) +layers onto `docker/sandbox-templates:shell-docker` and adds: + +- The `docker-agent` binary. +- `vim` and `tmux`, for interactive debugging inside the VM. +- The **`docker-mcp`** Docker CLI plugin, installed at `~/.docker/cli-plugins/docker-mcp`. + +The image carries the label `com.docker.sandboxes.flavor=docker-agent-docker` +so sandbox tooling can identify it. + +## Example + +```yaml +# agent.yaml +agents: + root: + model: openai/gpt-4o + description: Agent with sandboxed shell + instruction: You are a helpful assistant. + toolsets: + - type: shell +``` + +```bash +docker agent run --sandbox agent.yaml +``` + +## How It Works + +1. `--sandbox` tells Docker Agent to invoke the installed `sbx` CLI. +2. A new sandbox VM is created from the image passed via `--template`. +3. The current working directory is mounted into the VM; the agent binary is copied in. +4. The [auto-kit](#auto-kit) is staged on the host and bind-mounted read-only into the VM, so the agent sees its skills and prompt files inside the sandbox. +5. The default-deny network proxy is opened for the configured [models gateway](../../features/cli/index.md#runtime-configuration-flags) and any package hosts the auto-installer needs for the agent's MCP/LSP toolsets. +6. All tools (shell, filesystem, background jobs, etc.) run inside the VM. +7. When the session ends, Docker Agent exits but does not stop or remove the sandbox VM; both the VM and the kit are kept around so subsequent runs from the same workspace can reuse them. A fresh sandbox is created only when the mount set has changed. + +### What the default template includes + +The default template (`docker/docker-agent-sbx-templates:latest`) is built +from this repository's own `Dockerfile` — see +[What they contain](#what-they-contain) for the exact contents, including +the `docker-mcp` CLI plugin. + +## Auto-Kit + +The sandbox VM has its own filesystem and `$HOME` — none of the host's `~/.agents/skills/`, `~/.claude/skills/`, project-level `.agents/skills/`, or prompt files like `AGENTS.md` and `CLAUDE.md` are visible inside it. To bridge that gap, Docker Agent automatically builds a **kit**: a self-contained directory staged on the host before the sandbox starts and bind-mounted read-only into the VM at the same path. + +The kit is built whenever `--sandbox` is used with an agent reference. It is opt-out via `--no-kit`. + +### What gets staged + +For the agent referenced on the command line, the kit collects: + +- **Local [skills](../../features/skills/index.md)** — every `SKILL.md` discovered on the host (global `~/.codex/skills/`, `~/.claude/skills/`, `~/.agents/skills/`, plus project `.claude/skills/`, `.github/skills/` and `.agents/skills/`) is copied under `<kit>/skills/<skill-name>/`. The in-sandbox skills loader reads from the kit instead of the (non-existent) host `$HOME`. +- **Prompt files** — every file referenced via the agent's `add_prompt_files` (`AGENTS.md`, `CLAUDE.md`, …) is collected. Files that already live under the working directory are left alone (the live workspace mount surfaces them); files outside it (e.g. an `AGENTS.md` in `$HOME`) are copied under `<kit>/prompt_files/`. +- **A manifest** — `<kit>/manifest.json` records what was staged. The on-disk copy is sanitised so it cannot be used to map the host filesystem from inside the sandbox. + +Before launch, Docker Agent prints a summary of what was staged so you can see exactly which skills and prompt files the agent will have access to inside the sandbox. + +### Secret redaction + +Every text file copied into the kit is run through [portcullis](https://github.com/docker/portcullis), which redacts secrets that match its detection patterns (API keys, tokens, …) in the staged copy. The kit's printed summary marks files as `(redacted)` whenever at least one secret was replaced. Detection is best-effort — portcullis recognises common secret formats but novel or obfuscated tokens may slip through, so the kit is not a substitute for keeping secrets out of skill sources in the first place. + +### Network allowlist + +The sandbox templates ship with a default-deny network proxy that allows the major model providers but blocks `*.docker.com` and every package-registry / source host the auto-installer reaches for. When the agent declares MCP or LSP toolsets that have a `command` and an installable `version`, the kit build resolves each toolset's package against the [aqua](https://aquaproj.github.io/) registry and computes the minimal set of hosts the in-sandbox auto-installer will need (Go module proxy + toolchain bootstrap for `go_install` packages, GitHub release hosts for `github_release` packages, …). Those hosts, `models.dev` (needed so the in-sandbox agent can resolve model metadata such as context limits, pricing, and capabilities — without it the first catalog lookup fails with a `403 Blocked by network policy` error), and the configured [`--models-gateway`](../../features/cli/index.md#runtime-configuration-flags) — are then allow-listed on the sandbox proxy. If a per-toolset registry lookup fails, a conservative fallback union is used so the run can still succeed; the affected toolsets are surfaced in the printed summary. + +### Caching + +Kits are stored under the Docker Agent cache directory (`~/Library/Caches/cagent/sandbox-kits/<hash>` on macOS) keyed by a content hash of the agent reference. Reusing the same agent across runs reuses the same kit directory in place; disk usage is bounded by the number of distinct agents you have run. Kits are deliberately kept on disk between runs because the reused sandbox VM holds a hard reference to the kit's bind-mount path — deleting it would leave the sandbox un-startable. + +### Disabling the kit + +Pass `--no-kit` to skip the kit build entirely. The agent then runs without any host-side skills or external prompt files visible inside the sandbox, and the network allowlist falls back to the template defaults. Useful for debugging the sandbox itself, or for agents that don't depend on host skills. + +```bash +docker agent run --sandbox --no-kit agent.yaml +``` + +> [!WARNING] +> **Limitations** +> +> - Sandboxes are reused across runs from the same workspace; if the required mount set changes (e.g. a new kit is staged), the previous sandbox is removed and a fresh one is created. +> - Only the working directory, the agent config directory, and (when staged) the kit directory are mounted; other host files are not visible to the agent. +> - Network egress is constrained by the sandbox backend's default-deny policy plus the per-run allowlist described above. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/structured-output/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/structured-output/index.md new file mode 100644 index 000000000000..9dc4c9e30343 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/structured-output/index.md @@ -0,0 +1,250 @@ +--- +title: "Structured Output" +description: "Force the agent to respond with JSON matching a specific schema." +keywords: docker agent, ai agents, configuration, yaml, structured output +weight: 90 +canonical: https://docs.docker.com/ai/docker-agent/configuration/structured-output/ +--- + +_Force the agent to respond with JSON matching a specific schema._ + +## Overview + +Structured output constrains the agent's responses to match a predefined JSON schema. This is useful for building agents that need to produce machine-readable output for downstream processing, API responses, or integration with other systems. + +> [!NOTE] +> **When to Use** +> +> - Building API endpoints that need consistent JSON responses +> - Data extraction and transformation pipelines +> - Agents that feed into other automated systems +> - Ensuring predictable output format for parsing + +## Configuration + +```yaml +agents: + analyzer: + model: openai/gpt-4o + description: Code analyzer that outputs structured results + instruction: | + Analyze the provided code and identify issues. + Return your findings in the structured format. + structured_output: + name: analysis_result + description: Code analysis findings + strict: true + schema: + type: object + properties: + issues: + type: array + items: + type: object + properties: + severity: + type: string + enum: ["error", "warning", "info"] + line: + type: integer + message: + type: string + required: ["severity", "line", "message"] + summary: + type: string + required: ["issues", "summary"] +``` + +## Properties + +| Property | Type | Required | Description | +| ------------- | ------- | -------- | ----------------------------------------------------------------- | +| `name` | string | ✓ | Name identifier for the output schema | +| `description` | string | ✗ | Description of what the output represents | +| `strict` | boolean | ✗ | Enforce strict schema adherence — `native` mode only (default: `false`) | +| `schema` | object | ✓ | JSON Schema defining the output structure | +| `mode` | string | ✗ | Enforcement mode: `native` (default) or `tool` (see [Modes](#modes)) | + +## Modes + +### `native` (default) + +The schema is passed to the provider's native structured-output support (OpenAI JSON mode, Gemini JSON mode, ...). Omitting `mode` keeps this behavior. + +### `tool` + +```yaml +structured_output: + mode: tool + name: analysis_result + schema: + type: object + properties: + summary: + type: string + required: ["summary"] +``` + +In tool mode nothing is sent to the provider's native structured-output API. Instead, the runtime exposes an internal tool named `__structured_output__` whose parameters are exactly the configured schema. The model works normally — including calling other tools — and delivers its final answer by calling that tool, alone, as the only tool call of its response. The runtime validates the arguments against the schema: + +- A valid call ends the turn; the validated (compacted) JSON becomes the final assistant message. +- Invalid JSON gets a detailed tool error so the model can correct itself and retry. +- If the model answers in plain text instead, the runtime injects a transient system reminder and retries (at most 2 reminders), then fails with a `structured_output_failed` error. + +Tool-mode validation applies the full JSON Schema, including `additionalProperties` — unexpected fields are rejected when the schema forbids them. External `$ref` references (`http(s)://`, `file://`, cross-document) are rejected when the schema is compiled; only same-document references starting with `#` (e.g. `#/definitions/item`) are allowed. The `strict` flag has no effect in tool mode. + +Fork-mode skills (`context: fork`) run as exempt sub-sessions: the skill produces its own plain-text answer for the calling agent and is not required to call the output tool. The parent agent still delivers its final answer through the tool. + +Use tool mode when the model must combine tool use with a schema-constrained final answer, or when the provider has no native structured-output support. See [`examples/structured-output-tool-mode.yaml`](https://github.com/docker/docker-agent/blob/main/examples/structured-output-tool-mode.yaml). + +## Schema Format + +The schema follows [JSON Schema](https://json-schema.org/) specification. Common schema types: + +### Simple Object + +```yaml +schema: + type: object + properties: + name: + type: string + count: + type: integer + active: + type: boolean + required: ["name", "count"] +``` + +### Array of Objects + +```yaml +schema: + type: object + properties: + items: + type: array + items: + type: object + properties: + id: + type: string + value: + type: number + required: ["id", "value"] + required: ["items"] +``` + +### Enum Values + +```yaml +schema: + type: object + properties: + status: + type: string + enum: ["pending", "approved", "rejected"] + priority: + type: string + enum: ["low", "medium", "high", "critical"] + required: ["status"] +``` + +## Strict Mode + +`strict` only applies to `native` mode: it is passed to the provider's structured-output API. Tool mode ignores it and always validates against the full schema instead. When `strict: true`, the model is constrained to only produce output that exactly matches the schema. This provides stronger guarantees but may limit the model's flexibility. + +- **`strict: false` (default)** — model aims to match the schema but may include additional fields or slight variations. +- **`strict: true`** — model output is constrained to exactly match the schema. Stronger guarantees. + +## Provider Support + +Structured output support varies by provider: + +| Provider | Support | Notes | +| ------------- | ---------- | --------------------------------------- | +| OpenAI | ✓ Full | Native JSON mode with schema validation | +| Anthropic | ✓ Full | Tool-based structured output | +| Google Gemini | ✓ Full | Native JSON mode | +| AWS Bedrock | ✓ Partial | Depends on underlying model | +| DMR | ⚠️ Limited | Depends on model capabilities | + +## Example: Data Extraction Agent + +```yaml +agents: + extractor: + model: openai/gpt-4o + description: Extract structured data from text + instruction: | + Extract contact information from the provided text. + Return all found contacts in the structured format. + structured_output: + name: contacts + description: Extracted contact information + strict: true + schema: + type: object + properties: + contacts: + type: array + items: + type: object + properties: + name: + type: string + description: Full name of the contact + email: + type: string + description: Email address + phone: + type: string + description: Phone number + company: + type: string + description: Company or organization + required: ["name"] + total_found: + type: integer + description: Total number of contacts found + required: ["contacts", "total_found"] +``` + +## Example: Classification Agent + +```yaml +agents: + classifier: + model: anthropic/claude-sonnet-4-5 + description: Classify support tickets + instruction: | + Classify the support ticket into the appropriate category + and priority level based on its content. + structured_output: + name: ticket_classification + strict: true + schema: + type: object + properties: + category: + type: string + enum: + ["billing", "technical", "account", "feature_request", "other"] + priority: + type: string + enum: ["low", "medium", "high", "urgent"] + confidence: + type: number + minimum: 0 + maximum: 1 + description: Confidence score between 0 and 1 + reasoning: + type: string + description: Brief explanation for the classification + required: ["category", "priority", "confidence"] +``` + +> [!WARNING] +> **Tool Limitations** +> +> When using native structured output, the agent typically cannot use tools since its response format is constrained to the schema. Design your agent workflow accordingly — native structured output agents work best for single-turn analysis or extraction tasks. Use `mode: tool` when the agent needs to call tools before producing its schema-constrained final answer. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/tools/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/tools/index.md new file mode 100644 index 000000000000..ff25b1f45ba0 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/tools/index.md @@ -0,0 +1,518 @@ +--- +title: "Tool Configuration" +description: "Complete reference for configuring built-in tools, MCP tools, and Docker-based tools." +keywords: docker agent, ai agents, configuration, yaml, tool configuration +linkTitle: "Tool Config" +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/configuration/tools/ +aliases: + - /ai/docker-agent/reference/toolsets/ +--- + +_Complete reference for configuring built-in tools, MCP tools, and Docker-based tools._ + +## Built-in Tools + +Built-in tools are included with Docker Agent and require no external dependencies. Add them to your agent's `toolsets` list by `type`. Each tool's dedicated page covers its full configuration options, available operations, and examples. + +| Type | Description | Page | +| --- | --- | --- | +| `filesystem` | Read, write, list, search, navigate | [Filesystem](../../tools/filesystem/index.md) | +| `git` | Read-only repository inspection (status, log, branches, show, blame) | [Git](../../tools/git/index.md) | +| `shell` | Execute shell commands synchronously | [Shell](../../tools/shell/index.md) | +| `background_jobs` | Run and manage long-running shell commands | [Background Jobs](../../tools/background-jobs/index.md) | +| `scheduler` | Schedule instructions to run at a time or on a recurring interval | [Scheduler](../../tools/scheduler/index.md) | +| `think` | Reasoning scratchpad | [Think](../../tools/think/index.md) | +| `plan` | Shared persistent scratchpad for multi-agent collaboration | [Plan](../../tools/plan/index.md) | +| `session_plan` | Per-session markdown plan for the draft-review-execute workflow | [Session Plan](../../tools/session_plan/index.md) | +| `session_context` | Reference a previous session as context (read-only) | [Session Context](../../tools/session_context/index.md) | +| `todo` | Task list management | [Todo](../../tools/todo/index.md) | +| `memory` | Persistent key-value storage (SQLite) | [Memory](../../tools/memory/index.md) | +| `tasks` | Persistent task database shared across sessions | [Tasks](../../tools/tasks/index.md) | +| `fetch` | HTTP `GET` requests with text/markdown/html output | [Fetch](../../tools/fetch/index.md) | +| `script` | Custom shell scripts as tools | [Script](../../tools/script/index.md) | +| `lsp` | Language Server Protocol integration | [LSP](../../tools/lsp/index.md) | +| `api` | Custom HTTP API tools | [API](../../tools/api/index.md) | +| `openapi` | Import every operation of an OpenAPI 3.x document as tools | [OpenAPI](../../tools/openapi/index.md) | +| `rag` | Retrieval-augmented generation over indexed sources | [RAG](../../tools/rag/index.md) | +| `model_picker` | Let the agent pick between several models per turn | [Model Picker](../../tools/model-picker/index.md) | +| `user_prompt` | Interactive user input | [User Prompt](../../tools/user-prompt/index.md) | +| `open_url` | Open a fixed URL in the user's default browser | [Open URL](../../tools/open-url/index.md) | +| `transfer_task` | Delegate to sub-agents (auto-enabled) | [Transfer Task](../../tools/transfer-task/index.md) | +| `background_agents` | Parallel sub-agent dispatch | [Background Agents](../../tools/background-agents/index.md) | +| `webhook` | Reliable notifications to a configured destination, with retries (Slack, Discord, Telegram, IFTTT, Teams, …) | [Webhook](../../tools/webhook/index.md) | +| `handoff` | Local conversation handoff to another agent in the same config (auto-enabled by `handoffs:`) | [Handoff](../../tools/handoff/index.md) | +| `a2a` | A2A remote agent connection | [A2A](../../tools/a2a/index.md) | +| `mcp_catalog` | Discover and activate remote MCP servers from the Docker MCP Catalog on demand | [MCP Catalog](../../tools/mcp-catalog/index.md) | + +**Example:** + +```yaml +toolsets: + - type: filesystem + - type: shell + - type: background_jobs + - type: think + - type: todo + - type: memory + path: ./dev.db +``` + +## MCP Tools + +Extend agents with external tools via the [Model Context Protocol](https://modelcontextprotocol.io/). For a standalone overview of the `mcp` toolset see the [MCP tool page](../../tools/mcp/index.md). + +> [!TIP] +> **Reusable MCP definitions** +> +> Repeated MCP server definitions can be hoisted into the top-level `mcps:` section and referenced by name with `{type: mcp, ref: <name>}`. See [Reusable MCP Servers](../overview/index.md#reusable-mcp-servers-mcps). + +### Docker MCP (Recommended) + +Run MCP servers as secure Docker containers via the [MCP Gateway](https://github.com/docker/mcp-gateway): + +```yaml +toolsets: + - type: mcp + ref: docker:duckduckgo # web search + - type: mcp + ref: docker:github-official # GitHub integration +``` + +Browse available tools at the [Docker MCP Catalog](https://hub.docker.com/search?q=&type=mcp). + +| Property | Type | Description | +| ------------- | ------ | ---------------------------------------------------------------- | +| `ref` | string | Docker MCP reference (`docker:name`) | +| `tools` | array | Optional: only expose these tools | +| `instruction` | string | Custom instructions injected into the agent's context | +| `config` | any | MCP server-specific configuration (passed during initialization) | +| `working_dir` | string | Working directory for the MCP gateway subprocess. Only applies when the catalog entry runs as a local process (not remote). Relative paths are resolved against the agent's working directory. Supports `${env.VAR}` (canonical), plus `~` and shell-style `$VAR`/`${VAR}` expansion ([details](../overview/index.md#variable-expansion-in-config-fields)). | + +### Local MCP (stdio) + +Run MCP servers as local processes communicating over stdin/stdout: + +```yaml +toolsets: + - type: mcp + command: python + args: ["-m", "mcp_server"] + tools: ["search", "fetch"] + env: + API_KEY: value +``` + +| Property | Type | Description | +| --- | --- | --- | +| `command` | string | Command to execute the MCP server | +| `args` | array | Command arguments | +| `tools` | array | Optional: only expose these tools | +| `env` | object | Environment variables (key-value pairs) | +| `working_dir` | string | Working directory for the MCP server process. Relative paths are resolved against the agent's working directory. Defaults to the agent's working directory when omitted. Supports `${env.VAR}` (canonical), plus `~` and shell-style `$VAR`/`${VAR}` expansion ([details](../overview/index.md#variable-expansion-in-config-fields)). | +| `instruction` | string | Custom instructions injected into the agent's context | +| `version` | string | Package reference for [auto-installing](#auto-installing-tools) the command binary | + +### Remote MCP (Streamable HTTP / SSE) + +Connect to MCP servers over the network: + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp-server.example.com" + transport_type: "streamable" + headers: + Authorization: "Bearer your-token" + # Optional: allow OAuth helper requests to reach private/internal IPs. + allow_private_ips: true + tools: ["search_web", "fetch_url"] +``` + +| Property | Type | Description | +| ----------------------- | ------- | --------------------------------------------------------------------------------------------------------------------- | +| `remote.url` | string | URL of the MCP server. Accepts `https://`, `http://`, and `unix://` (Unix domain socket) schemes. | +| `remote.transport_type` | string | `streamable` or `sse` | +| `remote.headers` | object | HTTP headers sent on every request. Values support `${env.VAR}` and `${headers.NAME}` placeholders, resolved per request. `${env.VAR}` reads an environment variable; `${headers.NAME}` forwards a header from the caller's incoming request (useful when Docker Agent runs as an API server). | +| `allow_private_ips` | boolean | Permit remote MCP OAuth helper requests to dial non-public IP addresses. Use only for trusted internal servers. | + +## Auto-Installing Tools + +When configuring MCP or LSP tools that require a binary command, Docker Agent can **automatically download and install** the command if it's not already available on your system. This uses the [aqua registry](https://github.com/aquaproj/aqua-registry) — a curated index of CLI tool packages. + +### How It Works + +1. When a toolset with a `command` is loaded, Docker Agent checks if the command is available in your `PATH` +2. If not found, it checks the Docker Agent tools directory (`~/.cagent/tools/bin/`) +3. If still not found, it looks up the command in the aqua registry and installs it automatically + +### Explicit Package Reference + +Use the `version` property to specify exactly which package to install: + +```yaml +toolsets: + - type: mcp + command: gopls + version: "golang/tools@v0.21.0" + args: ["mcp"] + - type: lsp + command: rust-analyzer + version: "rust-lang/rust-analyzer@2024-01-01" + file_types: [".rs"] +``` + +The format is `owner/repo` or `owner/repo@version`. When a version is omitted, the latest release is used. + +### Automatic Detection + +If the `version` property is not set, Docker Agent tries to auto-detect the package from the command name by searching the aqua registry: + +```yaml +toolsets: + - type: mcp + command: gopls # auto-detected as golang/tools + args: ["mcp"] +``` + +### Checksum Verification + +Where the aqua registry includes a checksum manifest, downloaded binaries are verified against it before installation. Verification behaviour depends on the checksum type advertised: + +- **Strong checksums (sha256, sha512, etc.)** — verified before the binary is installed. If the downloaded archive does not match, the install is aborted and an error is returned (fails closed). +- **Unsupported or weak checksum types (e.g. md5, sha1)** — skipped with a warning; installation proceeds without verification. +- **No manifest** — if no checksum is advertised in the registry entry, the binary is installed without verification. + +### version_overrides Resolution + +The auto-installer correctly resolves **`version_overrides`** entries in the aqua registry. Many common tools (for example, `fzf`) keep their package configuration — including download URLs and checksums — under `version_overrides` rather than at the top level of their registry entry. These tools previously failed to install silently; they are now handled correctly. + +### Disabling Auto-Install + +**Per toolset** — set `version` to `"false"` or `"off"`: + +```yaml +toolsets: + - type: mcp + command: my-custom-server + version: "false" +``` + +**Globally** — set the `DOCKER_AGENT_AUTO_INSTALL` environment variable: + +```bash +export DOCKER_AGENT_AUTO_INSTALL=false +``` + +### Environment Variables + +| Variable | Default | Description | +| ---------------------------- | ------------------ | ------------------------------------------------ | +| `DOCKER_AGENT_AUTO_INSTALL` | (enabled) | Set to `false` to disable all auto-installation | +| `DOCKER_AGENT_TOOLS_DIR` | `~/.cagent/tools/` | Base directory for installed tools | +| `GITHUB_TOKEN` | — | GitHub token to raise API rate limits (optional) | + +Installed binaries are placed in `~/.cagent/tools/bin/` and cached so they are only downloaded once. + +> [!TIP] +> Auto-install supports both Go packages (via `go install`) and GitHub release binaries (via archive download). The aqua registry metadata determines which method is used. + +## Toolset Lifecycle + +Long-running toolsets — local MCP servers (stdio), remote MCP servers (Streamable HTTP / SSE), and LSP servers — are managed by a single supervisor that can auto-reconnect them when they crash, time out, or drop their session. The `lifecycle` block on the toolset lets you tune that supervisor per toolset. It applies to every `type: mcp` and `type: lsp` toolset. + +The simplest knob is `profile`, which picks a preset: + +| Profile | Auto-restart | Use case | +| --- | --- | --- | +| `resilient` | Yes | Default. Exponential backoff on disconnect; the agent keeps running if the toolset is unavailable. Matches the historical Docker Agent behaviour. | +| `strict` | No | Fail-fast. Marks the toolset as required. Intended for CI / headless runs where a missing dependency should be a hard error. | +| `best-effort` | No | Single attempt, no retries. Good for experimental MCPs whose flakiness should not amplify into a restart loop. | + +```yaml +toolsets: + - type: mcp + ref: docker:duckduckgo + lifecycle: + profile: resilient # default; shown here for clarity + + - type: lsp + command: gopls + file_types: [".go"] + lifecycle: + profile: strict + + - type: mcp + ref: docker:openbnb-airbnb + lifecycle: + profile: best-effort +``` + +### Tuning the defaults + +Any field set on `lifecycle` overrides the profile preset, so you can mix-and-match: pick a profile and only override the knobs you care about. + +```yaml +toolsets: + - type: mcp + command: ["docker", "mcp", "gateway"] + lifecycle: + profile: resilient + max_restarts: 10 # keep trying longer than the default of 5 + backoff: + initial: 500ms + max: 1m + multiplier: 2 + jitter: 0.2 # 20% random offset to avoid thundering-herd retries +``` + +| Property | Type | Description | +| --- | --- | --- | +| `profile` | string | One of `resilient` (default), `strict`, `best-effort`. Picks defaults for every other field. | +| `restart` | string | When the supervisor should reconnect after a disconnect: `never`, `on_failure` (default), or `always`. For **remote** MCP toolsets (Streamable HTTP / SSE), `on_failure` is automatically promoted to `always` so idle-timeout closes reconnect gracefully — `never` is still honored. | +| `max_restarts` | int | Maximum consecutive restart attempts before the toolset is marked `Failed`. `0` uses the profile default (5); `-1` means unlimited. | +| `backoff.initial` | duration | First wait between attempts (Go duration: `500ms`, `1s`, …). Default: `1s`. | +| `backoff.max` | duration | Cap on the wait between attempts. Default: `32s`. | +| `backoff.multiplier` | number | Multiplier applied each attempt. Default: `2`. | +| `backoff.jitter` | number | Fraction (0..1) of the computed delay applied as a uniform random offset. `0` disables jitter (default). | +| `required` | boolean | Marks the toolset as critical. Today this is informational; a future eager-startup phase will refuse to start the agent when a required toolset cannot reach Ready. Defaults to `true` under `strict`, `false` otherwise. | +| `startup_timeout` | duration | Cap on the initial connect+initialize duration. Enforced since v1.94.0: on expiry the toolset stays stopped and the runtime retries on the next turn. | +| `call_timeout` | duration | Cap on an individual tool call, including one reconnect-retry. Enforced: on expiry the call is cancelled and surfaced to the model as a tool error; cancellation is propagated to the server. `0`/unset means no timeout — opt-in only, no profile default. | + +> [!NOTE] +> **`required` is not yet enforced** +> +> The schema validates this field and the supervisor stores it, but no code path acts on it yet. It is documented now so config files written today keep working when the planned eager-startup phase lands. Picking the `strict` profile is forward-compatible — it will start enforcing `required=true` automatically. + +### Inspecting and restarting toolsets at runtime + +The TUI exposes the supervisor through two slash commands: + +- `/tools` — the unified tools dialog. Its top section lists every toolset on the current agent with its lifecycle state (`Stopped`, `Starting`, `Ready`, `Degraded`, `Restarting`, `Failed`), restart count, and last error; its bottom section lists every tool the agent can call, grouped by category. Use this to answer both "what can the agent do?" and "is anything degraded?" with one command. +- `/toolset-restart <name>` — force the supervisor to reconnect the named toolset. Useful after completing OAuth, when a remote MCP server has been redeployed, or when an LSP like `gopls` is stuck. + +See the [TUI reference](../../features/tui/index.md) for the full list of slash commands. + +See [`examples/lifecycle.yaml`](https://github.com/docker/docker-agent/blob/main/examples/lifecycle.yaml) for a complete lifecycle configuration example. + +## TOON-Encoded Tool Outputs + +Many MCP servers return verbose JSON responses that consume a lot of context budget. The `toon` field on a toolset transparently re-encodes matching tools' JSON output as [TOON](https://github.com/alpkeskin/gotoon) — a compact, model-friendly key/value format — before the result is shown to the model. + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + toon: ".*" # toonify every tool from this MCP server + - type: mcp + command: my-server + toon: "list_.*,get_.*" # only toonify list_/get_ tools +``` + +| Property | Type | Description | +| -------- | ------ | ----------- | +| `toon` | string | Comma-delimited list of regular expressions matching tool names whose JSON output should be re-encoded as TOON. Non-JSON outputs and non-matching tools are passed through untouched. | + +When a tool's output is not valid JSON, it is returned unchanged — TOON encoding is best-effort and never breaks tools that emit plain text. + +> [!NOTE] +> **When to use TOON** +> +> TOON typically yields 30-60% smaller payloads than equivalent JSON for MCP tools that return arrays of records (issue lists, search results, file listings, …). It works best when the schema is regular; one-off responses with deeply nested or heterogeneous shapes may benefit less. + +## Per-Toolset Model Routing + +The `model` field on a toolset overrides which LLM is invoked for the **next turn** after a tool from that toolset returns — letting you process simple tool results (file reads, knowledge-base lookups, shell stdout) with a cheaper or faster model while keeping the agent's primary model for reasoning. + +```yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + fast: + provider: anthropic + model: claude-haiku-4-5 + +agents: + root: + model: primary + toolsets: + - type: filesystem + model: fast # process file reads with the fast model + - type: shell + model: fast # ditto for shell stdout + - type: mcp + ref: docker:github-official + model: openai/gpt-4o-mini # inline provider/model also works +``` + +| Property | Type | Description | +| -------- | ------ | ----------- | +| `model` | string | Model used for the LLM turn that processes tool results from this toolset. Either a name from the `models:` section or an inline `provider/model` (e.g. `openai/gpt-4o-mini`). The override is **one-shot**: subsequent turns return to the agent's primary model. | + +When multiple tool calls in a single turn come from toolsets with different `model` overrides, the runtime picks the override of the **first** tool call that has one set. See [`examples/per_tool_model_routing.yaml`](https://github.com/docker/docker-agent/blob/main/examples/per_tool_model_routing.yaml) for a complete configuration. + +## Tool Filtering + +Toolsets may expose many tools. Use the `tools` property to whitelist only the ones your agent needs. This works for any toolset type — not just MCP: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + tools: ["list_issues", "create_issue", "get_pull_request"] + - type: filesystem + tools: ["read_file", "search_files_content"] + - type: shell + tools: ["shell"] +``` + +> [!TIP] +> Filtering tools improves agent performance — fewer tools means less confusion for the model about which tool to use. + +## Tool Instructions + +Add context-specific instructions that get injected when a toolset is loaded: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + instruction: | + Use these tools to manage GitHub issues. + Always check for existing issues before creating new ones. + Label new issues with 'triage' by default. +``` + +By default, the `instruction:` field **replaces** the toolset's built-in instructions (if any). To keep the built-in guidance and add your own rules on top, include the `{ORIGINAL_INSTRUCTIONS}` placeholder anywhere in your instruction text. At runtime it expands to the toolset's default instructions: + +```yaml +toolsets: + # Enrich: keep built-in instructions, then add your own rules + - type: filesystem + instruction: | + {ORIGINAL_INSTRUCTIONS} + + ## Project-specific rules + - Never modify files outside the `src/` directory. + - Always create a backup before overwriting a file. + + # Enrich: prepend your rules before the built-in instructions + - type: shell + instruction: | + Important: only run commands inside the project root. + {ORIGINAL_INSTRUCTIONS} + + # Replace: omit the placeholder to discard built-in instructions entirely + - type: mcp + ref: docker:github-official + instruction: | + Only read GitHub issues. Never create, edit, or close anything. +``` + +Three patterns at a glance: + +| Pattern | Description | +| --- | --- | +| `{ORIGINAL_INSTRUCTIONS}` then your text | Append your rules after the defaults | +| Your text then `{ORIGINAL_INSTRUCTIONS}` | Prepend your rules before the defaults | +| No placeholder | Replace the defaults entirely | + +See [`examples/toolset_instructions.yaml`](https://github.com/docker/docker-agent/blob/main/examples/toolset_instructions.yaml) for a complete example. + +## Deferred Tool Loading + +Load tools on-demand to speed up agent startup. When a toolset is deferred, its tools are registered lazily — the tool server process is not started until the agent first calls one of its tools. This is useful for large toolsets (e.g., an MCP server with hundreds of tools) where startup time matters. + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + defer: true + - type: mcp + ref: docker:slack + defer: true + - type: filesystem +``` + +Or defer specific tools within a toolset: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + defer: + - "list_issues" + - "search_repos" +``` + +When `defer` is a list of tool names, only those specific tools are deferred; all other tools in the toolset load eagerly. Setting `defer: true` defers the entire toolset. + +### Tool Discovery with `search_tool` + +When an entire toolset is deferred (`defer: true`), the deferred toolset exposes two built-in tools to the agent: + +- **`search_tool`** — Discover available deferred tools by keyword. The search uses **fuzzy matching** against both tool names and descriptions: all characters of the query must appear in the target string in order (but not necessarily adjacently), so a query like `"crfil"` matches `"create_file"`. Returns a list of matching tool names with descriptions. +- **`add_tool`** — Activate a discovered tool by name so it becomes available for use. + +These tools let the agent browse a large toolset on-demand without activating every tool upfront. + +See [`examples/deferred.yaml`](https://github.com/docker/docker-agent/blob/main/examples/deferred.yaml) for a complete example. + +## Combined Example + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Full-featured developer assistant + instruction: You are an expert developer. + toolsets: + # Built-in tools + - type: filesystem + - type: shell + - type: think + - type: todo + - type: memory + path: ./dev.db + - type: user_prompt + # LSP for code intelligence + - type: lsp + command: gopls + file_types: [".go"] + # Custom scripts + - type: script + shell: + run_tests: + description: Run the test suite + cmd: task test + lint: + description: Run the linter + cmd: task lint + # Custom API tool + - type: api + api_config: + name: get_status + method: GET + endpoint: "https://api.example.com/status" + instruction: Check service health + # Docker MCP tools + - type: mcp + ref: docker:github-official + tools: ["list_issues", "create_issue"] + - type: mcp + ref: docker:duckduckgo + # Remote MCP + - type: mcp + remote: + url: "https://internal-api.example.com/mcp" + transport_type: "streamable" + headers: + Authorization: "Bearer ${env.INTERNAL_TOKEN}" +``` + +> [!WARNING] +> **Toolset Order Matters** +> +> If multiple toolsets provide a tool with the same name, the first one wins. Order your toolsets intentionally. diff --git a/_vendor/github.com/docker/docker-agent/docs/configuration/user-settings/index.md b/_vendor/github.com/docker/docker-agent/docs/configuration/user-settings/index.md new file mode 100644 index 000000000000..92a050df6d03 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/configuration/user-settings/index.md @@ -0,0 +1,134 @@ +--- +title: "User Settings" +description: "Full reference for the global settings block in ~/.config/cagent/config.yaml: theme, layout, YOLO, sound, snapshots, permissions, hooks, keybindings, and how they interact with agent config and CLI flags." +keywords: docker agent, ai agents, configuration, yaml, user settings, user config +linkTitle: "User Settings" +weight: 110 +canonical: https://docs.docker.com/ai/docker-agent/configuration/user-settings/ +--- + +_Full reference for the global settings block in your user config file._ + +## Where Settings Live + +Docker Agent reads a single user-level config file, independent of any agent YAML: + +```text +~/.config/cagent/config.yaml +``` + +The `settings:` block inside it holds preferences that apply to every agent you run — appearance, behavior, notifications, and a few global safety defaults. Everything under `settings:` is optional; an unset field falls back to the documented default. + +```yaml +# ~/.config/cagent/config.yaml +settings: + theme: dracula + lean: false + sound: true +``` + +You rarely need to hand-edit this file. Most fields are managed from the TUI's `/settings` dialog (**Appearance**, **Behavior**, **Notifications** tabs) — press <kbd>Enter</kbd> there to apply and persist a change. A few fields (`permissions`, `hooks`, `keybindings`) have no dialog UI and are only set by editing the file directly. + +> [!NOTE] +> This page documents `settings:`. The user config file also has top-level sections outside `settings:` — `aliases:`, `providers:`, `board:`, `credential_helper:`, `sandbox_allowlist:` — which are not covered here. + +## Settings Reference + +| Setting | Type | Default | Description | +| --- | --- | --- | --- | +| `hide_tool_results` | boolean | `false` | Hide tool call results in the TUI by default. Mirrors the `--hide-tool-results` flag and the <kbd>Ctrl</kbd>+<kbd>O</kbd> toggle. | +| `expand_thinking` | boolean | `false` | Start new sessions with thinking/tool blocks expanded instead of collapsed. | +| `split_diff_view` | boolean | `true` | Render file-edit diffs side-by-side instead of unified. | +| `render_images` | boolean | `true` | Render images in the TUI using the Kitty graphics protocol. Applies to both tool-result images and Markdown images in agent responses. Automatically disabled when the terminal does not support Kitty. | +| `theme` | string | `default` | Theme name, loaded from a built-in theme or `~/.cagent/themes/<name>.yaml`. The special value `auto` follows the terminal's light/dark background. See [Theming](../../features/tui/index.md#theming). | +| `theme_dark` | string | `default` | Theme applied when `theme: auto` and the terminal background is dark. | +| `theme_light` | string | `default-light` | Theme applied when `theme: auto` and the terminal background is light. | +| `YOLO` | boolean | `false` | Auto-approve all tool calls globally, across every agent you run. Mirrors the `--yolo` flag and the `/yolo` command. Legacy alias for `safety: autonomous`; when both are set, `safety` wins. | +| `safety` | string | _unset_ | Default [safety mode](../permissions/index.md#safety-modes) for new sessions: `strict`, `balanced`, `restricted`, or `autonomous` (any other value fails config loading). Wins over the legacy `YOLO` flag. Applied when no explicit `--safety`/`--yolo` flag and no alias safety option was given; wins over the agent YAML's `agents.<name>.safety` / `runtime.safety` defaults. Never changes the mode of a resumed session. | +| `lean` | boolean | `false` | Make the [lean TUI](../../features/tui/index.md#lean-tui) (simplified, minimal-chrome interface) the default for interactive runs instead of the full TUI. | +| `tab_title_max_length` | int | `20` | Maximum display length for tab titles; longer titles are truncated with an ellipsis. | +| `restore_tabs` | boolean | `false` | Restore previously open tabs when launching the TUI. | +| `sound` | boolean | `false` | Play a notification sound on task success or failure. | +| `sound_threshold` | int | `10` | Minimum duration in seconds a task must run before a success sound plays (failures always play). | +| `snapshot` | boolean | `false` | Enable automatic shadow-git snapshots at turn boundaries globally. See [Snapshots](../../features/snapshots/index.md). | +| `cache_stable_prompts` | boolean | `false` | Keep changing trusted context (date, environment info, dynamic prompt files) out of the frozen system prefix and append chronological updates instead, improving prompt-cache hit rates on long sessions. | +| `warn_on_cache_miss` | boolean | `false` | Warn when a model call after the first one in a session reports no cached input tokens (a prompt-cache miss). Managed from the **Notifications** tab of `/settings`. | +| `busy_send_mode` | string | `steer` | What happens to a message sent while the agent is working: `steer` injects it into the ongoing stream; `queue` holds it until the current turn ends. | +| `interrupt_confirmation` | string | `always` | Controls how the <kbd>Esc</kbd> key interrupts a running stream: `always` (default) shows a confirmation dialog; `double-tap` requires pressing <kbd>Esc</kbd> twice within 1 second; `none` interrupts immediately without confirmation. Managed from the **Behavior** tab of `/settings`. | +| `permissions` | object | _unset_ | Global tool-permission rules (`allow` / `ask` / `deny`), merged with agent-level and session-level permissions. See [Permissions](../permissions/index.md#global-permissions). | +| `hooks` | object | _unset_ | Global lifecycle hooks applied to every agent, additive with agent-config and CLI hooks. See [Global (user-level) hooks](../hooks/index.md#global-user-level-hooks). | +| `keybindings` | array | _unset_ | Remap TUI keyboard shortcuts. See [Custom Keybindings](../../features/tui/index.md#custom-keybindings) for the full list of actions and syntax. | +| `layout` | object | _unset_ | Sidebar position and section visibility. See [Layout Settings](#layout-settings) below. | + +## Layout Settings + +`layout` customizes the TUI's sidebar. The zero value (an omitted `layout:` block, or any field left out) is the default: sidebar on the right, every section visible, normal spacing. + +| Field | Type | Default | Description | +| --- | --- | --- | --- | +| `sidebar_position` | string | `right` | `right`, `left`, `top`, or `bottom`. Left/right keep a full vertical sidebar; top/bottom render a compact horizontal band. | +| `section_spacing` | string | `normal` | `compact`, `normal`, or `relaxed` — the number of blank lines between sidebar sections. | +| `hide_session_path` | boolean | `false` | Hide the working-directory (session path) line, including its git branch. | +| `hide_usage` | boolean | `false` | Hide the token-usage section. | +| `hide_agents` | boolean | `false` | Hide the Agents section. | +| `active_agents_only` | boolean | `false` | Show only agents active in the current session in the Agents section (and the top/bottom band), instead of the whole configured team. Ignored while the Agents section is hidden. | +| `hide_tools` | boolean | `false` | Hide the Tools section. | +| `hide_todos` | boolean | `false` | Hide the Todos section. | + +```yaml +settings: + layout: + sidebar_position: left + section_spacing: compact + hide_usage: true +``` + +## Complete Example + +```yaml +# ~/.config/cagent/config.yaml +settings: + theme: auto + theme_dark: dracula + theme_light: default-light + lean: false + expand_thinking: false + split_diff_view: true + render_images: true + hide_tool_results: false + sound: true + sound_threshold: 10 + snapshot: true + cache_stable_prompts: true + warn_on_cache_miss: true + busy_send_mode: queue + interrupt_confirmation: double-tap + restore_tabs: true + tab_title_max_length: 24 + layout: + sidebar_position: right + section_spacing: normal + permissions: + deny: + - "shell:cmd=sudo*" + allow: + - "read_*" + hooks: + session_start: + - type: command + command: "~/.config/cagent/hooks/session-start.sh" + keybindings: + - action: "commands" + keys: ["f2", "ctrl+k"] +``` + +## Precedence Rules + +User settings are a **low-priority** source: they establish defaults, and anything more specific wins. + +- **CLI flags over user settings — except plain boolean flags going from `true` to `false`.** Where a `docker agent run` flag mirrors a setting, passing the flag for a specific run takes precedence over the setting for that run only, and the flag never modifies the saved user config file. This holds cleanly for `--lean` / `lean`, `--theme` / `theme`, and the safety flags `--safety` / `--yolo` (see below), which track whether the flag was explicitly passed on the command line. `--hide-tool-results` / `hide_tool_results` doesn't: it's a plain boolean with no "was this explicitly set" tracking, so passing `--hide-tool-results=false` cannot turn a saved `hide_tool_results: true` setting off for that run — the saved `true` wins and is reapplied on top of the flag. Passing the flag to turn it *on* works as expected regardless of the saved setting. +- **Safety has its own, fully-specified chain.** For a **new** session the first source in this order wins: explicit `--safety` flag > explicit `--yolo` flag > alias `safety`/`yolo` option > `settings.safety`/`settings.YOLO` > the agent YAML's `agents.<name>.safety` > the agent YAML's `runtime.safety` > the built-in default (read-only tools auto-approve, everything else asks). At each scope the `safety` field wins over the legacy `YOLO`/`yolo` boolean. Your settings therefore beat anything an agent author declared in YAML — an agent config loaded from a file, URL, or OCI registry can never override your `settings.safety`, alias option, or CLI flag. An explicit `--yolo=false` suppresses a saved `YOLO: true` / alias `yolo` for that run (other settings and YAML defaults still apply). **Resumed sessions keep their stored mode**: settings and alias defaults never touch them; only an explicit `--safety` or `--yolo` flag overrides a resume. See [Safety Modes](../permissions/index.md#safety-modes). +- **Aliases sit between CLI flags and user settings.** An [alias](../../features/cli/index.md#docker-agent-alias) (`docker agent alias add ...`) can bundle its own `yolo`, `safety`, `model`, `hide_tool_results`, and `sandbox` defaults; those apply when the corresponding flag was not explicitly passed, the same way user settings do, but are resolved after user settings so an alias's own choices take priority over your global defaults. +- **Permissions are merged, not overridden.** Global `settings.permissions` and an agent's own `permissions:` are combined into a single set of `deny` → `allow` → `ask` patterns before evaluation — a global deny always blocks, regardless of what the agent config allows. See [Merging Behavior](../permissions/index.md#merging-behavior). +- **Hooks are additive, not overridden.** For a given lifecycle event, hooks from the agent config, `settings.hooks`, `hooks.d/` drop-ins, and `--hook-*` CLI flags **all** run, in that order. Global hooks cannot be suppressed by an individual agent. +- **Everything else is a plain default.** Fields with no CLI or agent-config equivalent (`sound`, `sound_threshold`, `restore_tabs`, `tab_title_max_length`, `split_diff_view`, `render_images`, `cache_stable_prompts`, `warn_on_cache_miss`, `busy_send_mode`, `keybindings`, `layout`) only ever come from `settings:` (or the `/settings` dialog that writes it) — there is nothing to override them per run. diff --git a/_vendor/github.com/docker/docker-agent/docs/demo.gif b/_vendor/github.com/docker/docker-agent/docs/demo.gif new file mode 100644 index 000000000000..03d4bfc0ec7a Binary files /dev/null and b/_vendor/github.com/docker/docker-agent/docs/demo.gif differ diff --git a/_vendor/github.com/docker/docker-agent/docs/features/_index.md b/_vendor/github.com/docker/docker-agent/docs/features/_index.md new file mode 100644 index 000000000000..70959847b98c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/_index.md @@ -0,0 +1,5 @@ +--- +title: "Features" +description: "Interfaces and features: TUI, CLI, API server, protocols, and more." +weight: 50 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/features/a2a/index.md b/_vendor/github.com/docker/docker-agent/docs/features/a2a/index.md new file mode 100644 index 000000000000..a09f5b006536 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/a2a/index.md @@ -0,0 +1,106 @@ +--- +title: "A2A Protocol" +description: "Expose Docker Agent agents via Google's Agent-to-Agent (A2A) protocol for interoperability with other agent frameworks." +keywords: docker agent, ai agents, features, a2a protocol +weight: 60 +canonical: https://docs.docker.com/ai/docker-agent/features/a2a/ +aliases: + - /ai/docker-agent/integrations/a2a/ +--- + +_Expose Docker Agent agents via Google's Agent-to-Agent (A2A) protocol for interoperability with other agent frameworks._ + +## Overview + +The `docker agent serve a2a` command starts an A2A server that exposes your agents using the [A2A protocol](https://a2a-protocol.org/latest/). This enables communication between Docker Agent and other agent frameworks that support A2A. + +> [!WARNING] +> **Early support** +> +> A2A support is functional but still evolving. Tool calls, artifacts, and memory features have limited A2A integration. See limitations below. + +## Usage + +```bash +# Start A2A server for an agent +$ docker agent serve a2a ./agent.yaml + +# Specify a custom address +$ docker agent serve a2a ./agent.yaml --listen 127.0.0.1:9000 + +# Use an agent from an OCI registry +$ docker agent serve a2a myorg/agent:tag +``` + +## Flags + +| Flag | Default | Description | +| --------------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------- | +| `-l, --listen <addr>` | `127.0.0.1:8082` | Address to listen on. | +| `-a, --agent <name>` | (first agent) | Name of the agent to expose when the config contains multiple agents. Defaults to the team's first agent. | +| `-s, --session-db <path>` | `<data-dir>/session.db` | Path to the SQLite session database. | +| `--working-dir <path>` | current dir | Working directory the agent runs in. | +| `--env-from-file <file>` | (none) | Load additional environment variables from a `.env` file (repeatable). | +| `--models-gateway <url>` | (none) | Route all provider traffic through a models gateway URL. | +| `--code-mode-tools` | `false` | Expose tools as a single "code" toolset that accepts a JavaScript snippet to run. | +| `--hook-pre-tool-use <cmd>` | (none) | Add a pre-tool-use hook (repeatable). See [Hooks](../../configuration/hooks/index.md). | +| `--hook-post-tool-use <cmd>` | (none) | Add a post-tool-use hook (repeatable). | +| `--hook-session-start <cmd>` | (none) | Add a session-start hook (repeatable). | +| `--hook-session-end <cmd>` | (none) | Add a session-end hook (repeatable). | +| `--hook-on-user-input <cmd>` | (none) | Add an on-user-input hook (repeatable). | +| `--hook-stop <cmd>` | (none) | Add a stop hook, fired when the model finishes responding (repeatable). | +| `--auth-token <token>` | (none) | Bearer token required for agent-card and invocation requests. | +| `--cors-origin <origins>` | (none) | Allowed browser origins, comma-separated; empty disables CORS. | +| `--insecure-no-auth` | `false` | Allow an unauthenticated non-loopback listener (unsafe). | +| `--safety <policy>` | `restricted` | Tool safety policy; `autonomous` is permitted only through this explicit CLI flag. | + +## Authentication and network exposure + +Loopback listeners may run without authentication. Non-loopback listeners require +`--auth-token` unless `--insecure-no-auth` explicitly acknowledges the exposure. +Clients must send `Authorization: Bearer <token>` for both agent-card discovery +and JSON-RPC invocation. Configure browser access with `--cors-origin`; it accepts +comma-separated literal origins or `~`-prefixed regular expressions and permits +credentials only for matching origins. + +```bash +$ docker agent serve a2a ./agent.yaml --auth-token "$A2A_TOKEN" \ + --cors-origin http://localhost:3000 +``` + +## Tool safety and migration + +A2A sessions default to the `restricted` tool safety policy. Precedence is the +`--safety` flag, then agent YAML, then runtime YAML. YAML may select `strict`, +`balanced`, or `restricted`; `safety: autonomous` stops startup and directs the +operator to `--safety autonomous`. That CLI flag is the only deliberate opt-in +to autonomous tool execution. + +Existing deployments should choose an explicit policy before upgrading. Migration +027 labels pre-existing sessions as `run`, so they cannot be resumed through +`/invoke`; clients must start new A2A contexts. An A2A context ID that collides +with another session is rejected without changing that session. + +Downgrading to a binary that predates migration 027 fails because the session +database has a newer schema (`ErrNewerDatabase`). Restore an older database, or +use a binary that includes the migration. Revert changes without removing the +migration catalogue entry. + +## Features + +- **Auto port selection** — Picks an available port if not specified +- **Agent card** — Provides standard A2A agent metadata +- **Full Docker Agent features** — Supports all tools, models, and gateway features +- **Multiple sources** — Load agents from files or OCI registries + +> [!TIP] +> **See also** +> +> For exposing agents via MCP instead, see [MCP Mode](../mcp-mode/index.md). For stdio-based integration, see [ACP](../acp/index.md). For the HTTP API, see [API Server](../api-server/index.md). + +## Current Limitations + +- Tool calls are handled internally, not exposed as separate A2A events +- A2A artifact support not yet integrated +- A2A memory features not yet integrated +- Multi-agent (sub-agent) scenarios need further work diff --git a/_vendor/github.com/docker/docker-agent/docs/features/acp/index.md b/_vendor/github.com/docker/docker-agent/docs/features/acp/index.md new file mode 100644 index 000000000000..52b6dff515ef --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/acp/index.md @@ -0,0 +1,117 @@ +--- +title: "ACP (Agent Client Protocol)" +description: "Expose Docker Agent agents via the Agent Client Protocol for integration with ACP-compatible hosts like VS Code, IDEs, and other developer tools." +keywords: docker agent, ai agents, features, acp (agent client protocol) +linkTitle: "ACP" +weight: 70 +canonical: https://docs.docker.com/ai/docker-agent/features/acp/ +aliases: + - /ai/docker-agent/integrations/acp/ +--- + +_Expose Docker Agent agents via the Agent Client Protocol for integration with ACP-compatible hosts like VS Code, IDEs, and other developer tools._ + +## Overview + +The `docker agent serve acp` command starts an ACP server that communicates over **stdio** (standard input/output). This makes it ideal for integration with editors, IDEs, and other tools that spawn agent processes — the host sends JSON-RPC messages to Docker Agent's stdin and reads responses from stdout. + +ACP is built on the [ACP Go SDK](https://github.com/coder/acp-go-sdk) and provides a standardized way for client applications to interact with AI agents. + +> [!NOTE] +> **ACP vs A2A vs MCP** +> +> **ACP** connects an agent to a *host application* (IDE, CLI tool) via stdio. **A2A** connects *agents to other agents* over HTTP. **MCP** exposes agents as *tools* for other MCP clients. Choose based on your integration target. + +## Usage + +```bash +# Start ACP server on stdio +$ docker agent serve acp ./agent.yaml + +# With a multi-agent team config +$ docker agent serve acp ./team.yaml + +# From an OCI registry +$ docker agent serve acp myorg/agent:tag + +# With a custom session database +$ docker agent serve acp ./agent.yaml --session-db ./my-sessions.db +``` + +## How It Works + +1. The host application spawns `docker agent serve acp agent.yaml` as a child process +2. Communication happens over **stdin/stdout** using the ACP protocol +3. The host sends user messages, Docker Agent processes them through the agent +4. Agent responses, tool calls, and events stream back to the host +5. Sessions are persisted in a SQLite database for continuity + +```bash +# Conceptual flow: +Host Application + └── spawns: docker agent serve acp agent.yaml + ├── stdin ← JSON-RPC requests from host + └── stdout → JSON-RPC responses to host +``` + +## Features + +- **Stdio transport** — No network ports needed; ideal for subprocess integration +- **Session persistence** — SQLite-backed sessions survive process restarts +- **Full agent support** — All Docker Agent features work: tools, multi-agent, model fallbacks +- **Multi-agent configs** — Team configurations with sub-agents work transparently +- **Filesystem operations** — Agents can read/write files relative to the host's working directory + +## CLI Flags + +```bash +docker agent serve acp <agent-file>|<registry-ref> [flags] +``` + +| Flag | Default | Description | +| --------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `-s, --session-db <path>` | `<data-dir>/session.db` | Path to the SQLite session database. | +| `--working-dir <path>` | current dir | Working directory the agent runs in. | +| `--env-from-file <file>` | (none) | Load additional environment variables from a `.env` file (repeatable). | +| `--models-gateway <url>` | (none) | Route all provider traffic through a models gateway URL. | +| `--code-mode-tools` | `false` | Expose tools as a single "code" toolset that accepts a JavaScript snippet to run. | +| `--hook-pre-tool-use <cmd>` | (none) | Add a pre-tool-use hook (repeatable). See [Hooks](../../configuration/hooks/index.md). | +| `--hook-post-tool-use <cmd>` | (none) | Add a post-tool-use hook (repeatable). | +| `--hook-session-start <cmd>` | (none) | Add a session-start hook (repeatable). | +| `--hook-session-end <cmd>` | (none) | Add a session-end hook (repeatable). | +| `--hook-on-user-input <cmd>` | (none) | Add an on-user-input hook (repeatable). | +| `--hook-stop <cmd>` | (none) | Add a stop hook, fired when the model finishes responding (repeatable). | + +## Integration Example + +A host application would spawn Docker Agent as a subprocess and communicate via the ACP protocol: + +```javascript +// Pseudocode for an IDE extension +const child = spawn("docker", ["agent", "serve", "acp", "./agent.yaml"]); + +// Send a message to the agent +child.stdin.write( + JSON.stringify({ + jsonrpc: "2.0", + method: "agent/run", + params: { message: "Explain this code" }, + }), +); + +// Read responses +child.stdout.on("data", (data) => { + const response = JSON.parse(data); + // Handle agent response, tool calls, etc. +}); +``` + +> [!TIP] +> **When to use ACP** +> +> Use ACP when building **IDE integrations**, **editor plugins**, or any tool that wants to embed a Docker Agent agent as a subprocess. For HTTP-based integrations, use the [API Server](../api-server/index.md) instead. + +> [!NOTE] +> **See also** +> +> For HTTP-based agent access, see the [API Server](../api-server/index.md). For agent-to-agent communication, see [A2A Protocol](../a2a/index.md). For exposing agents as MCP tools, see [MCP Mode](../mcp-mode/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/features/api-server/index.md b/_vendor/github.com/docker/docker-agent/docs/features/api-server/index.md new file mode 100644 index 000000000000..2c1bc999702c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/api-server/index.md @@ -0,0 +1,394 @@ +--- +title: "API Server" +description: "Expose your agents via an HTTP API for programmatic access, web frontends, and integrations." +keywords: docker agent, ai agents, features, api server +weight: 80 +canonical: https://docs.docker.com/ai/docker-agent/features/api-server/ +--- + +_Expose your agents via an HTTP API for programmatic access, web frontends, and integrations._ + +## Overview + +The `docker agent serve api` command starts an HTTP server that exposes your agents through a REST-style API with Server-Sent Events (SSE) streaming. Use it to build web UIs, integrate with CI/CD pipelines, or connect agents to other services. + +```bash +# Start the API server +$ docker agent serve api agent.yaml + +# Custom listen address +$ docker agent serve api agent.yaml --listen 0.0.0.0:8080 + +# With session persistence +$ docker agent serve api agent.yaml --session-db ./sessions.db + +# Auto-refresh from OCI registry every 10 minutes +$ docker agent serve api myorg/coder --pull-interval 10 +``` + +> [!TIP] +> **When to use API server vs. chat server** +> +> Use the **API server** when you want full control over sessions, agent execution, tool-call confirmations, and streamed runtime events — this is Docker Agent's native protocol. Use the [Chat Server](../chat-server/index.md) when you want to plug Docker Agent into existing OpenAI-compatible tooling (chat UIs, IDE integrations, OpenAI SDK clients) instead. + +## Endpoints + +All endpoints are under the `/api` prefix. + +### Agents + +| Method | Path | Description | +| ------ | ----------------- | --------------------------------- | +| `GET` | `/api/agents` | List all available agents | +| `GET` | `/api/agents/:id` | Get an agent's full configuration | + +Each agent entry in the `GET /api/agents` response contains: + +| Field | Type | Description | +| ------------ | --------------- | --------------------------------------------------------------------------------------------- | +| `name` | string | Agent identifier (config filename without `.yaml`). | +| `description`| string | The root agent's `description` field. | +| `multi` | boolean | `true` when the config defines more than one agent. | +| `commands` | array of string | Sorted list of named command keys defined on the root agent. Omitted when no commands exist. | + +### Sessions + +| Method | Path | Description | +| -------- | ----------------------------------- | ------------------------------------------------------- | +| `GET` | `/api/sessions` | List all sessions | +| `POST` | `/api/sessions` | Create a new session. Accepts an optional `title` field — when set, it is stored and LLM title generation is skipped. | +| `GET` | `/api/sessions/:id` | Get a session by ID (messages, tokens, permissions) | +| `GET` | `/api/sessions/:id/status` | Lightweight runtime state (streaming, title, agent, tokens). Requires an attached runtime. | +| `GET` | `/api/sessions/:id/snapshot` | Full state in one call (stored fields + runtime state + `last_event_seq`) for gapless resync — see [Reconnecting without gaps](#reconnecting-without-gaps). | +| `GET` | `/api/sessions/:id/events` | Live session event stream (SSE) with sequence numbers and replay. Available for a run attached via [`--listen`](#listen), or once a session has raised at least one out-of-band event (e.g. a background job's elicitation, answered via `POST .../elicitation`), which creates a session-scoped event log on demand carrying such out-of-band events — see [Session event stream](#session-event-stream-and-reconnection) for what each kind of log contains. | +| `DELETE` | `/api/sessions/:id` | Delete a session | +| `PATCH` | `/api/sessions/:id/title` | Update session title | +| `PATCH` | `/api/sessions/:id/permissions` | Update session permissions | +| `POST` | `/api/sessions/:id/fork` | Fork a session at a user message — creates a new session with messages `[0, message_index)` of the parent (see [Session Forking](#session-forking)) | +| `POST` | `/api/sessions/:id/messages` | Append a message directly to a session's history (bypasses the model). Returns `409 Conflict` while the session has an active run (see [Agent Execution](#agent-execution)). | +| `PATCH` | `/api/sessions/:id/messages/:msg_id` | Update an existing message by ID. Returns `409 Conflict` while the session has an active run. | +| `POST` | `/api/sessions/:id/resume` | Resume a paused session (after tool confirmation) | +| `POST` | `/api/sessions/:id/tools/toggle` | Toggle auto-approve (YOLO) mode | +| `POST` | `/api/sessions/:id/elicitation` | Respond to an MCP tool elicitation request. Pass the `elicitation_id` from the `elicitation_request` event to target a specific concurrent request; omitted, it resolves the sole pending one. | +| `POST` | `/api/sessions/:id/steer` | Inject messages into a running turn (pre-empts current) | +| `POST` | `/api/sessions/:id/followup` | Enqueue messages to run after the current turn finishes (supports an `Idempotency-Key` — see [Idempotent follow-ups](#idempotent-follow-ups)). | +| `GET` | `/api/sessions/:id/models` | List available models for the session's current agent | + +### Agent Execution + +| Method | Path | Description | +| ------ | ------------------------------------------ | ------------------------------------------------------------------------------------ | +| `POST` | `/api/sessions/:id/agent/:agent` | Run the root agent for a session (SSE stream) | +| `POST` | `/api/sessions/:id/agent/:agent/:name` | Run a specific named agent (SSE stream) | +| `GET` | `/api/agents/:id/:agent_name/tools/count` | Count tools currently available to `:agent_name` (accounts for deferred toolsets). | + +**Path parameters:** + +- **`:agent`** — The agent identifier, which is the **config filename without the `.yaml` extension**. This must match the filename passed to `docker agent serve api`. For example, if you start the server with `docker agent serve api my-assistant.yaml`, the agent identifier is `my-assistant`. When serving a directory of YAML files, each file becomes a separate agent identified by its filename without the extension. +- **`:name`** _(optional)_ — The name of a specific sub-agent defined in a multi-agent configuration. If omitted, the request targets the `root` agent. For example, in a config that defines agents named `root`, `coder`, and `reviewer`, use `/api/sessions/:id/agent/my-config/coder` to run the `coder` sub-agent directly. + +**Examples:** + +```bash +# Single-agent config: my-assistant.yaml +# Start: docker agent serve api my-assistant.yaml +# Run the root agent: +curl -N -X POST http://localhost:8080/api/sessions/$SID/agent/my-assistant \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role": "user", "content": "Hello!"}]}' + +# Multi-agent config: team.yaml (defines agents: root, coder, reviewer) +# Start: docker agent serve api team.yaml +# Run the root agent: +curl -N -X POST http://localhost:8080/api/sessions/$SID/agent/team \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role": "user", "content": "Review this PR"}]}' + +# Run a specific sub-agent (reviewer): +curl -N -X POST http://localhost:8080/api/sessions/$SID/agent/team/reviewer \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role": "user", "content": "Review this PR"}]}' +``` + +### Health + +| Method | Path | Description | +| ------ | ----------- | ----------------------------------------- | +| `GET` | `/api/ping` | Health check — returns `{"status": "ok"}` | + +### OAuth + +| Method | Path | Description | +| ------ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `POST` | `/api/mcp-oauth/callback` | Deliver an OAuth deeplink callback to a pending unmanaged OAuth flow. Success path: `?state=<state>&code=<code>`; authorization-server error path: `?state=<state>&error=<error>&error_description=<desc>`. Returns 400 if `state` is missing or neither `code` nor `error` is provided; 404 if no flow is awaiting that `state`. See [Remote MCP OAuth](../remote-mcp/index.md) for details. | + +## Streaming Responses + +The agent execution endpoints (`POST /api/sessions/:id/agent/:agent`) return **Server-Sent Events (SSE)**. The request body is a JSON object with a `messages` array and an optional `model` field. Setting `model` applies a persistent per-agent override on the session before the turn starts (subsequent turns reuse it). An empty or omitted `model` leaves the existing override untouched. (Each event is a JSON object representing a runtime event — remember that `:agent` is the config filename without the `.yaml` extension.): + +```bash +# Send a message and stream the response +# (assuming the server was started with: docker agent serve api my-agent.yaml) +$ curl -N -X POST http://localhost:8080/api/sessions/$SID/agent/my-agent \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role": "user", "content": "Hello!"}]}' + +# Same call, but switch the agent's model for this turn (and persist it): +$ curl -N -X POST http://localhost:8080/api/sessions/$SID/agent/my-agent \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role":"user","content":"Hello!"}],"model":"openai/gpt-4o"}' + +# Response (SSE stream): +data: {"type":"stream_started","session_id":"...","agent":"root"} +data: {"type":"agent_choice","content":"Hello! How","agent":"root"} +data: {"type":"agent_choice","content":" can I help","agent":"root"} +data: {"type":"agent_choice","content":" you today?","agent":"root"} +data: {"type":"stream_stopped","session_id":"...","agent":"root"} +``` + +Event types include: + +- `stream_started` / `stream_stopped` — Agent execution lifecycle +- `agent_choice` — Streamed text content (partial responses) +- `tool_call` — Agent requesting tool execution +- `tool_call_confirmation` — Tool call waiting for user approval +- `tool_call_response` — Tool execution result +- `plan_changed` — A shared plan was created, updated, or deleted through the plan toolset. The payload carries the plan's `scope`, `name`, `action`, and `version` — never its content. Shared plans are deliberately process-global: every active stream served by the same process subscribes to the same shared plan notifier and receives the event regardless of which session performed the mutation, and the payload does not identify the mutating session (read the plan's `author` metadata for collaborative attribution). +- `error` — Error during execution + +## Typical Workflow + +1. **List agents** — `GET /api/agents` to discover available agents +2. **Create session** — `POST /api/sessions` to start a conversation +3. **Send message** — `POST /api/sessions/:id/agent/:agent` with user messages +4. **Stream response** — Read SSE events as the agent processes +5. **Handle confirmations** — If a tool call needs approval, `POST /api/sessions/:id/resume` +6. **Continue** — Send follow-up messages to the same session + +```bash +# 1. List available agents +$ curl http://localhost:8080/api/agents +[{"name":"my-agent","multi":false,"description":"A helpful assistant","commands":["deploy","review"]}] + +# 2. Create a session +$ curl -X POST http://localhost:8080/api/sessions \ + -H "Content-Type: application/json" -d '{}' +{"id":"abc-123","title":"","created_at":"..."} + +# Create a session with a pre-supplied title (skips LLM title generation) +$ curl -X POST http://localhost:8080/api/sessions \ + -H "Content-Type: application/json" -d '{"title":"deploy check"}' +{"id":"def-456","title":"deploy check","created_at":"..."} +# title preserved; LLM title generation skipped + +# 3. Run the agent with a message +$ curl -N -X POST http://localhost:8080/api/sessions/abc-123/agent/my-agent \ + -H "Content-Type: application/json" \ + -d '{"messages":[{"role":"user","content":"What files are in the current directory?"}]}' +``` + +## CLI Flags + +```bash +docker agent serve api <agent-file>|<agents-dir> [flags] +``` + +| Flag | Default | Description | +| ------------------ | ---------------- | ------------------------------------------------ | +| `-l, --listen` | `127.0.0.1:8080` | Address to listen on | +| `--auth-token` | (none) | Bearer token required for all API requests. Leave empty to disable authentication (safe when listening on loopback interfaces only). Recommended when `--listen` binds to a network-reachable interface. | +| `--max-request-size <bytes>` | `1048576` (1 MiB) | Maximum request body size in bytes. Requests whose body exceeds this limit are rejected with HTTP 413 (Request Entity Too Large) — see [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large) if you hit this. | +| `--session-workingdir-root` | (none — unrestricted) | Confine the `working_dir` accepted by `POST /api/sessions` to this directory: after resolving symlinks, the requested directory must be the root or one of its descendants. By default any clean host directory is accepted — the intended behaviour for local single-user daemons that open arbitrary workspaces — but raw values containing `..` are always rejected. Set a root whenever the API serves callers that must not reach arbitrary host paths (multi-user or network-exposed deployments). | +| `-s, --session-db` | `session.db` | Path to the SQLite session database | +| `--pull-interval` | `0` (disabled) | Auto-pull OCI reference every N minutes | +| `--fake` | (none) | Replay AI responses from cassette file (testing) | +| `--record` | (none) | Record AI API interactions to cassette file. Routes through `--models-gateway` when one is configured. | +| `--mcp-oauth-redirect-uri` | (none) | Public HTTPS URL advertised as the OAuth `redirect_uri` for unmanaged MCP OAuth flows. When set, Docker Agent drives PKCE and code exchange in-process and sends the full authorize URL to the client via elicitation. See [Remote MCP](../remote-mcp/index.md) for details. | + +> [!NOTE] +> **What `--max-request-size` does and doesn't cover** +> +> This is a finite, process-wide cap on one serialized inbound HTTP request body — it isn't a model context-window limit, and raising it doesn't increase what a provider/model accepts or how large a local attachment/prompt file can be. A larger cap also means the server buffers more memory per request from an unauthenticated or malicious client, so weigh that against your deployment's exposure. If a reverse proxy or gateway sits in front of this server, it may enforce its own, lower cap regardless of this flag. See [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large) for full diagnosis. + +> [!TIP] +> **Live profiling (advanced)** +> +> For production diagnostics, set the `CAGENT_PPROF_ADDR` environment variable (or the hidden `--pprof-addr` flag) to a TCP address such as `127.0.0.1:6060`. Docker Agent will start a Go pprof HTTP server at `/debug/pprof/`, which you can query with `go tool pprof`. Use a loopback address — a non-loopback binding logs a security warning. This flag is intentionally hidden from `--help`. + +> [!TIP] +> **Multi-agent configs** +> +> You can point `docker agent serve api` at a directory containing multiple agent YAML files. Each becomes a separate agent accessible via `/api/agents`. Combine with `--pull-interval` to auto-refresh agents from an OCI registry. + +## Session Persistence + +Sessions are stored in a SQLite database (default: `session.db` in the current directory). This means: + +- Sessions survive server restarts +- Multiple server instances can share a database +- Use `--session-db` to specify a custom path + +## Tool Call Approval + +By default, tool calls require approval. In the API workflow: + +1. Agent makes a tool call → server emits a `tool_call_confirmation` event +2. Client reviews and sends `POST /api/sessions/:id/resume` with the decision +3. Execution continues based on approval/denial + +Toggle auto-approve with `POST /api/sessions/:id/tools/toggle` for automated workflows. + +## Driving a running TUI with `--listen` {#listen} + +The same session API can be exposed by an **interactive run** so an external +process can drive it — send follow-up prompts, observe progress, read the +title — without scraping the terminal. Start a normal run and add `--listen`: + +```bash +# Expose this run's control plane on a TCP port... +$ docker agent run agent.yaml --listen 127.0.0.1:8080 + +# ...or on a unix socket (no port to allocate; access is gated by file +# permissions). npipe:// (Windows) and fd:// are also accepted. +$ docker agent run agent.yaml --listen unix:///tmp/my-run.sock +``` + +The run keeps its interactive TUI; the control plane runs alongside it. A +follow-up delivered over HTTP is processed exactly as if it had been typed +into the TUI: it starts a turn even when the agent is idle, generates the +session title on the first turn, and streams the resulting events to both the +terminal and every connected API client. + +```bash +# Send a follow-up to the attached run (SID is the --session id): +$ curl -X POST http://127.0.0.1:8080/api/sessions/$SID/followup \ + -H 'Content-Type: application/json' \ + -d '{"messages":[{"content":"Now add tests"}]}' +``` + +> [!NOTE] +> **Discovering a run** +> +> Each run started with `--listen` writes a discovery record to `<data-dir>/runs/<pid>.json` containing its address and session id, so a supervising process can find a live run by session id, pid, or address. + +> [!WARNING] +> **This control plane has a fixed 1 MiB request-body cap and no built-in authentication** +> +> Unlike the standalone `docker agent serve api` process above, an attached run's `--listen` control plane exposes neither `--max-request-size` nor `--auth-token`: every request is capped at a fixed, non-configurable 1 MiB body (returning HTTP 413 above it — see [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large)), and there is no bearer token to require. If you need a configurable cap, built-in bearer auth, or a network-reachable listener, run a standalone `docker agent serve api` deployment instead. Otherwise, keep `--listen` on loopback, a unix socket, or behind an authenticating reverse proxy. + +## Session event stream and reconnection + +`GET /api/sessions/:id/events` is a **Server-Sent Events** stream of the +session's runtime events — `stream_started`, `agent_choice`, `tool_call`, +`session_title`, `token_usage`, `stream_stopped`, and so on. Unlike the +per-request stream returned by the agent-execution endpoint, it is +session-scoped and survives across turns, so a client can watch a session for +its whole lifetime. It is available for a run attached via +[`--listen`](#listen), and — since a session-scoped event log is created on +demand the first time a session raises an out-of-band event, such as an +`elicitation_request` from a background job — for any API-created session +that has produced at least one (see the +[Sessions endpoint table](#sessions) above). The two kinds of log differ in +coverage: a `--listen` run feeds its full runtime event stream into the log, +while an on-demand log for an API-created session carries the session's +out-of-band events — not necessarily all ordinary turn events, which flow on +the per-request SSE stream of the [agent-execution](#agent-execution) +request that runs the turn. + +Each event carries a monotonic **sequence number** in the SSE `id:` field, and +the server buffers recent events. This makes the stream resumable: + +- **Resume after a drop** — reconnect with the standard `Last-Event-ID` header + (sent automatically by browser `EventSource` clients) or a `?since=<seq>` + query parameter. Buffered events newer than that point are replayed before + live tailing resumes, so nothing is missed. +- **Gap signal** — if the resume point has already fallen out of the buffer, the + server sends a single `{"type":"gap"}` event (with no id) before the replay. + The client should re-fetch the snapshot to resync, then continue tailing. +- **End of session** — when the session is ended server-side (for example via + `DELETE /api/sessions/:id`) the server sends a terminal + `{"type":"session_exited"}` event and closes the stream; a client that + receives it should stop. A stream that closes **without** `session_exited` is + a dropped connection — including the run process itself exiting — so reconnect + with the last id; if the run is gone the reconnection simply fails. + +### Reconnecting without gaps + +`GET /api/sessions/:id/snapshot` returns the session's full state in one +response — stored fields (messages, tokens, permissions), live runtime state +(`streaming`, current `agent`), and `last_event_seq`: the sequence number of +the most recent event. Pair it with the event stream for an exact, gapless +resync: + +```bash +# 1. Read the full state and the stream position it corresponds to. +$ SEQ=$(curl -s http://127.0.0.1:8080/api/sessions/$SID/snapshot | jq .last_event_seq) + +# 2. Tail everything that happens after that point (replaying anything that +# occurred between the two calls). +$ curl -N "http://127.0.0.1:8080/api/sessions/$SID/events?since=$SEQ" +``` + +This snapshot-then-tail pattern lets a client (or a client that just +restarted) rebuild a session's state and keep it correct without polling. + +### Waiting for readiness + +`GET /api/sessions/:id/status` reports a session's runtime state. Add +`?wait=<duration>` (e.g. `?wait=10s`) to block until that specific session's +runtime is attached and ready to accept follow-ups, then return its status, or +`503` on timeout. This is session-scoped, unlike `GET /api/ready`, which fires +as soon as any session is ready. + +## Session Forking + +`POST /api/sessions/:id/fork` creates a new session whose history is a copy of the parent up to (but **excluding**) a specified user message. This lets a client "branch" a conversation — e.g. rewind to an earlier question and try a different prompt — without losing the shared history that came before. + +**Request body:** + +```json +{ "user_message_index": 1 } +``` + +`user_message_index` is a **0-based ordinal** that counts only user-role messages in the parent's flat, user-visible message list. The targeted user message is **excluded** from the fork so clients can prefill it into their chat input for the user to edit and resubmit. + +**Example:** + +```bash +# Fork a session before the second user message (ordinal 1) +$ curl -X POST http://localhost:8080/api/sessions/$SID/fork \ + -H 'Content-Type: application/json' \ + -d '{"user_message_index": 1}' +# Returns: api.SessionResponse for the new forked session +# New session title: "<parent title> (fork 1)", "(fork 2)", etc. +``` + +**Validation:** + +- Out-of-range ordinals (negative, or at/past the user-message count) return `400 Bad Request`. +- An ordinal that resolves to a user message inside a sub-session returns `400 Bad Request`. A sub-session is a nested session created when a multi-agent config delegates work to a child agent; its messages are embedded within the parent session's message list and cannot be used as a fork boundary. + +## Idempotent follow-ups + +`POST /api/sessions/:id/followup` accepts an optional `Idempotency-Key` +header, making the request safe to retry after a network timeout. A repeat +with a key already seen for the session is acknowledged without delivering the +follow-up again: + +```bash +$ curl -X POST http://127.0.0.1:8080/api/sessions/$SID/followup \ + -H 'Content-Type: application/json' \ + -H 'Idempotency-Key: 7f3a-...' \ + -d '{"messages":[{"content":"Ship it"}]}' +# => {"status":"queued_streaming","duplicate":false} +# A retry with the same key => {"status":"duplicate","duplicate":true} +``` + +The response `status` is `queued_streaming` (a turn is running or starting), +`queued_idle` (delivered to an idle headless session, runs on the next turn), +or `duplicate`. + +> [!NOTE] +> **See also** +> +> For interactive use, see the [Terminal UI](../tui/index.md). For agent-to-agent communication, see [A2A Protocol](../a2a/index.md) and [ACP](../acp/index.md). For MCP integration, see [MCP Mode](../mcp-mode/index.md). For an OpenAI-compatible chat-completions API, see the [Chat Server](../chat-server/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/features/board/index.md b/_vendor/github.com/docker/docker-agent/docs/features/board/index.md new file mode 100644 index 000000000000..176966a7e59c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/board/index.md @@ -0,0 +1,97 @@ +--- +title: "Kanban Board" +description: "Orchestrate multiple agents from a Kanban TUI: each card runs an agent in a tmux session on an isolated git worktree." +keywords: docker agent, ai agents, features, board, kanban, orchestration +linkTitle: "Kanban Board" +weight: 15 +canonical: https://docs.docker.com/ai/docker-agent/features/board/ +--- + +_Board is a Kanban TUI for orchestrating agents. Each card launches an agent +in a tmux session on an isolated git worktree, and moving a card forward +through the pipeline sends the destination column's prompt to its agent._ + +## Launching the board + +```bash +$ docker agent board +``` + +Requirements: `tmux` and `git` must be installed. + +## How it works + +- **Cards run agents.** Creating a card (`n`) launches `docker agent run` in + a dedicated tmux session, working in a fresh git worktree branched from the + project's upstream default branch. The card's title, running/idle status, + and failures are mirrored live from the agent's control plane. +- **Startup phases.** While an agent is coming up its card moves through three + intermediate statuses before reaching **running**: `starting` (tmux session + created, process booting, no worktree yet) → `loading` (worktree present; + agent loading config, models, and tools) → `attaching` (control-plane socket + bound; board waiting for the first snapshot). +- **Columns are a pipeline.** The default pipeline is + Dev → Review → Push → Done, and it's fully customizable: manage columns + from the board (`c`) or in the config file. Moving a card forward (`]`) + sends the destination column's prompt to the card's agent; moving it back + (`[`) sends nothing. +- **Attach anytime.** Press `enter` (or double-click a card) to attach your + terminal to the agent's session and interact with it directly; `ctrl+q` + detaches and returns to the board. +- **Everything is recoverable.** Quitting the board leaves agents running in + tmux; restarting it reattaches to them. If an agent process dies, the board + relaunches it and resumes the same conversation and worktree. An agent that + keeps crashing at startup turns its card red instead of relaunching + forever: attach to it (`enter`) to read the error output, then move the + card forward to relaunch it, or delete it. + +## Key bindings + +| Key | Action | +| ------------- | --------------------------------------------------- | +| `n` | Create a card (project + prompt) | +| `enter` | Attach to the card's agent (`ctrl+q` detaches) | +| `d` | View the card's worktree diff | +| `o` | Open the card's worktree in `$DOCKER_AGENT_BOARD_EDITOR` (`code`) | +| `s` | Open an interactive shell in the card's worktree | +| `[` / `]` | Move the card back / forward | +| `1`-`9` | Move the card to column N | +| `x` | Delete the card, its session, worktree, and branch | +| `p` | Manage projects (add, edit, reorder, remove) | +| `c` | Manage columns (add, edit, reorder, remove) | +| `e` | Edit the selected column's prompt | +| `←↓↑→` `hjkl` | Navigate | +| mouse | Click selects, double-click attaches, drag moves, wheel scrolls | +| `?` | Help | +| `q` | Quit (agents keep running) | + +## Configuration + +Everything is configured in the global config file +(`~/.config/cagent/config.yaml`) or through the TUI itself (`p` for projects, +`c` for columns, `e` for column prompts): + +```yaml +board: + projects: + - name: my-app + path: /Users/me/src/my-app + agent: coder # any agent ref; defaults to the built-in agent + columns: + - id: dev + name: Dev + emoji: 🔨 + - id: review + name: Review + emoji: 🔍 + prompt: Review the local changes and fix any issues you find. + - id: done + name: Done + emoji: ✅ +``` + +Omitting `columns` keeps the default pipeline. Column `id`s identify a +column across renames (cards remember the column they are in by id); when +omitted, the id is derived from the column's name. When a card enters a +column with a `prompt`, that prompt is delivered to the card's agent as its +next message. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/chat-server/index.md b/_vendor/github.com/docker/docker-agent/docs/features/chat-server/index.md new file mode 100644 index 000000000000..6b9957568064 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/chat-server/index.md @@ -0,0 +1,255 @@ +--- +title: "Chat Server" +description: "Expose your agents through an OpenAI-compatible Chat Completions API so any tool that already speaks OpenAI can drive a Docker Agent agent." +keywords: docker agent, ai agents, features, chat server +weight: 90 +canonical: https://docs.docker.com/ai/docker-agent/features/chat-server/ +--- + +_Expose your agents through an OpenAI-compatible Chat Completions API so any tool that already speaks OpenAI can drive a Docker Agent agent._ + +## Overview + +The `docker agent serve chat` command starts an HTTP server that exposes one or +more agents through an **OpenAI-compatible Chat Completions API** at +`/v1/chat/completions` and `/v1/models`. Any client that already speaks the +OpenAI protocol — for example +[Open WebUI](https://github.com/open-webui/open-webui), `curl`, the OpenAI +Python SDK, or LangChain — can drive a Docker Agent agent without any custom +integration. + +```bash +# Single agent — exposed as the model `root` +$ docker agent serve chat agent.yaml + +# Multi-agent config — every agent in the team becomes a model +$ docker agent serve chat ./team.yaml + +# Pick a specific agent from a multi-agent config +$ docker agent serve chat ./team.yaml --agent reviewer + +# Run an agent straight from the registry +$ docker agent serve chat myorg/agent:tag --listen 127.0.0.1:9090 + +# Require a Bearer token, sourced from an env var +$ docker agent serve chat agent.yaml --api-key-env CHAT_BEARER_TOKEN +``` + +> [!TIP] +> **When to use chat server vs. API server** +> +> Use the **chat server** when you want to plug Docker Agent into existing OpenAI-compatible tooling (chat UIs, IDE integrations, OpenAI SDK clients). Use the [API server](../api-server/index.md) when you want full control over sessions, agent execution, tool-call confirmations, and streamed runtime events. + +## Endpoints + +The OpenAI-compatible endpoints live under the `/v1` prefix to match the +OpenAI API surface. The OpenAPI specification is served at the top level so it +can be discovered without authentication. + +| Method | Path | Description | +| ------ | ---------------------- | ---------------------------------------------------------------------- | +| `GET` | `/v1/models` | List the agents that this server exposes as models | +| `POST` | `/v1/chat/completions` | Send messages and receive a completion (regular or streaming) | +| `GET` | `/openapi.json` | OpenAPI specification for the chat server | + +The model identifier in `POST /v1/chat/completions` is the **agent name**. +For a single-agent config that's typically `root`; for a multi-agent config, +each named agent becomes its own selectable model. + +## Quick Start + +```bash +# 1. Start the server +$ docker agent serve chat agent.yaml +Listening on 127.0.0.1:8083 +OpenAI-compatible chat completions endpoint: http://127.0.0.1:8083/v1/chat/completions + +# 2. List exposed agents (models) +$ curl http://127.0.0.1:8083/v1/models +{"object":"list","data":[{"id":"root","object":"model","owned_by":"docker-agent"}]} + +# 3. Send a chat request +$ curl http://127.0.0.1:8083/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "root", + "messages": [{"role": "user", "content": "Hello!"}] + }' +``` + +### Streaming + +Set `"stream": true` in the request body to receive a Server-Sent Events +(SSE) stream of OpenAI-format `chat.completion.chunk` deltas: + +```bash +$ curl -N http://127.0.0.1:8083/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{ + "model": "root", + "stream": true, + "messages": [{"role": "user", "content": "Stream a poem"}] + }' +``` + +### Drive it from the OpenAI Python SDK + +Because the wire format is OpenAI-compatible, point any OpenAI client at the +chat server's `base_url` and use the agent name as the model: + +```python +from openai import OpenAI + +client = OpenAI( + base_url="http://127.0.0.1:8083/v1", + api_key="not-needed-when-no-api-key-flag", # required by the SDK, ignored if no auth +) + +resp = client.chat.completions.create( + model="root", + messages=[{"role": "user", "content": "Hello!"}], +) +print(resp.choices[0].message.content) +``` + +## Server-side Conversation Caching + +By default the server is **stateless**: every request must contain the full +message history, exactly like OpenAI's API. Enable server-side caching by +setting `--conversations-max` to a positive value, then send a stable +`X-Conversation-Id` header on each request: + +```bash +$ docker agent serve chat agent.yaml --conversations-max 100 --conversation-ttl 30m +``` + +```bash +$ curl http://127.0.0.1:8083/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -H 'X-Conversation-Id: my-thread-1' \ + -d '{ + "model": "root", + "messages": [{"role": "user", "content": "Remember my name is Alice"}] + }' + +$ curl http://127.0.0.1:8083/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -H 'X-Conversation-Id: my-thread-1' \ + -d '{ + "model": "root", + "messages": [{"role": "user", "content": "What is my name?"}] + }' +``` + +Cached conversations are evicted after `--conversation-ttl` of inactivity, or +when the cache hits `--conversations-max` items (oldest entries are evicted +first). + +### Failure-safe caching + +When a request fails — for example because the model returns an error or the `--request-timeout` expires — the conversation cache is **not updated**. The server clones the cached session before processing each request and only commits the updated session when the turn completes successfully. This means: + +- A failed turn leaves the conversation in the same state it was before the request. +- Clients can safely retry with the same `X-Conversation-Id` after a failure. +- Transient errors do not corrupt the conversation history. + +## Authentication + +The chat server defaults to loopback binding. A non-loopback `--listen` address requires `--api-key`, `--api-key-env`, or the explicit `--insecure-no-auth` override. An environment variable selected by `--api-key-env` must be set and non-empty. + +To require a Bearer +token, pass `--api-key` (literal value) or `--api-key-env` (name of an +environment variable that holds the value): + +```bash +$ docker agent serve chat agent.yaml --api-key-env CHAT_BEARER_TOKEN +``` + +Clients must then send an `Authorization: Bearer <token>` header on every +request to `/v1/*`. Both `/v1/models` and `/v1/chat/completions` are +protected once a key is set. + +> [!WARNING] +> **Public exposure** +> +> The default listen address is `127.0.0.1:8083`. Non-loopback binding is rejected unless `--api-key`, `--api-key-env`, or `--insecure-no-auth` is supplied. Use the insecure override only behind a trusted authentication boundary. + +## Tool safety + +The chat server resolves its safety policy in this order: `--safety`, agent configuration, runtime configuration, then `restricted`. Cached conversations retain the more restrictive of their prior policy and the server policy, so a continuation cannot regain permissions after the server policy becomes stricter. + +## CORS + +CORS is **disabled by default**. To allow a browser-based client to call the +server, set `--cors-origin` to the exact origin (scheme + host + port) that +should be allowed: + +```bash +$ docker agent serve chat agent.yaml --cors-origin https://my-ui.example.com +``` + +## CLI Flags + +```bash +docker agent serve chat <agent-file>|<registry-ref> [flags] +``` + +| Flag | Default | Description | +| ----------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------- | +| `-a, --agent <name>` | (all agents) | Name of the agent to expose. If omitted, every agent in the config is exposed as a separate model. | +| `-l, --listen <addr>` | `127.0.0.1:8083` | Address to listen on. | +| `--cors-origin <origin>` | (none) | Allowed CORS origin (e.g. `https://example.com`). Empty disables CORS. | +| `--api-key <token>` | (none) | Required Bearer token clients must present (`Authorization: Bearer <token>`). Empty disables auth. | +| `--api-key-env <name>` | (none) | Read the required API key from this non-empty environment variable. | +| `--insecure-no-auth` | `false` | Permit unauthenticated non-loopback binding. Use only behind a trusted authentication boundary. | +| `--safety <policy>` | `restricted` | Tool safety policy. CLI value overrides agent/runtime configuration. | +| `--max-request-size <bytes>` | `1048576` (1 MiB) | Maximum request body size in bytes. Requests whose body exceeds this limit are rejected with HTTP 413 (Request Entity Too Large) — see [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large) if you hit this. | +| `--request-timeout <dur>` | `5m` | Per-request timeout (covers model + tool calls + streaming). | +| `--conversations-max <n>` | `0` | Cache up to N conversations server-side, keyed by `X-Conversation-Id`. `0` disables — clients must resend history. | +| `--conversation-ttl <dur>` | `30m` | Idle TTL after which a cached conversation is evicted. | +| `--max-idle-runtimes <n>` | `4` | Maximum number of idle runtimes pooled per agent. `0` disables pooling. | + +All [runtime configuration flags](../cli/index.md#runtime-configuration-flags) +(`--working-dir`, `--env-from-file`, `--models-gateway`, `--hook-*`, …) are +also accepted. + +> [!NOTE] +> **What `--max-request-size` does and doesn't cover** +> +> This is a finite, process-wide cap on one serialized inbound HTTP request body — it isn't a model context-window limit, and raising it doesn't increase what a provider/model accepts or how large a local attachment/prompt file can be. A larger cap also means the server buffers more memory per request from an unauthenticated or malicious client, so weigh that against your deployment's exposure. If a reverse proxy or gateway sits in front of this server, it may enforce its own, lower cap regardless of this flag. See [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large) for full diagnosis. + +## Image Inputs + +Messages can include OpenAI-style `image_url` content parts alongside `text`: + +```json +{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}} +``` + +A `data:` URL embeds the image bytes directly in the JSON body, so its base64-encoded size counts toward `--max-request-size` above like any other request content. A remote `http(s)://` URL is passed through to the selected model provider rather than fetched by the chat server itself — whether it works depends on that provider and model: some accept a remote URL directly, others only accept `data:` URLs, and a provider/model without image support drops the part. Don't assume a remote image URL will be fetched or rendered universally; verify against the specific provider/model you've configured. + +## Open WebUI Integration + +Open WebUI can talk to any OpenAI-compatible endpoint. To plug Docker Agent +in: + +1. Start the chat server, optionally with auth: + + ```bash + $ docker agent serve chat agent.yaml \ + --listen 127.0.0.1:8083 \ + --cors-origin http://localhost:3000 \ + --api-key-env OPEN_WEBUI_TOKEN + ``` + +2. In Open WebUI, add an OpenAI-compatible connection: + + - **API Base URL:** `http://127.0.0.1:8083/v1` + - **API Key:** the value of `OPEN_WEBUI_TOKEN` + +3. Each agent in your config appears as a selectable model. + +> [!NOTE] +> **See also** +> +> For the Docker Agent–native HTTP API (sessions, tool-call confirmation, runtime events), see the [API Server](../api-server/index.md). For full CLI flag documentation, see the [CLI Reference](../cli/index.md#docker-agent-serve-chat). diff --git a/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md b/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md new file mode 100644 index 000000000000..41db671d409d --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/cli/index.md @@ -0,0 +1,840 @@ +--- +title: "CLI Reference" +description: "Complete reference for all Docker Agent command-line commands and flags." +keywords: docker agent, ai agents, features, cli reference +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/features/cli/ +aliases: + - /ai/docker-agent/reference/cli/ +--- + +_Complete reference for all Docker Agent command-line commands and flags._ + +> [!TIP] +> **No config needed** +> +> Running `docker agent run` without a config argument uses `docker-agent.yaml`, `docker-agent.yml`, or `docker-agent.hcl` from the current directory when present. Otherwise, it uses a built-in default agent that is perfect for quick experimentation. + +## Commands + +### `docker agent run` + +Launch the interactive TUI with an agent configuration (`.yaml`, `.yml`, or `.hcl`). + +```bash +$ docker agent run [config] [message...] [flags] +``` + +| Flag | Description | +| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `-a, --agent <name>` | Run a specific agent from the config | +| `--yolo` | Auto-approve tool calls (unless explicitly denied). Legacy alias for `--safety autonomous`. | +| `--safety <mode>` | Safety mode for tool approval: `strict` (ask for everything), `balanced` (auto-approve safe calls), `restricted` (auto-approve safe calls, deny the rest — fail-closed for unattended runs), or `autonomous` (approve everything). Wins over `--yolo` when both are given. Without the flag, the mode falls back to alias/user-config defaults, then the agent YAML's `agents.<name>.safety` / `runtime.safety`; a resumed session keeps its stored mode unless `--safety`/`--yolo` is passed explicitly. See [Safety Modes](../../configuration/permissions/index.md#safety-modes). | +| `--model <ref>` | Override model(s). Use `provider/model` for all agents, or `agent=provider/model` for specific agents. Comma-separate multiple overrides. | +| `--session <id>` | Resume a previous session. Supports relative refs (`-1` = newest by creation time, `-2` = second-newest, … — creation order, not last-used). An explicit ID that does not exist yet is created with that ID, so a supervisor can own the session ID upfront and reuse it across runs. | +| `-s, --session-db <path>` | Path to the SQLite session database (default: `<data-dir>/session.db`, so `~/.cagent/session.db` unless `--data-dir` is set) | +| `--session-read-only` | Open the TUI in read-only mode: conversation history is displayed but no new messages can be sent to the LLM. Cannot be used with `--exec`. | +| `--prompt-file <path>` | Include file contents as additional system context (repeatable) | +| `--attach <path>` | Attach an image file to the initial message | +| `--dry-run` | Initialize the agent without executing anything (useful for validating a config) | +| `--remote <addr>` | Use a remote runtime at the given address instead of running the agent locally. Mutually exclusive with `--sandbox`, `--worktree`, `--worktree-pr`, `--worktree-base`, `--session`, `--session-db`, `--record`, and `--fake` — a remote runtime owns its own session storage and execution environment, so these local-only concerns don't apply. | +| `--listen <addr>` | Expose this run's control plane over HTTP so an external process can drive the running TUI (send follow-ups, stream events, read the title). Accepts `host:port` or `unix://`, `npipe://`, `fd://`. Hidden from `docker agent run --help` — like `debug`, it's a stable but advanced/automation-oriented flag rather than a day-to-day one. See the [API Server](../api-server/index.md#listen) guide for the full walkthrough. | +| `--session-workingdir-root <path>` | Confine the `working_dir` of sessions created through the `--listen` control plane to this directory and its descendants (default: no restriction — any clean host directory is accepted, though raw values containing `..` are rejected). Recommended when the control plane is reachable by other users. Hidden from `--help`, like `--listen`. | +| `--lean` | Use a simplified, non-alternate-screen TUI. Unlike the default full-screen TUI, this renders inline in the normal terminal buffer — useful in environments where an alternate screen is unwanted (e.g. inside tmux panes, CI with a tty, or log-friendly pipelines). Like the full TUI, displays an ASCII art banner on startup when the chat is empty. | +| `--app-name <name>` | Override the application name label shown in the TUI (status bar, window title, "/exit" notifications). | +| `--sidebar` | Control sidebar visibility. Set to `--sidebar=false` to hide the sidebar and disable the Ctrl+B toggle (default: `true`). | +| `--disable-commands <list>` | Hide and disable specific slash commands in the TUI. Accepts a comma-separated list of command names (leading slash optional, case-insensitive). E.g. `--disable-commands="/cost,/eval,/model"`. | +| `--theme <name>` | Preselect a TUI theme by name, or `auto` to follow the terminal's light/dark background (overrides the theme from user config; ignored outside the interactive TUI) | +| `--on-event <type>=<cmd>` | Run a shell command when an event of the given type fires (`*=<cmd>` matches any event). Repeatable. | +| `--json` | Output results as newline-delimited JSON (use with `--exec`) | +| `--hide-tool-calls` | Hide tool calls in the output | +| `--hide-tool-results` | Hide tool call results in the output | +| `--sandbox` | Run the agent in sandbox mode using `sbx` (see [Sandbox](../../configuration/sandbox/index.md)) | +| `--template <image>` | Template image for the sandbox (default: `docker/docker-agent-sbx-templates:latest`) | +| `--no-kit` | Disable the [auto-kit](../../configuration/sandbox/index.md#auto-kit): do not stage skills or prompt files into the sandbox | +| `--agent-picker [refs]` | Show a full-screen interactive picker before launching, letting you browse and select an agent. Accepts an optional comma-separated list of agent references to show (defaults to the built-in `default` and `coder` agents plus any agent configs found in `~/.agents`). Arrow keys navigate; `?` toggles the YAML preview panel; `l` (or mouse-click) toggles the **Lean Mode** checkbox to launch in the lean TUI; `b` (or clicking **[ Open Board ]**) opens the Kanban board (`docker agent board`) instead of running an agent; Enter confirms. Not available in `--exec` or non-TTY modes. | +| `-w, --worktree [name]` | Run the agent in a fresh git worktree of the working directory, isolating its changes from your checkout. Optionally name it (`--worktree=my-feature`); otherwise a name is generated. Requires the working directory to be inside a git repository. Every tool (the shell included) runs inside the worktree. Combine with `--working-dir` to branch from another repository, and with `--session` to resume into the same worktree later. Cannot be combined with `--remote` or `--sandbox`. When the session ends, a clean worktree is removed automatically; one with work prompts to keep or remove (never in `--exec`). | +| `--worktree-base <ref>` | Branch the `--worktree` from `<ref>` (a branch, tag, commit, or remote-tracking ref like `origin/main`) instead of the current `HEAD`. A remote-tracking ref is fetched first so the worktree starts from the latest remote state. Requires `--worktree`; cannot be combined with `--worktree-pr`, `--remote`, or `--sandbox`. | +| `--worktree-pr <number\|url>` | Run the agent in a git worktree checked out on an existing GitHub pull request (PR number, `#123`, or PR URL). Continues the PR's branch so commits push back to it. Requires the [GitHub CLI](https://cli.github.com/) (`gh`). Cannot be combined with `--worktree`, `--remote`, or `--sandbox`. | +| `--working-dir <path>` | Set the working directory for the session (applies to tools and relative paths) | +| `--env-from-file <path>` | Load environment variables from file (repeatable) | +| `--flavor <name>` | Enable a config flavor, a YAML patch defined under the config's `flavors` section (repeatable, applied in order). See [Flavors](../../configuration/flavors/index.md). | +| `--code-mode-tools` | Provide a single tool to call other tools via JavaScript (forces code-mode tools globally) | +| `--models-gateway <addr>` | Route model traffic through a gateway. Also reads `DOCKER_AGENT_MODELS_GATEWAY` (legacy `CAGENT_MODELS_GATEWAY`) env var. | +| `--hook-pre-tool-use <cmd>` | Add a pre-tool-use hook command (repeatable). See [Hooks](../../configuration/hooks/index.md). | +| `--hook-post-tool-use <cmd>` | Add a post-tool-use hook command (repeatable) | +| `--hook-session-start <cmd>` | Add a session-start hook command (repeatable) | +| `--hook-session-end <cmd>` | Add a session-end hook command (repeatable) | +| `--hook-on-user-input <cmd>` | Add an on-user-input hook command (repeatable) | +| `--hook-stop <cmd>` | Add a stop hook command, fired when the model finishes responding (repeatable) | +| `--fake <path>` | Replay AI responses from a cassette file (for testing). Mutually exclusive with `--record`. | +| `--fake-stream [ms]` | When replaying with `--fake`, simulate streaming with a delay between chunks (defaults to 15ms when given without a value). | +| `--record [path]` | Record AI API interactions to a cassette file and generate a TUI e2e test from the session (auto-generates filename if no path given). Routes through `--models-gateway` when one is configured. | +| `-d, --debug` | Enable debug logging | +| `--log-file <path>` | Custom debug log location | +| `-o, --otel` | Enable OpenTelemetry observability: traces, metrics, and logs. Requires `OTEL_EXPORTER_OTLP_ENDPOINT` to export to a collector. | + +```bash +# Examples +$ docker agent run agent.yaml +$ docker agent run agent.yaml "Fix the bug in auth.go" +$ docker agent run agent.yaml -a developer --yolo +$ docker agent run agent.yaml --model anthropic/claude-sonnet-4-5 +$ docker agent run agent.yaml --model "dev=openai/gpt-4o,reviewer=anthropic/claude-sonnet-4-5" +$ docker agent run agent.yaml --session -1 # resume last session +$ docker agent run agent.yaml --session -1 --session-read-only # review last session without sending messages +$ docker agent run agent.yaml --prompt-file ./context.md # include file as context + +# Add hooks from the command line +$ docker agent run agent.yaml --hook-session-start "./scripts/setup-env.sh" +$ docker agent run agent.yaml --hook-pre-tool-use "./scripts/validate.sh" --hook-post-tool-use "./scripts/log.sh" + +# Queue multiple messages (processed in sequence) +$ docker agent run agent.yaml "question 1" "question 2" "question 3" + +# Customize TUI display +$ docker agent run agent.yaml --app-name "My Project" +$ docker agent run agent.yaml --sidebar=false +$ docker agent run agent.yaml --disable-commands="/cost,/eval,/model" + +# Browse and pick an agent interactively +$ docker agent run --agent-picker +$ docker agent run --agent-picker=myorg/coder,myorg/researcher +``` + +> [!TIP] +> **Lean, inline TUI** +> +> Pass `--lean` to get a lightweight TUI that renders inline in your terminal (no alternate screen). Like the full TUI, it displays an ASCII art banner on startup when the chat is empty, and supports the same slash commands and streaming output, making it handy inside tmux, scripts, or any context where a full-screen takeover is unwanted. + +> [!TIP] +> **Isolate a run in a git worktree** +> +> When the working directory is inside a git repository, `--worktree` creates a fresh [git worktree](https://git-scm.com/docs/git-worktree) and points the session at it, so the agent's edits land on a separate branch and never touch your checkout. Every tool — the shell included — runs inside the worktree. The worktree is stored under `<data-dir>/worktrees/<name>` on a branch named `worktree-<name>`. + +```bash +# Run in an isolated worktree with a generated name (e.g. "focused_turing") +$ docker agent run agent.yaml --worktree +$ docker agent run agent.yaml -w "Refactor the auth package" + +# Give the worktree (and its branch) an explicit name +$ docker agent run agent.yaml --worktree=auth-refactor + +# Branch the worktree from another ref instead of the current HEAD. +# A remote-tracking ref is fetched first, so the worktree starts from the +# latest remote state. +$ docker agent run agent.yaml --worktree=auth-refactor --worktree-base origin/main + +# Resume a worktree run later: the session remembers its worktree, so you +# don't pass --worktree again (which would fail — the worktree already exists). +$ docker agent run agent.yaml --worktree=auth-refactor # first run, creates it +$ docker agent run agent.yaml --session -1 # resumes into the same worktree + +# Check out an existing GitHub pull request to continue it (requires gh) +$ docker agent run agent.yaml --worktree-pr 123 +$ docker agent run agent.yaml --worktree-pr https://github.com/owner/repo/pull/123 +``` + +With `--worktree-pr`, the PR's head branch is checked out tracking its remote (via the [GitHub CLI](https://cli.github.com/)), so commits made during the run push straight back to the pull request. The worktree is stored under `<data-dir>/worktrees/pr-<number>`. + +When the interactive session ends, the worktree is cleaned up based on its state: + +- **Clean** (no uncommitted changes, untracked files, or new commits): the worktree and its branch are removed automatically. +- **Has work** (uncommitted changes, untracked files, or new commits): you're prompted to keep or remove it. Keeping preserves the directory and branch so you can return later; removing discards the worktree, its branch, and all that work. +- **Non-interactive runs** (`--exec`): the worktree is never cleaned up — it's left in place for inspection. + +A worktree is only ever removed if `--worktree` created it for this run; a pre-existing worktree is never touched. + +A kept worktree can be resumed: pass `--session` (a relative ref like `-1`, or the session id) and the run reattaches to the same worktree directory and branch automatically. Don't re-pass `--worktree` on resume — that would try to create a new worktree and fail because it already exists. + +### `docker agent run --exec` + +Run an agent in non-interactive (headless) mode. No TUI — output goes to stdout. + +```bash +$ docker agent run --exec [config] [message...] [flags] +``` + +```bash +# One-shot task +$ docker agent run --exec agent.yaml "Create a Dockerfile for a Python Flask app" + +# With auto-approve +$ docker agent run --exec agent.yaml --yolo "Set up CI/CD pipeline" + +# Multi-turn conversation +$ docker agent run --exec agent.yaml "question 1" "question 2" "question 3" +``` + +### `docker agent new` + +Interactively generate a new agent configuration file. + +```bash +$ docker agent new [flags] + +# Examples +$ docker agent new +$ docker agent new --model openai/gpt-5 +$ docker agent new --model dmr/ai/gemma3-qat:12B --max-iterations 15 +``` + +### `docker agent getting-started` + +Run a short (about 2 minutes), skippable interactive tour inside the chat UI: sending messages, approving tool calls, the command palette (<kbd>Ctrl</kbd>+<kbd>K</kbd>), slash commands, and how agents are configured. Aliased as `docker agent tour`. Requires an interactive terminal. + +```bash +$ docker agent getting-started +``` + +Replay it anytime with this command, or with the `/getting-started` slash command inside a running TUI session. + +### `docker agent models` + +List models available for use with `--model`. By default only shows models for providers you have credentials for. Aliases: `docker agent models list`, `docker agent models ls`. + +```bash +$ docker agent models [flags] +``` + +| Flag | Default | Description | +| ---------------------- | ------- | ---------------------------------------------------------------------------------- | +| `-p, --provider <id>` | (none) | Filter models by provider name (e.g. `openai`, `anthropic`, `dmr`, `ollama`, …). | +| `--format <fmt>` | `table` | Output format: `table` or `json`. | +| `-a, --all` | `false` | Include models from all providers, not just those you have credentials for. | + +```bash +# Examples +$ docker agent models # only providers you can use +$ docker agent models --all # every provider the catalog knows about +$ docker agent models --provider openai +$ docker agent models --format json | jq +``` + +When a models gateway is configured (`--models-gateway`, `DOCKER_AGENT_MODELS_GATEWAY`, or the user config), the command first queries the gateway's `/v1/models` endpoint. A non-empty response is authoritative for the models routed through the gateway: the listing shows the models the gateway serves (`--provider` filters within it), alongside any custom providers you have configured, which serve their models from their own endpoints rather than through the gateway. If the gateway cannot be queried or serves no usable model (endpoint not implemented, empty list, invalid response, timeout, missing authentication), the command falls back to the providers you have configured directly — provider API keys, provider aliases, and custom providers — plus the model catalog; a failure of one source never prevents the others from being listed. The Docker Desktop token is only sent (and required) when the gateway targets a trusted Docker URL. + +### `docker agent toolsets` + +List the built-in toolset types available for use in an agent configuration. Each type can be referenced under `toolsets:` in an agent YAML file. Use this to discover what's available without leaving the terminal. + +```bash +$ docker agent toolsets [flags] +``` + +| Flag | Default | Description | +| ---------------- | ------- | --------------------------------- | +| `--format <fmt>` | `table` | Output format: `table` or `json`. | + +```bash +# Examples +$ docker agent toolsets # human-readable table +$ docker agent toolsets --format json | jq # machine-readable (type, summary, docs URL) +``` + +### `docker agent setup` + +Set up a model interactively. Four paths: + +- **Built-in cloud provider**: pick a provider Docker Agent already knows (Anthropic, OpenAI, Google, Groq, Hugging Face, ...) and connect it. Credentials vary by provider: most take an API key or token, stored in the Docker Agent env file `~/.config/cagent/.env`, while `chatgpt` signs in with your ChatGPT account in the browser. +- **Local model**: check Docker Model Runner and pull a model. No API key needed. +- **Custom OpenAI-compatible endpoint**: register an endpoint that is not built in (vLLM, LiteLLM, a corporate gateway, ...) with its base URL, API format, and API key variable, saved to your [user configuration](../../providers/custom/index.md#global-providers-user-configuration) so its models work everywhere via `--model <name>/<model>`. +- **Claude Code harness**: use a Claude subscription through the official `claude` CLI. The wizard checks that the CLI is installed and logged in, offers to run `claude auth login --claudeai` (only after you confirm), and writes a ready-to-run `claude-code-agent.yaml`. See [Coding Harnesses](../harnesses/index.md). + +Ends with the exact command to start chatting. Secret values are never printed, and Docker Agent never reads or copies the Claude CLI's credentials. + +The wizard is also offered automatically when an interactive run finds no usable model (decline-able; set `DOCKER_AGENT_NO_SETUP=1` to suppress the offer). + +```bash +$ docker agent setup +``` + +### `docker agent doctor` + +Diagnose the model and credential setup. Reports which model providers have credentials and where each credential comes from (shell environment, env file, Docker Desktop, …), whether Docker Model Runner is reachable and which models are pulled, and which model the `auto` selection would pick. Secret values are never printed. Exits with a non-zero status when an issue would prevent an agent from running, which makes it usable in scripts and CI. + +```bash +$ docker agent doctor [agent-file|registry-ref] [flags] +``` + +With an agent file, also lists the environment variables that file requires (model credentials and tool secrets such as `GITHUB_PERSONAL_ACCESS_TOKEN`), whether each one is set, and from which source. When the file declares a [`claude-code` harness](../harnesses/index.md) agent, the doctor additionally checks that the official `claude` CLI is installed and logged in, reporting its version and safe login metadata (auth method, API provider, subscription type — never your email, organization, or tokens); a missing or logged-out CLI is reported as an issue with the `claude auth login --claudeai` remediation. + +| Flag | Default | Description | +| ------------------------ | ------- | -------------------------------------------------------------- | +| `--json` | `false` | Output the full report in JSON format (for scripting). | +| `--env-from-file <file>` | (none) | Also check variables supplied by an env file. | +| `--models-gateway <url>` | (none) | Diagnose against a models gateway (credentials come from it). | + +```bash +# Examples +$ docker agent doctor # credential, DMR, and auto-selection state +$ docker agent doctor ./agent.yaml # also check that file's requirements +$ docker agent doctor --json | jq .issues +``` + +### `docker agent serve api` + +Start the HTTP API server for programmatic access. The argument can be a single agent file, a registry reference, or a directory — when given a directory, every `.yaml`/`.yml`/`.hcl` file in it is exposed as a separate entry under `/api/agents`. + +```bash +$ docker agent serve api <agent-file>|<agents-dir>|<registry-ref> [flags] +``` + +| Flag | Default | Description | +| -------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------- | +| `-l, --listen <addr>` | `127.0.0.1:8080` | Address to listen on. | +| `--auth-token <token>` | (none) | Bearer token required for all API requests. When set, every request must include `Authorization: Bearer <token>`. Leave empty to disable authentication (safe when listening on loopback interfaces only). | +| `--max-request-size <bytes>` | `1048576` (1 MiB) | Maximum request body size. Requests exceeding this limit are rejected with HTTP 413 — see [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large). | +| `--session-workingdir-root <path>` | (none) | Confine the `working_dir` of sessions created via `POST /api/sessions` to this directory and its descendants (symlinks are resolved before the check). Unrestricted by default — any clean host directory is accepted (raw values containing `..` are rejected), as local single-user daemons rely on. Recommended for multi-user or network-exposed deployments. | +| `-s, --session-db <path>` | `session.db` | Path to the SQLite session database (relative paths resolve against the working directory). | +| `--pull-interval <minutes>`| `0` | Periodically re-pull OCI/URL references and refresh the agent definition. `0` disables auto-pull. | +| `--fake <path>` | (none) | Replay AI responses from a cassette file (for testing). Mutually exclusive with `--record`. | +| `--record [path]` | (none) | Record AI API interactions to a cassette file. Routes through `--models-gateway` when one is configured. | +| `--mcp-oauth-redirect-uri <url>` | (none) | OAuth redirect URI for the unmanaged MCP OAuth flow in server mode. When set, the runtime drives PKCE and code exchange in-process and sends the full authorize URL to the client via elicitation. See [Remote MCP](../remote-mcp/index.md) for details. | + +> **Diagnostics:** Set `CAGENT_PPROF_ADDR=127.0.0.1:6060` (or `--pprof-addr`, a hidden flag) to start a live Go pprof server at `/debug/pprof/`. Use a loopback address; a non-loopback binding logs a security warning. + +All [runtime configuration flags](#runtime-configuration-flags) (`--working-dir`, `--env-from-file`, `--models-gateway`, `--hook-*`, …) are also accepted. + +```bash +# Examples +$ docker agent serve api agent.yaml +$ docker agent serve api agent.yaml --listen :8080 +$ docker agent serve api ./agents/ # directory of agent YAML/HCL configs +$ docker agent serve api ociReference --pull-interval 10 # auto-refresh +``` + +See [API Server](../api-server/index.md) for the full HTTP API reference. + +### `docker agent serve mcp` + +Expose agents as MCP tools for use in Claude Desktop, Claude Code, or other MCP clients. Defaults to stdio transport; use `--http` to start a streaming HTTP server instead. + +```bash +$ docker agent serve mcp <config> [flags] +``` + +| Flag | Default | Description | +| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------- | +| `-a, --agent <name>` | (all agents) | Name of the agent to expose. If omitted, every agent in the config is exposed as a separate tool. | +| `--tool-name <name>` | (agent name) | Override the MCP tool identifier clients call; only valid when exposing a single agent. | +| `--http` | `false` | Use streaming HTTP transport instead of stdio. | +| `--safety <policy>` | `restricted` | HTTP MCP safety policy; no effect on stdio or `--attach`. | +| `--auth-token <token>` | (none) | Required Bearer token for HTTP MCP requests. | +| `--insecure-no-auth` | `false` | Permit unauthenticated non-loopback HTTP MCP binding. | +| `-l, --listen <addr>` | `127.0.0.1:8081` | Address to listen on (only used with `--http`). | +| `--mcp-keepalive <dur>`| `0` (disabled) | Interval between MCP keep-alive pings (e.g. `30s`). | +| `--attach [target]` | (none) | Attach to a running TUI run by pid, address, or session id; given without a value, selects the most recent run. | + +All [runtime configuration flags](#runtime-configuration-flags) are also accepted. + +```bash +# Examples +$ docker agent serve mcp agent.yaml # stdio transport +$ docker agent serve mcp agent.yaml --http --listen 127.0.0.1:9090 # streaming HTTP +$ docker agent serve mcp agent.yaml --working-dir /path/to/project +$ docker agent serve mcp myorg/coder +``` + +See [MCP Mode](../mcp-mode/index.md) for detailed setup. + +### `docker agent serve a2a` + +Start an A2A (Agent-to-Agent) protocol server. + +```bash +$ docker agent serve a2a <config> [flags] +``` + +| Flag | Default | Description | +| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------ | +| `-a, --agent <name>` | (team default) | Name of the agent to run. Defaults to the team's first agent if not specified. | +| `-l, --listen <addr>` | `127.0.0.1:8082` | Address to listen on. | +| `-s, --session-db <path>` | `<data-dir>/session.db` | Path to the SQLite session database. | + +All [runtime configuration flags](#runtime-configuration-flags) are also accepted. + +```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 +``` + +### `docker agent serve acp` + +Start an ACP (Agent Client Protocol) server over stdio. This allows external clients to interact with your agents using the ACP protocol. + +```bash +$ docker agent serve acp <config> [flags] +``` + +| Flag | Default | Description | +| ------------------------- | --------------------------- | ------------------------------------------------- | +| `-s, --session-db <path>` | `<data-dir>/session.db` | Path to the SQLite session database. | + +All [runtime configuration flags](#runtime-configuration-flags) are also accepted. + +```bash +# Examples +$ docker agent serve acp agent.yaml +$ docker agent serve acp ./team.yaml +$ docker agent serve acp myorg/agent:tag +``` + +See [ACP](../acp/index.md) for details on the Agent Client Protocol. + +### `docker agent serve chat` + +Start an HTTP server that exposes one or more agents through an **OpenAI-compatible Chat Completions API** at `/v1/chat/completions` and `/v1/models`. This lets any tool that already speaks the OpenAI protocol — for example [Open WebUI](https://github.com/open-webui/open-webui), `curl`, the OpenAI Python SDK, or LangChain — drive a Docker Agent agent without any custom integration. + +```bash +$ docker agent serve chat <config> [flags] +``` + +| Flag | Default | Description | +| ----------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------- | +| `-a, --agent <name>` | (all agents) | Name of the agent to expose. If omitted, every agent in the config is exposed as a separate model. | +| `-l, --listen <addr>` | `127.0.0.1:8083` | Address to listen on. | +| `--cors-origin <origin>` | (none) | Allowed CORS origin (e.g. `https://example.com`). Empty disables CORS. | +| `--api-key <token>` | (none) | Required Bearer token clients must present (`Authorization: Bearer <token>`). Empty disables auth. | +| `--api-key-env <name>` | (none) | Read the required API key from this non-empty environment variable. | +| `--insecure-no-auth` | `false` | Permit unauthenticated non-loopback binding. | +| `--safety <policy>` | `restricted` | Tool safety policy; CLI value overrides agent/runtime configuration. | +| `--max-request-size <bytes>` | `1048576` (1 MiB) | Maximum request body size. Requests exceeding this limit are rejected with HTTP 413 — see [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large). | +| `--request-timeout <dur>` | `5m` | Per-request timeout (covers model + tool calls + streaming). | +| `--conversations-max <n>` | `0` | Cache up to N conversations server-side, keyed by `X-Conversation-Id`. `0` disables — clients must resend history. | +| `--conversation-ttl <dur>` | `30m` | Idle TTL after which a cached conversation is evicted. | +| `--max-idle-runtimes <n>` | `4` | Maximum number of idle runtimes pooled per agent. `0` disables pooling. | + +```bash +# Examples +$ docker agent serve chat agent.yaml +$ docker agent serve chat ./team.yaml --agent reviewer +$ docker agent serve chat myorg/agent:tag --listen 127.0.0.1:9090 +$ docker agent serve chat agent.yaml --api-key-env CHAT_BEARER_TOKEN + +# Drive it from any OpenAI-compatible client +$ curl http://127.0.0.1:8083/v1/chat/completions \ + -H 'Content-Type: application/json' \ + -d '{"model": "root", "messages": [{"role": "user", "content": "hello"}]}' +``` + +See [Chat Server](../chat-server/index.md) for the full feature reference. + +### `docker agent board` + +Launch a full-screen Kanban TUI for orchestrating multiple agents at once. Each card runs an agent in its own tmux session on an isolated git worktree; moving a card forward through the pipeline (Dev → Review → Push → Done) delivers the destination column's prompt to that card's agent. Projects and column prompts are stored in the global config file (`~/.config/cagent/config.yaml`) and can be managed from the TUI. + +```bash +$ docker agent board +``` + +Takes no arguments or flags. Requires `tmux` and `git` to be installed. + +See [Kanban Board](../board/index.md) for key bindings, configuration, and workflow details. + +### `docker agent share push` / `docker agent share pull` + +Share agents via OCI registries. + +```bash +# Push an agent +$ docker agent share push ./agent.yaml docker.io/username/my-agent:latest + +# Pull an agent +$ docker agent share pull docker.io/username/my-agent:latest + +# Force pull, overwriting the local copy +$ docker agent share pull docker.io/username/my-agent:latest --force +``` + +| Flag | Applies to | Description | +| ---------- | ---------- | ---------------------------------------------------------- | +| `--force` | `pull` | Force pull even if the configuration already exists locally | + +See [Agent Distribution](../../concepts/distribution/index.md) for full registry workflow details. + +### `docker agent sessions diff` + +Compare two recorded sessions and report the first point where the agent behaved +differently — the triage answer when a task that worked yesterday does not work +today. + +```bash +$ docker agent sessions diff <session-a> <session-b> [flags] +``` + +```console +$ docker agent sessions diff -1 -2 +Comparing a1b2c3d4 (7 turns) against e5f6a7b8 (9 turns) + +❌ First divergence at turn 3 (after 3 matching turn(s)). + a1b2c3d4 called: + read_file({"path":"pkg/cache/cache.go"}) + e5f6a7b8 called: + search_files_content({"query":"persistToDisk","path":"."}) + +Everything after this point is downstream of the divergence and is not compared. +``` + +Session references accept a full ID, a unique ID prefix, or a relative form such +as `-1` for the most recent run. + +| Flag | Default | Description | +| ----------------------- | ----------------------- | ------------------------------------------------ | +| `-s, --session-db` | `<data-dir>/session.db` | Path to the session database | +| `--json` | `false` | Emit the comparison as JSON | +| `--fail-on-divergence` | `false` | Exit non-zero when the two sessions diverge | + +Comparison is over the sequence of tool calls, not the assistant's prose: model +output is nondeterministic, so two runs of the same task almost always word +things differently while doing the same work. Turns taken by delegated +sub-agents are included in sequence. Reporting stops at the first divergence — +everything after it is downstream of that difference. + +This locates *where* two runs diverged, not *why*. Re-running a session against +a different model while holding the environment fixed is a separate, unbuilt +feature. + +### `docker agent eval` + +Run agent evaluations against a directory of recorded sessions. + +```bash +$ docker agent eval <agent-file>|<registry-ref> [<eval-dir>|./evals] [flags] +``` + +| Flag | Default | Description | +| ------------------- | ------------------------------------ | -------------------------------------------------------------------------- | +| `-c, --concurrency` | num CPUs | Number of concurrent evaluation runs | +| `--judge-model` | `anthropic/claude-opus-5` | Model for LLM-as-a-judge relevance scoring (format: `provider/model`) | +| `--output <dir>` | `<eval-dir>/results` | Directory for results, logs, and session databases | +| `--only <pattern>` | (all) | Only run evals with file names matching these patterns (repeatable) | +| `--base-image` | (default) | Custom base image for eval containers | +| `--container-runtime` | `docker` | Container runtime executable for building and running evaluations (e.g. `podman`) | +| `--keep-containers` | `false` | Keep containers after evaluation (don't remove with `--rm`) | +| `-e, --env` | (none) | Environment variables to pass to container (`KEY` or `KEY=VALUE`, repeatable) | +| `--repeat <n>` | `1` | Number of times to repeat each evaluation (useful for computing baselines) | +| `--baseline <file>` | (none) | Compare against a previously saved run JSON (`<output>/<run>.json`) and exit non-zero on regression | +| `--regression-tolerance <n>` | `0` | How far an aggregate quality rate may fall before `--baseline` reports a regression (0–1) | + +All [runtime configuration flags](#runtime-configuration-flags) are also accepted. + +```bash +# Examples +$ docker agent eval agent.yaml # use ./evals +$ docker agent eval agent.yaml ./my-evals # custom directory +$ docker agent eval agent.yaml -c 8 # 8 concurrent evaluations +$ docker agent eval agent.yaml --keep-containers # keep containers for debugging +$ docker agent eval agent.yaml --only "auth*" # only run matching evals +$ docker agent eval agent.yaml --repeat 5 # repeat each eval 5 times +$ docker agent eval agent.yaml --container-runtime podman # use a Docker-compatible runtime such as Podman +``` + +See [Evaluation](../evaluation/index.md) for details on creating eval sessions and interpreting results. + +### `docker agent version` + +Print the version and commit hash for your `docker-agent` install. + +```bash +$ docker agent version +docker agent version v1.54.0 +Commit: 1737035c +``` + +### `docker agent alias` + +Manage agent aliases for quick access. + +```bash +# List aliases +$ docker agent alias ls + +# List aliases as JSON +$ docker agent alias list --json + +# Add an alias +$ docker agent alias add pirate /path/to/pirate.yaml +$ docker agent alias add other ociReference + +# Add an alias with runtime options +$ docker agent alias add yolo-coder myorg/coder --yolo +$ docker agent alias add careful-coder myorg/coder --safety balanced +$ docker agent alias add fast-coder myorg/coder --model openai/gpt-4o-mini +$ docker agent alias add safe-coder myorg/coder --sandbox +$ docker agent alias add turbo myorg/coder --yolo --model anthropic/claude-sonnet-4-5 + +# Use an alias +$ docker agent run pirate +$ docker agent run yolo-coder +``` + +**Alias Options:** Aliases can include runtime options that apply automatically when used: + +- `--yolo` — Auto-approve tool calls (unless explicitly denied) when running the alias. Legacy alias for `--safety autonomous`. +- `--safety <mode>` — Default [safety mode](../../configuration/permissions/index.md#safety-modes) (`strict`, `balanced`, `restricted`, or `autonomous`) when running the alias. Wins over the alias's `yolo` option; both are stored declaratively in the user config (`aliases.<name>.safety` / `aliases.<name>.yolo`), so you can also edit them there by hand. +- `--model <ref>` — Override the model for the alias +- `--hide-tool-results` — Hide tool call results in the TUI when running the alias +- `--sandbox` — Always run the alias inside a [Docker sandbox](../../configuration/sandbox/index.md) + +Alias safety options are defaults for new sessions: an explicit `--safety`/`--yolo` on the command line wins over them, they win over `settings.safety`/`settings.YOLO` and over anything declared in the agent YAML, and they never change the mode of a resumed session. + +When listing aliases, options are shown in brackets: + +```bash +$ docker agent alias ls +Registered aliases (3): + + fast-coder → myorg/coder [model=openai/gpt-4o-mini] + turbo → myorg/coder [yolo, model=anthropic/claude-sonnet-4-5] + yolo-coder → myorg/coder [yolo] + +Run an alias with: docker agent run <alias> +``` + +Pass `--json` to output aliases as a JSON array instead of the formatted table. Each entry includes the alias `name` and its options: + +```bash +$ docker agent alias list --json +[ + { + "name": "fast-coder", + "path": "myorg/coder", + "model": "openai/gpt-4o-mini" + }, + { + "name": "turbo", + "path": "myorg/coder", + "yolo": true, + "model": "anthropic/claude-sonnet-4-5" + }, + { + "name": "yolo-coder", + "path": "myorg/coder", + "yolo": true + } +] +``` + +JSON output is sorted by name and omits false/zero-valued fields. This is useful for scripting and automation. + +> [!TIP] +> **Override alias options** +> +> Command-line flags override alias options. For example, `docker agent run yolo-coder --yolo=false` disables yolo mode even though the alias has it enabled. + +> [!TIP] +> **Set a default agent** +> +> Create a `default` alias to customize what `docker agent` starts with no arguments: +> +> ```console +> $ docker agent alias add default /my/default/agent.yaml +> ``` +> +> Then simply run `docker agent` — it will launch that agent automatically. + +### `docker agent sandbox` + +Manage settings shared by every [`--sandbox`](../../configuration/sandbox/index.md) run — today, the persistent network allowlist that turns a `Blocked by network policy` 403 into a one-line, durable fix: + +```bash +# Allow a host on every subsequent --sandbox run. +$ docker agent sandbox allow api.example.com + +# Or several at once. +$ docker agent sandbox allow api.example.com registry.npmjs.org:443 + +# See what's persisted in ~/.config/cagent/config.yaml. +$ docker agent sandbox list + +# Drop a host you no longer need. +$ docker agent sandbox deny api.example.com +``` + +Entries are unioned with the gateway, the kit-resolved tool install hosts, and any `runtime.network_allowlist` declared by the agent. The launch summary lists every source separately so you can see which holes were punched by which layer. + +### `docker agent plans` + +Manage the plans agents collaborate on, from the host — without starting a session. Two plan systems are covered: + +- **Shared plans** — the named, versioned documents of the [plan toolset](../../tools/plan/index.md). Fully manageable: create, update, set status, export, delete. +- **Session plans** — the single per-session plan of the "draft, review, execute" workflow. Read-only here (`list`, `get`, `export`); they belong to their session and are changed from within it. A mutation aimed at a session plan fails with an `unsupported` error explaining what to do instead. + +```bash +$ docker agent plans <subcommand> [flags] +``` + +| Subcommand | Description | +| ---------- | ----------- | +| `list [--session <id>]` | List shared plans with scope, name, status, version, updated time, and title. With `--session`, that session's plan is listed first when it exists. Plans that exist but cannot be read are reported as warnings on stderr (in the `warnings` field with `--json`), so they are never mistaken for missing. | +| `get <name>` | Print a plan. Content goes to stdout and a concise metadata line goes to stderr, so `> file` captures the content alone (use `export` for a byte-exact copy). `get --session <id>` prints a session's plan; the name is then omitted (`--scope shared\|session` disambiguates explicitly, and `--session` alone implies session scope). | +| `create <name> --file <path>` | Create a new shared plan with content from `--file` (required — the CLI never prompts; `--file -` reads stdin). Create-only: an existing name fails with a version conflict instead of overwriting. `--title`, `--author`, and `--status` set metadata. | +| `update <name> --file <path>` | Replace the content of an existing shared plan (never creates). Omitted `--title`/`--author`/`--status` flags preserve the current values; passing them (even empty) overwrites. | +| `status <name> <status>` | Set a shared plan's free-form status without touching its body (bumps the version). | +| `export <name> --output <path>` | Write a plan's content, byte-exact, to a file (parents created, atomic write). An existing destination is refused (`invalid_argument`) and left untouched; add `--force` to replace an existing regular file atomically. Works for both scopes: `export --session <id> --output <path>`. | +| `delete <name>` | Delete a shared plan. A `--force` delete also recovers a corrupt plan. | + +Plan content passed via `--file` (a regular file, or stdin with `--file -`) is capped at 10 MiB — the same limit the plan storage itself enforces — and a directory or non-regular file (device, named pipe) is rejected up front; violations fail with an `invalid_argument` error. + +**Concurrency guard:** every mutation (`update`, `status`, `delete`) requires exactly one of two mutually exclusive flags — the CLI is headless and never prompts: + +- `--expected-version <n>` — the version you last read (from `get` or `list`; must be ≥ 1). When the plan changed in the meantime the command fails with a version conflict, reports the current version, leaves the plan untouched, and exits with code **3** (all other failures exit with 1). +- `--force` — deliberately write without the optimistic-lock guard (last writer wins). + +`create` takes no guard: it is inherently create-only and conflicts (exit code 3) when the name already exists. + +**JSON output:** every subcommand accepts `--json`. Success documents go to stdout with a top-level `"schema_version": "1"` marker and stable service-model keys (`plans`, `plan`, `export`, `deleted`) whose fields are snake_case (`updated_at`, `session_id`, `bytes_written`; a zero/unknown `updated_at` is omitted); empty plan lists encode as `[]`, and no prose or ANSI is mixed in. Failures print a single JSON object to stderr: + +```json +{"schema_version":"1","error":{"code":"conflict","message":"...","scope":"shared","name":"p","expected_version":1,"current_version":2}} +``` + +with `code` one of `conflict` (including `expected_version` and `current_version`), `not_found`, `invalid_argument`, `unsupported`, `corrupt`, `storage`, or `error`; `scope`, `name`, and `op` are included where the failure carries them. Validation performed before a subcommand runs is covered too: a missing required flag, a violated `--expected-version`/`--force` group rule, and wrong positional arguments are reported as the same JSON object (code `invalid_argument`) whenever `--json` is present. One residual: flags are parsed left-to-right and parsing stops at the first unknown flag or invalid flag value, so such an error is reported as JSON only when `--json` appears before it on the command line; errors raised before a `plans` subcommand is resolved at all (e.g. an unknown subcommand) also remain plain text. + +```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 +$ docker agent plans get --session <session-id> # a session's plan +$ docker agent plans export --session <session-id> --output ./session-plan.md +``` + +Plans live under the data directory (`~/.cagent/plans/` and `~/.cagent/session_plans/` by default), so `--data-dir` selects which store the commands operate on. + +### `docker agent debug` + +Troubleshooting subcommands for inspecting how an agent config resolves and generating diagnostic output — useful when a config isn't behaving the way you expect. `debug` doesn't appear in `docker agent --help` (it's a diagnostic surface, not a day-to-day command), but every subcommand below is stable and fully supported. + +```bash +$ docker agent debug <subcommand> [flags] +``` + +| Subcommand | Description | +| ---------- | ----------- | +| `config <agent-file>` | Print the fully-resolved, canonical form of an agent's configuration (defaults applied, references resolved). | +| `toolsets <agent-file>` | List every toolset each agent in the config exposes, with each tool's name and description. | +| `skills <agent-file>` | List the skills discovered for each agent, marking forked skills. | +| `title <agent-file> <question>` | Generate a session title for `<question>` using the same title-generation path the TUI uses (including any configured `title_model`), without starting a session. See [Session Titles](../sessions/index.md#session-titles). | +| `auth` | Print parsed Docker authentication info from the token in use (source, subject, issuer, expiry, username/email). Add `--json` for machine-readable output. | +| `oauth list` | List stored MCP OAuth tokens (resource, scope, expiry, redacted access token). Add `--json` for machine-readable output. | +| `oauth remove <resource-url>` | Remove a stored MCP OAuth token. | +| `oauth login <agent-file> <mcp-name>` | Perform an interactive OAuth login for a remote MCP server declared in the config, by its name or URL. See [Remote MCP Servers](../remote-mcp/index.md). | + +```bash +# Examples +$ docker agent debug config agent.yaml +$ docker agent debug toolsets agent.yaml +$ docker agent debug skills agent.yaml +$ docker agent debug title agent.yaml "How do I configure a fallback model?" +$ docker agent debug auth --json +$ docker agent debug oauth list +$ docker agent debug oauth login agent.yaml github +``` + +> [!WARNING] +> **`debug auth --json` prints the full bearer token** +> +> The text output of `debug auth` truncates the token to a short preview, but `--json` includes the complete, unredacted JWT in its `token` field. Never paste `debug auth --json` output into logs, issue trackers, or bug reports — anyone with that token can act as you against Docker. Use the plain-text output (or redact the `token` field yourself) when sharing diagnostic output. + +The `Source` field says where the token came from: `docker desktop`, or `minted from the stored access token` when it was obtained by exchanging the access token `docker login` stored. See [Docker authentication](../../guides/secrets/index.md#docker-authentication). + +The `config`, `toolsets`, `skills`, and `title` subcommands also accept [runtime configuration flags](#runtime-configuration-flags) (`--working-dir`, `--models-gateway`, …); `title` additionally accepts `--model` to override the model used to resolve the config before generating the title. + +### `docker agent completion` + +Generate a shell completion script for `bash`, `zsh`, `fish`, or `powershell`. + +```bash +$ docker agent completion <bash|zsh|fish|powershell> + +# 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" +``` + +Run `docker agent completion <shell> --help` for shell-specific installation instructions. + +### Self-update + +When installed from a standalone GitHub release binary, Docker Agent can opt in to updating itself. It's disabled by default; set `DOCKER_AGENT_AUTO_UPDATE` to a truthy value (`1`, `true`, `yes`, `on`) to enable it for a command or a shell session: + +```bash +$ DOCKER_AGENT_AUTO_UPDATE=1 docker agent run +``` + +When enabled, every command checks the latest GitHub release before running. If a newer release exists, an interactive session asks whether to install it; a non-interactive session (CI, piped input) proceeds automatically. On yes, Docker Agent downloads the asset for your OS/architecture, verifies its checksum, replaces the current binary, and re-executes with the same arguments. The whole mechanism is fail-safe: any failure at any step falls back to running the current binary. Self-update never triggers for `version`, `help`, `--help`/`-h` (including per-subcommand help), `completion`, or the Docker CLI plugin metadata handshake. + +See [Optional Self-Updates](../../getting-started/installation/index.md#optional-self-updates) for the full walkthrough. Docker Desktop and Homebrew installs already manage updates and don't need this. + +## Global Flags + +These flags are available on every `docker agent` command: + +| Flag | Description | +| ------------------------- | -------------------------------------------------------------------------------------- | +| `-d, --debug` | Enable debug logging (default location: `~/.cagent/cagent.debug.log`) | +| `--log-file <path>` | Custom debug log location (only used with `--debug`) | +| `-o, --otel` | Enable OpenTelemetry observability: traces, metrics, and logs. Requires `OTEL_EXPORTER_OTLP_ENDPOINT` to export to a collector. | +| `--cache-dir <path>` | Override the cache directory (default: `~/Library/Caches/cagent` on macOS) | +| `--config-dir <path>` | Override the config directory (default: `~/.config/cagent`). Also reads `DOCKER_AGENT_CONFIG_DIR` (legacy `CAGENT_CONFIG_DIR`) env var. | +| `--data-dir <path>` | Override the data directory (default: `~/.cagent`; holds `session.db`, worktrees, plans, …) | +| `--help` | Show help for any command | + +### OpenTelemetry environment variables + +When `--otel` is enabled, the standard [OTel SDK env vars](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/) are honored (`OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_RESOURCE_ATTRIBUTES`, etc.). Two additional Docker Agent-specific variables control GenAI instrumentation: + +| Variable | Default | Description | +| -------- | ------- | ----------- | +| `OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT` | `false` | Set to `true` to capture prompt text, model responses, tool arguments, and tool results as span attributes. Off by default because these fields may contain PII. | +| `OTEL_SEMCONV_STABILITY_OPT_IN` | (dual-emit) | Set to `gen_ai_latest_experimental` to emit only the spec-defined `gen_ai.*` keys from the [GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/). The default dual-emit mode emits both `gen_ai.*` and legacy keys so existing dashboards continue working. | + +## Runtime Configuration Flags + +These flags are accepted by every command that loads an agent (`run`, `run --exec`, `new`, `eval`, `serve api`, `serve mcp`, `serve a2a`, `serve acp`, `serve chat`). They are listed once here to avoid repetition in the per-command tables above. + +| Flag | Description | +| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `--working-dir <path>` | Set the working directory for the session (applies to tools and relative paths). | +| `--env-from-file <path>` | Load environment variables from file (repeatable). | +| `--flavor <name>` | Enable a config flavor, a YAML patch defined under the config's `flavors` section (repeatable, applied in order). See [Flavors](../../configuration/flavors/index.md). | +| `--code-mode-tools` | Provide a single tool to call other tools via JavaScript (forces code-mode tools globally). | +| `--models-gateway <addr>` | Route model traffic through a gateway. Reads `DOCKER_AGENT_MODELS_GATEWAY` (legacy `CAGENT_MODELS_GATEWAY`) env var. | +| `--hook-pre-tool-use <cmd>` | Add a pre-tool-use hook command (repeatable). See [Hooks](../../configuration/hooks/index.md). | +| `--hook-post-tool-use <cmd>` | Add a post-tool-use hook command (repeatable). | +| `--hook-session-start <cmd>` | Add a session-start hook command (repeatable). | +| `--hook-session-end <cmd>` | Add a session-end hook command (repeatable). | +| `--hook-on-user-input <cmd>` | Add an on-user-input hook command (repeatable). | +| `--hook-stop <cmd>` | Add a stop hook command, fired when the model finishes responding (repeatable). | +| `--mcp-oauth-redirect-uri <url>` | Public HTTPS URL to advertise as the OAuth `redirect_uri` for MCP servers running in unmanaged OAuth mode. When set, docker-agent drives PKCE and the code exchange in-process instead of expecting the client to. See [Remote MCP](../remote-mcp/index.md) for details. | + +## Agent References + +Commands that accept a config support multiple reference types: + +| Type | Example | +| ------------- | ------------------------------------------- | +| Local file | `./agent.yaml` | +| OCI registry | `docker.io/username/agent:latest` | +| Hub shorthand | `myorg/agent:tag` | +| Alias | `pirate` (after `docker agent alias add`) | +| Default | (no argument) — uses project config or built-in default agent | + +> [!NOTE] +> **Debugging** +> +> Having issues? See [Troubleshooting](../../community/troubleshooting/index.md) for debug mode, log analysis, and common solutions. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/code-mode/index.md b/_vendor/github.com/docker/docker-agent/docs/features/code-mode/index.md new file mode 100644 index 000000000000..80a55978a991 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/code-mode/index.md @@ -0,0 +1,66 @@ +--- +title: "Code Mode" +description: "Let an agent write JavaScript that orchestrates several tool calls in one turn instead of calling tools one at a time." +keywords: docker agent, ai agents, features, code mode +weight: 115 +canonical: https://docs.docker.com/ai/docker-agent/features/code-mode/ +--- + +_Let an agent write JavaScript that orchestrates several tool calls in one turn instead of calling tools one at a time._ + +## What Code Mode Is + +By default, a model calls one tool at a time: it emits a tool call, waits for the result, then decides what to call next. For a task that chains many tool calls together — "list every open issue, then for each one fetch its comments, then summarize" — that means one model round-trip per step. + +**Code Mode** replaces the agent's individual tools with a single tool, `run_tools_with_javascript`, that runs a JavaScript script. Every tool the agent would otherwise call directly is exposed to that script as a plain JavaScript function (synchronous — no `await`/`async` needed). The model writes a script that calls as many of them as it needs, combines and filters the results, and returns a single string — all in one tool call. + +## Enabling Code Mode + +Set `code_mode_tools: true` on an agent: + +```yaml +# examples/code_mode.yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Demonstrates the use of Code Mode with tools + instruction: Use your tool to help the user with their github requests. + code_mode_tools: true + commands: + demo: How many issues in docker/docker-agent have a number that is prime? + toolsets: + - type: mcp + ref: docker:github-official +``` + +Every toolset configured on the agent (the GitHub MCP server here) is wrapped: the model no longer sees the individual GitHub tools, only `run_tools_with_javascript`, with each wrapped tool documented as TypeScript interfaces, type aliases, and function declarations inside its description. + +To force Code Mode for every agent in a run regardless of their individual config, use the `--code-mode-tools` CLI flag (or the equivalent `--code-mode-tools` [runtime configuration flag](../cli/index.md#runtime-configuration-flags), accepted by `run`, `run --exec`, `serve api`, `serve mcp`, and the other commands that load an agent): + +```bash +$ docker agent run agent.yaml --code-mode-tools +``` + +## When It Helps + +Code Mode is worth enabling when an agent's task typically needs **many tool calls chained together**, especially with conditional logic or filtering in between — for example, paging through a large result set, cross-referencing several API calls, or reducing a large payload down to the few fields the model actually needs before it ever sees them. Each of those becomes one model turn instead of many, which cuts both latency and token spend on tool-call/response round-trips. + +It is not a general-purpose replacement for direct tool calls: for an agent that mostly makes one or two independent tool calls per turn, Code Mode adds the overhead of writing and reasoning about a script for no real benefit. + +## Limits & Security Notes + +- **One string result.** The script must return a string; use `console.*` inside the script to print debug information if something doesn't behave as expected — it comes back as `stdout`/`stderr` alongside the result. +- **Failures are diagnosable.** If the script throws or returns unexpectedly, the response includes the tool calls it made before failing (name, arguments, and result or error), so the model can see what happened and adjust the script on the next attempt. +- **Not every tool is wrapped.** Tools in the `todo` category are excluded from the script environment and stay directly callable as ordinary tools — Code Mode does not replace them. +- **The script runs in an embedded, sandboxed JS engine** ([goja](https://github.com/dop251/goja)), not Node.js or a browser: there is no filesystem, network, or process access beyond the tool functions injected into it. + +## Interaction With Permissions and Tool Approval + +[Permissions](../../configuration/permissions/index.md) and interactive tool-call approval are enforced when the **runtime dispatches a tool call requested by the model** — which, with Code Mode enabled, is only `run_tools_with_javascript` itself. The individual tool calls a script makes from inside that JavaScript are invoked directly and do **not** go through a second round of permission checks or approval prompts. + +In practice this means enabling `code_mode_tools` collapses the approval granularity from "one prompt per tool call" down to "one prompt for the whole script". Treat that single approval as authorizing everything the script's toolset could do: + +> [!WARNING] +> **Coarser approval granularity** +> +> Approving a `run_tools_with_javascript` call approves every tool it might invoke internally, including ones that would otherwise need a separate `ask` or be blocked by a `deny` pattern under [Permissions](../../configuration/permissions/index.md). If an agent's toolset includes anything destructive, consider whether Code Mode's coarser granularity is acceptable for that agent before enabling it. Delegating to a separate, non-Code-Mode agent isn't a way out either: [handoff](../../tools/handoff/index.md) and [transfer_task](../../tools/transfer-task/index.md) are themselves wrapped like any other tool once `code_mode_tools` is on, but they have no code-mode-compatible handler — the model's script gets `tool "handoff" is not available in code mode` if it tries to call them. This only rules out the model *choosing* to delegate from inside the script: a configured `force_handoff` target on the agent still runs deterministically after the agent's turn naturally stops, regardless of Code Mode, since it's applied by the runtime outside the tool-call dispatch path Code Mode replaces. Keep `code_mode_tools` off any agent whose model needs to hand off or transfer to one that holds a destructive toolset. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/evaluation/index.md b/_vendor/github.com/docker/docker-agent/docs/features/evaluation/index.md new file mode 100644 index 000000000000..c90701dec2e4 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/evaluation/index.md @@ -0,0 +1,311 @@ +--- +title: "Evaluation" +description: "Measure agent quality with automated evaluations — tool call accuracy, response relevance, output size, and more." +keywords: docker agent, ai agents, features, evaluation +weight: 100 +canonical: https://docs.docker.com/ai/docker-agent/features/evaluation/ +aliases: + - /ai/docker-agent/evals/ +--- + +_Measure agent quality with automated evaluations — tool call accuracy, response relevance, output size, and more._ + +## Overview + +The `docker agent eval` command runs your agent against a set of recorded sessions and scores the results. Each eval session captures a user question, the expected tool calls, and criteria the response must satisfy. Docker Agent replays the question, compares the agent's behavior to expectations, and produces a report. + +> [!NOTE] +> **Container runtime required** +> +> Evaluations run inside containers for isolation. Each eval gets a clean environment with optional setup scripts. A running Docker-compatible container CLI/runtime is required: Docker Desktop or Docker Engine by default, or another Docker-compatible runtime such as Podman selected with `--container-runtime`. + +## Quick Start + +```bash +# Run evaluations for an agent +$ docker agent eval agent.yaml + +# Specify a custom evals directory +$ docker agent eval agent.yaml ./my-evals + +# Run with 8 concurrent evaluations +$ docker agent eval agent.yaml -c 8 + +# Only run evals matching a pattern +$ docker agent eval agent.yaml --only "auth*" + +# Repeat each eval 5 times to compute a baseline +$ docker agent eval agent.yaml --repeat 5 + +# Repeat a specific eval 5 times +$ docker agent eval agent.yaml --only "auth*" --repeat 5 + +# Use a Docker-compatible runtime such as Podman +$ docker agent eval agent.yaml --container-runtime podman +``` + +## Eval Directory Structure + +By default, Docker Agent looks for eval sessions in an `evals/` directory next to your agent config: + +```bash +my-agent/ +├── agent.yaml +└── evals/ + ├── 41b179a2-....json # Eval session 1 + ├── 5d83e247-....json # Eval session 2 + └── results/ # Output (auto-created) + ├── adjective-noun-1234.json + ├── adjective-noun-1234.log + ├── adjective-noun-1234.db + └── adjective-noun-1234-sessions.json +``` + +## Eval Session Format + +Each eval file is a JSON session that captures a complete conversation. The key fields for evaluation are the user message, the expected tool calls (recorded from a real session), and optional eval criteria: + +```json +{ + "id": "41b179a2-ed19-4ae2-a45d-95775aaa90f7", + "title": "Counting Files in Local Folder", + "messages": [ + { + "message": { + "message": { + "role": "user", + "content": "How many files in the local folder?" + } + } + }, + { + "message": { + "agent_name": "root", + "message": { + "role": "assistant", + "tool_calls": [ + { + "id": "call_abc123", + "type": "function", + "function": { + "name": "list_directory", + "arguments": "{\"path\":\"./\"}" + } + } + ] + } + } + }, + { + "message": { + "agent_name": "root", + "message": { + "role": "assistant", + "content": "There are 2 files in the local folder..." + } + } + } + ], + "evals": { + "relevance": [ + "The response mentions exactly 2 files", + "The response lists README.md and agent.yaml" + ], + "size": "S", + "working_dir": "my-project", + "setup": "echo 'hello' > test.txt" + } +} +``` + +## Eval Criteria + +The `evals` object inside each session controls what gets scored: + +| Field | Type | Description | +| ------------- | -------- | ----------------------------------------------------------------------------------------- | +| `relevance` | string[] | Statements that must be true about the agent's response. Scored by an LLM judge. | +| `size` | string | Expected response size: `S`, `M`, `L`, or `XL`. Compared against actual output length. | +| `working_dir` | string | Subdirectory under `evals/working_dirs/` to mount as the container's working directory. | +| `setup` | string | Shell script to run in the container before the agent executes (e.g., create test files). | + +## Scoring Metrics + +Docker Agent evaluates agents across three dimensions: + +| Metric | How It's Measured | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| **Tool Calls (F1)** | F1 score between the expected tool call sequence (from the recorded session) and the actual tool calls made by the agent. | +| **Relevance** | An LLM judge (configurable via `--judge-model`) evaluates whether each relevance statement is satisfied by the response. | +| **Size** | Whether the response length matches the expected size category (S/M/L/XL). | + +## Serve-safety verification and rollback + +When changing an agent served over MCP HTTP, chat, or A2A, add an evaluation that attempts an approval-requiring tool call and verifies the resolved safety policy and authentication behavior. Run the evaluation with the same explicit `--safety` setting used in deployment. If a rollout must be reversed, stop the affected listener, restore the prior agent configuration and explicit safety flag, then restart only after confirming non-loopback listeners still require authentication. Do not restore an unauthenticated network listener as a rollback shortcut. + +## Creating Eval Sessions + +The easiest way to create eval sessions is from real conversations: + +1. Run your agent interactively: `docker agent run agent.yaml` +2. Have a conversation that tests the behavior you care about +3. Use the `/eval` slash command in the TUI to save the session as an eval file +4. Edit the generated JSON to add `evals` criteria (relevance, size, etc.) + +> [!TIP] +> Start with tool call scoring (automatic from recorded sessions), then add relevance criteria for the responses you care most about. + +## CLI Flags + +```bash +$ docker agent eval <agent-file>|<registry-ref> [<eval-dir>|./evals] +``` + +| Flag | Default | Description | +| ------------------- | --------------------------- | ----------------------------------------------------------------- | +| `-c, --concurrency` | num CPUs | Number of concurrent evaluation runs | +| `--judge-model` | `anthropic/claude-opus-5` | Model for LLM-as-a-judge relevance scoring | +| `--output` | `<eval-dir>/results` | Directory for results, logs, and session databases | +| `--only` | (all) | Only run evals with file names matching these patterns | +| `--base-image` | (default) | Custom base image for eval containers (see [Custom Base Images](#custom-base-images)) | +| `--container-runtime` | `docker` | Container runtime executable for building and running evaluations (e.g. `podman`) | +| `--keep-containers` | `false` | Keep containers after evaluation (don't remove with `--rm`) | +| `-e, --env` | (none) | Environment variables to pass to container (`KEY` or `KEY=VALUE`) | +| `--repeat` | `1` | Number of times to repeat each evaluation (useful for computing baselines) | +| `--baseline` | (none) | Compare against a previously saved run JSON and exit non-zero on regression (see [Regression gate](#regression-gate)) | +| `--regression-tolerance` | `0` | How far an aggregate quality rate may fall before `--baseline` reports a regression (0–1) | + +### Regression gate + +`--baseline` compares the run against a previous one and exits non-zero when +quality regressed, so an eval suite can gate CI: + +```console +$ docker agent eval ./agent.yaml --baseline results/2026-08-01-run.json +``` + +The baseline is the run JSON written by a previous invocation — +`<output>/<run-name>.json` — so there is no separate artifact to produce. + +Four rules decide the verdict, and they are worth knowing before wiring this +into CI: + +- **The tolerance governs aggregate rates only.** An LLM judge does not return + the same score twice, so without a tolerance the gate flaps. `--regression-tolerance 0.05` + lets an aggregate rate fall five points before it counts. +- **An evaluation that passed and now fails always gates**, regardless of the + tolerance. That transition is the signal the gate exists to catch, so it is + never absorbed. +- **Cost is reported but never gates.** A provider price change is not a quality + regression. +- **An added *failing* evaluation gates** via the aggregate rate, even though no + existing evaluation regressed. A suite that got worse should say so — but it + means committing a known-failing eval needs a tolerance bump or a fix. + +A baseline that carries no evaluations, or a run that produced none (an +`--only` pattern that matched nothing), is rejected rather than reported as +passing: a gate that cannot fail is worse than no gate. + +### Provider Credentials + +Eval containers are isolated from your host environment. Dedicated model +provider API keys (for example `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`) are +forwarded into eval containers automatically, so most provider setups work +without extra flags. + +> [!WARNING] +> **`GITHUB_TOKEN` and `GH_TOKEN` are not forwarded automatically** +> +> GitHub tokens are broad credentials (git, `gh`, CI, packages), not dedicated +> model API keys, so for security reasons Docker Agent does not forward them +> into eval containers — even when they are set in your shell or in +> `~/.config/cagent/.env`. If your agent uses the `github-copilot` provider, +> pass the token explicitly by name: +> +> ```bash +> docker agent eval agent.yaml ./evals -e GITHUB_TOKEN +> ``` +> +> When using a custom env file, both flags are required: +> +> ```bash +> docker agent eval agent.yaml ./evals \ +> --env-from-file /path/to/secrets.env \ +> -e GITHUB_TOKEN +> ``` + +Note that the LLM judge runs on the host, not inside the eval container. If +the token is not forwarded, judge validation can succeed while every +evaluated agent run fails to authenticate. + +### Custom Base Images + +When `--base-image` is set, the eval harness builds a derived image on top of your base image at evaluation time. Two things happen automatically: + +1. **The docker-agent binary is injected** — it is copied from `docker/docker-agent:edge` into the derived image at build time, so you don't need to include it in your base image. +2. **The entrypoint is overridden** — Docker Agent replaces your base image's entrypoint with its own `/run.sh` wrapper. + +Your base image therefore only needs to provide the runtime environment: language runtimes, installed dependencies, test fixtures, the appropriate working directory, and so on. Any `ENTRYPOINT` or `CMD` defined in your base image is ignored. + +## Output + +After a run completes, Docker Agent produces: + +- **Console summary** — Pass/fail status per eval with metric breakdowns +- **JSON results** — Full structured results for programmatic analysis +- **SQLite database** — Complete sessions for detailed investigation and debugging +- **Sessions JSON** — Exported session data for analysis +- **Log file** — Debug-level log of the entire evaluation run + +> [!TIP] +> **Debugging Failed Evals** +> +> Use `--keep-containers` to preserve containers after evaluation. You can then inspect them with your selected runtime's `exec` command (`docker exec` by default, `podman exec` with `--container-runtime podman`) to understand why an eval failed. The session database (`.db` file) contains the full conversation history for each eval. + +```bash +$ docker agent eval demo.yaml ./evals + + ✓ Counting Files in Local Folder + ✓ tool calls ✓ relevance 2/2 + ✓ Checking the Content of README.md File + ✓ tool calls ✓ relevance 1/1 + +✅ Tool Calls: 100.0% avg F1 (2 evals) +✅ Relevance: 3/3 passed (100.0%) + +Total Cost: $0.012345 +Total Time: 12s + +Sessions DB: ./evals/results/happy-panda-1234.db +Sessions JSON: ./evals/results/happy-panda-1234-sessions.json +Log: ./evals/results/happy-panda-1234.log +``` + +## Example + +Here's a minimal evaluation setup: + +```yaml +# agent.yaml +agents: + root: + model: openai/gpt-4o + description: Test agent + instruction: You know how to read/write and list files. + toolsets: + - type: filesystem +``` + +```bash +# Create evals from interactive sessions +$ docker agent run agent.yaml +# ... have conversations, then use /eval to save them + +# Run the evaluations +$ docker agent eval agent.yaml ./evals +``` + +> [!NOTE] +> **See also** +> +> Use `/eval` in the [TUI](../tui/index.md) to create eval sessions from conversations. See the [CLI Reference](../cli/index.md) for all `docker agent eval` flags. Example eval configs are in [examples/eval](https://github.com/docker/docker-agent/tree/main/examples/eval) on GitHub. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/harnesses/index.md b/_vendor/github.com/docker/docker-agent/docs/features/harnesses/index.md new file mode 100644 index 000000000000..b091bfea3ec9 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/harnesses/index.md @@ -0,0 +1,287 @@ +--- +title: "Coding Harnesses" +description: "Delegate coding tasks to external AI coding CLIs (Claude Code, Codex, opencode) as sub-agents." +keywords: docker agent, ai agents, features, coding harnesses +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/features/harnesses/ +--- + +_Delegate coding tasks to external AI coding CLIs (Claude Code, Codex, opencode) as sub-agents._ + +## Overview + +A **harness** agent delegates its work to an external coding CLI — `claude` (Claude Code), `codex` (OpenAI Codex), `opencode`, or `pi` — instead of calling a model API directly. The external CLI drives the coding loop while Docker Agent provides orchestration, hooks, permissions, and distribution. + +This pattern gives you the best of both worlds: + +- **External CLI strengths** — deep IDE integration, specialized coding workflows, CLI-native tool access +- **Docker Agent strengths** — multi-agent coordination, hook-based auditing and policy enforcement, permission controls, OCI distribution, and the full agent config schema + +> [!NOTE] +> **When to use harnesses** +> +> Use a harness when you want a Claude Code / Codex / opencode session to act as a sub-agent inside a larger Docker Agent workflow — for example, an orchestrator that plans work and delegates coding tasks to specialized harness agents. + +## Prerequisites + +The external CLI must be installed and available on `PATH` before starting Docker Agent: + +| Harness type | Required binary | Install | +| --- | --- | --- | +| `claude-code` | `claude` | [docs.anthropic.com/en/docs/claude-code](https://docs.anthropic.com/en/docs/claude-code) | +| `codex` | `codex` | [github.com/openai/codex](https://github.com/openai/codex) | +| `opencode` | `opencode` | [opencode.ai](https://opencode.ai) | +| `pi` | `pi` | Refer to the `pi` CLI documentation for installation instructions. | + +Docker Agent will report an error at session start if the required binary is not found. The `claude-code` harness additionally needs the CLI to be logged in — see [Authentication](#authentication-claude-subscription-no-api-key) below. + +## Configuration + +Add a `harness:` block to any agent definition to make it harness-backed: + +```yaml +agents: + coder: + description: A Claude Code harness agent + harness: + type: claude-code +``` + +Harness agents do **not** need a `model:` field — the external CLI manages its own model selection. + +### Field Reference + +| Field | Applies to | Type | Description | +| --- | --- | --- | --- | +| `type` | all | string | **Required.** One of `claude-code`, `codex`, `opencode`, `pi` | +| `model` | all | string | Optional model override forwarded to the CLI. When omitted, the CLI uses its own default model. | +| `effort` | `claude-code` | string | Reasoning effort: `low` \| `medium` \| `high` \| `xhigh` \| `max` — forwarded as `--effort`. When omitted, Claude Code uses its own default. | +| `agent` | `opencode` | string | opencode agent profile name | +| `thinking` | `opencode` | boolean | Enable extended thinking — forwarded as `--thinking` | + +### Claude Code + +```yaml +agents: + coder: + description: Claude Code coding agent + harness: + type: claude-code + model: claude-sonnet-4-5 # optional: alias (sonnet, opus, haiku) or full model ID + effort: high # low | medium | high | xhigh | max +``` + +- `model` accepts whatever the `claude` CLI accepts for `--model`: an alias + like `sonnet`, `opus`, or `haiku`, or a full model ID like + `claude-sonnet-4-5`. Omit it to use Claude Code's own default model. This is + **not** a Docker Agent `provider/model` reference — the harness model never + goes through Docker Agent's model providers or routing. +- `effort` is forwarded as `--effort` and must be one of `low`, `medium`, + `high`, `xhigh`, or `max`. Omit it to use Claude Code's own default. + +#### Authentication (Claude subscription, no API key) + +The `claude-code` harness runs the official CLI with the CLI's **own login**. +A Claude (claude.ai) subscription sign-in is all it needs — no +`ANTHROPIC_API_KEY` and no Docker Agent model credential are required for the +harness agent itself. Log in once: + +```bash +$ claude auth login --claudeai # interactive, opens a browser +$ claude auth status --text # verify the login +``` + +The login is stored per OS user by the CLI (in its own configuration and, on +macOS, the keychain) and is found via `HOME` and the process environment. Run +the login **as the same OS user and environment that run `docker agent`** — a +login made under another user, container, or `sudo` context is invisible to +the harness. Docker Agent never reads, copies, or stores the CLI's tokens; it +only launches `claude`, which authenticates itself. + +If the CLI is not logged in when a harness agent runs, the `claude` subprocess +fails at session start and the agent reports a harness error — Docker Agent +never opens a browser or starts a login on its own. Diagnose and fix with: + +```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 +``` + +`docker agent doctor <file>` probes the CLI only when the file declares a +`claude-code` harness, and reports installation, version, and safe login +metadata (auth method, API provider, subscription type — never your email, +organization, or tokens). `docker agent setup` offers to run the official +`claude auth login --claudeai` for you (only after you confirm) and writes a +ready-to-run `claude-code-agent.yaml`. + +> [!WARNING] +> **The harness bypasses Claude Code's permission prompts** +> +> Docker Agent runs the CLI non-interactively with its own tools and passes +> `--dangerously-skip-permissions`: Claude Code edits files and runs commands +> without asking. Only point a harness agent at a repository you trust, and +> prefer isolation — `docker agent run --worktree` runs it on an isolated git +> worktree, keeping its changes off your checkout (a worktree with work, or +> from a non-interactive run, is kept for inspection per the normal cleanup +> rules). `docker agent run --sandbox` does not automatically carry the +> `claude` CLI or its login into the sandbox, so it cannot isolate the +> harness unless the sandbox image is separately provisioned and +> authenticated. + +### Codex + +```yaml +agents: + coder: + description: Codex coding agent + harness: + type: codex + model: o4-mini # optional model override +``` + +### opencode + +```yaml +agents: + coder: + description: opencode coding agent + harness: + type: opencode + agent: my-profile # optional agent profile + thinking: true # enable extended thinking +``` + +## What Does NOT Work + +Harness agents bypass the Docker Agent model pipeline entirely. As a result: + +- **Docker Agent toolsets are inactive.** The external CLI provides its own tools — filesystem, shell, etc. Any `toolsets:` defined on a harness agent are silently ignored. +- **`model:` routing is unavailable.** The harness CLI manages model selection; Docker Agent's `models:` configuration and routing rules do not apply to harness agents. +- **Token usage tracking depends on the external CLI.** Docker Agent records usage when the CLI reports it (Claude Code and Codex both report usage data). If the CLI does not emit usage data, the session will show zero token usage. + +> [!WARNING] +> **No Docker Agent toolsets inside a harness** +> +> Do not configure `toolsets:` on a harness agent — they are silently ignored. If you need Docker Agent toolsets alongside external coding capabilities, use a standard sub-agent with `transfer_task` rather than a harness. + +## Hook Behavior + +Hooks work normally on harness agents, including `before_llm_call` and `after_llm_call`. `before_llm_call` runs before the prompt is forwarded to the external CLI and can block or rewrite the run; `after_llm_call` fires after the CLI returns its final response. + +The `model_id` field in hook payloads is set to the harness label (e.g. `claude-code`) rather than a canonical `provider/model` string. This applies to `before_llm_call`, `after_llm_call`, and any other event that carries `model_id`. + +See [Hooks](../../configuration/hooks/index.md) for the full hook reference. + +## Recipe: Root Harness Agent + +The simplest setup: a single root agent that hands everything to Claude Code. +No `models:` section, no API key — the CLI's subscription login does the work. +This is exactly the file `docker agent setup` generates for the Claude Code +harness path (as `claude-code-agent.yaml`). + +```yaml +# claude-code-agent.yaml +agents: + root: + description: Claude Code running on your Claude subscription + harness: + type: claude-code + effort: medium # low | medium | high | xhigh | max; omit for the Claude Code default + # model: claude-sonnet-4-5 # optional; omit for the Claude Code default +``` + +```bash +$ docker agent run claude-code-agent.yaml +$ docker agent doctor claude-code-agent.yaml # verify the CLI is installed and logged in +``` + +## Recipe: Orchestrator + Harness Sub-Agents (Sequential) + +An orchestrator plans the work and delegates to specialized harness agents one at a time. Each coding agent runs in its own sub-session and reports results back. + +```yaml +# examples/coding_harnesses.yaml + +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + +agents: + root: + model: claude + description: Orchestrator that plans and delegates coding tasks + instruction: | + You are a project orchestrator. Break down coding requests into + focused tasks and delegate each task to the most appropriate + coding agent. Collect results and synthesize a final summary. + sub_agents: + - claude-coder + - codex-coder + + claude-coder: + description: Claude Code specialist for complex refactors + harness: + type: claude-code + model: claude-sonnet-4-5 + effort: xhigh + + codex-coder: + description: Codex specialist for code generation + harness: + type: codex +``` + +Only the orchestrator's `model: claude` needs an Anthropic API key — the +`claude-coder` harness agent authenticates through the CLI's own subscription +login. + +The root agent calls `transfer_task` to send work to a harness sub-agent, waits for the result, and continues. See the [full example on GitHub](https://github.com/docker/docker-agent/blob/main/examples/coding_harnesses.yaml). + +## Recipe: Parallel Harness Dispatch + +Combine the `background_agents` toolset with harness sub-agents to dispatch multiple coding tasks simultaneously: + +```yaml +# examples/coding_harness_background_agents.yaml + +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + +agents: + root: + model: claude + description: Orchestrator that fans out coding tasks in parallel + instruction: | + Use background agents to run multiple coding tasks at once. + Dispatch all tasks, then collect results when each finishes. + sub_agents: + - claude-coder + - codex-coder + toolsets: + - type: background_agents + + claude-coder: + description: Frontend specialist (Claude Code) + harness: + type: claude-code + effort: medium + + codex-coder: + description: Backend specialist (Codex) + harness: + type: codex +``` + +The orchestrator calls `run_background_agent` for each task, monitors progress with `list_background_agents`, and collects results with `view_background_agent`. See the [full example on GitHub](https://github.com/docker/docker-agent/blob/main/examples/coding_harness_background_agents.yaml). + +For the general background agents reference, see [Background Agents](../../tools/background-agents/index.md). + +## See Also + +- [Multi-Agent Systems](../../concepts/multi-agent/index.md) — orchestration patterns +- [Background Agents](../../tools/background-agents/index.md) — parallel task dispatch +- [Hooks](../../configuration/hooks/index.md) — auditing and policy enforcement +- [Agent Configuration](../../configuration/agents/index.md) — full agent schema reference diff --git a/_vendor/github.com/docker/docker-agent/docs/features/mcp-mode/index.md b/_vendor/github.com/docker/docker-agent/docs/features/mcp-mode/index.md new file mode 100644 index 000000000000..9e3ae0bf69eb --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/mcp-mode/index.md @@ -0,0 +1,134 @@ +--- +title: "MCP Mode" +description: "Expose your Docker Agent agents as MCP tools for use in Claude Desktop, Claude Code, and other MCP-compatible applications." +keywords: docker agent, ai agents, features, mcp mode +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/features/mcp-mode/ +--- + +_Expose your Docker Agent agents as MCP tools for use in Claude Desktop, Claude Code, and other MCP-compatible applications._ + +## Why MCP Mode? + +The `docker agent serve mcp` command makes your agents available to any application that supports the [Model Context Protocol](https://modelcontextprotocol.io/). This means you can: + +- Use custom agents directly within **Claude Desktop** or **Claude Code** +- Share specialized agents across different applications +- Build reusable agent teams consumable from any MCP client +- Integrate domain-specific agents into existing workflows + +> [!NOTE] +> **What is MCP?** +> +> The [Model Context Protocol](https://modelcontextprotocol.io/) is an open standard for connecting AI tools. See also [Remote MCP Servers](../remote-mcp/index.md) for connecting to cloud services. + +## Basic Usage + +```bash +# Expose a local config (stdio transport, the default) +$ docker agent serve mcp ./agent.yaml + +# Expose from a registry +$ docker agent serve mcp myorg/agent:tag + +# Set the working directory +$ docker agent serve mcp ./agent.yaml --working-dir /path/to/project +``` + +## Transports + +By default, `serve mcp` uses the stdio transport — ideal for clients that spawn the server as a subprocess (Claude Desktop, Claude Code, Cursor, …). + +To expose the MCP server over streaming HTTP instead, pass `--http`: + +```bash +# Streaming HTTP transport on the default 127.0.0.1:8081 +$ docker agent serve mcp ./agent.yaml --http + +# Override the listen address / port; non-loopback HTTP requires authentication +$ docker agent serve mcp ./agent.yaml --http --listen 0.0.0.0:9090 --auth-token "$MCP_BEARER_TOKEN" +``` + +| Flag | Default | Description | +| ---------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------ | +| `--http` | `false` | Use streaming HTTP transport instead of stdio. | +| `-l`, `--listen` | `127.0.0.1:8081` | Address to listen on when `--http` is enabled. | +| `-a`, `--agent` | all agents | Expose a single named agent instead of every agent in the config. | +| `--tool-name` | (none) | Override the MCP tool identifier clients call (defaults to agent name); only valid when exposing one agent. | +| `--auth-token` | (none) | Require this Bearer token for HTTP requests. Required for non-loopback HTTP unless explicitly overridden. | +| `--insecure-no-auth` | `false` | Permit unauthenticated non-loopback HTTP. Use only behind a trusted authentication boundary. | +| `--safety` | `restricted` | Tool safety policy for HTTP requests. CLI value overrides agent/runtime configuration. | +| `--mcp-keepalive` | `0` | Interval between MCP keep-alive pings (e.g. `30s`); `0` disables keep-alive. | + +Runtime configuration flags such as `--working-dir`, `--env-from-file`, `--models-gateway`, and hook flags are also available — see the [CLI reference](../cli/index.md). + +## HTTP security + +HTTP MCP defaults to loopback binding. A non-loopback `--listen` address requires `--auth-token`; use `--insecure-no-auth` only when a trusted reverse proxy or network boundary authenticates clients. The safety policy is resolved in this order: `--safety`, agent configuration, runtime configuration, then `restricted`. These HTTP-only flags do not affect stdio or `--attach` operation. + +## Using with Claude Desktop + +Add a configuration to your Claude Desktop MCP settings file: + +- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json` +- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json` + +```json +{ + "mcpServers": { + "myagent": { + "command": "/usr/local/bin/docker", + "args": [ + "agent", + "serve", + "mcp", + "myorg/coder", + "--working-dir", + "/home/user/projects" + ], + "env": { + "ANTHROPIC_API_KEY": "your_key_here", + "OPENAI_API_KEY": "your_key_here" + } + } + } +} +``` + +Restart Claude Desktop after updating the configuration. + +## Using with Claude Code + +```bash +$ claude mcp add --transport stdio myagent \ + --env OPENAI_API_KEY=$OPENAI_API_KEY \ + --env ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \ + -- docker agent serve mcp myorg/agent:tag --working-dir $(pwd) +``` + +## Multi-Agent in MCP Mode + +When you expose a multi-agent configuration via MCP, each agent becomes a separate tool in the MCP client: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Main coordinator + sub_agents: [designer, engineer] + designer: + model: openai/gpt-5-mini + description: UI/UX design specialist + engineer: + model: anthropic/claude-sonnet-4-5 + description: Software engineer +``` + +All three agents (`root`, `designer`, `engineer`) appear as separate tools in Claude Desktop or Claude Code. + +## Troubleshooting + +- **Agents not appearing:** Verify the `docker-agent` binary path and restart the MCP client +- **Permission errors:** Ensure `docker-agent` has execute permissions (`chmod +x`) +- **Missing API keys:** Pass all required keys in the `env` section +- **Working directory issues:** Verify the `--working-dir` path exists and is accessible diff --git a/_vendor/github.com/docker/docker-agent/docs/features/remote-mcp/index.md b/_vendor/github.com/docker/docker-agent/docs/features/remote-mcp/index.md new file mode 100644 index 000000000000..564233bd57c7 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/remote-mcp/index.md @@ -0,0 +1,308 @@ +--- +title: "Remote MCP Servers" +description: "Connect Docker Agent to cloud services via remote MCP servers with built-in OAuth authentication." +keywords: docker agent, ai agents, features, remote mcp servers +weight: 120 +canonical: https://docs.docker.com/ai/docker-agent/features/remote-mcp/ +--- + +_Connect Docker Agent to cloud services via remote MCP servers with built-in OAuth authentication._ + +## Overview + +Docker Agent supports connecting to remote MCP servers over **Streamable HTTP**, **SSE** (Server-Sent Events), and **Unix domain sockets**. Streamable HTTP is the current recommended transport for most hosted MCP servers. Many popular services offer MCP endpoints with OAuth — Docker Agent handles the authentication flow automatically. + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp.linear.app/mcp" + transport_type: "streamable" +``` + +## Unix Domain Sockets + +Use a `unix://` URL to connect to an MCP server listening on a local Unix socket. This is useful when running Docker Agent inside a container and exposing an MCP server from the host via a bind-mounted socket: + +```yaml +toolsets: + - type: mcp + remote: + url: "unix:///tmp/mcp-notify.sock" + transport_type: "streamable" +``` + +The path after `unix://` is the absolute path to the socket file. Configured `headers` are forwarded over the socket connection. OAuth discovery is not supported for Unix socket URLs. + +> [!TIP] +> **OAuth flow** +> +> When you connect to a remote MCP server that requires OAuth, Docker Agent opens your browser automatically for authentication. Tokens are cached for subsequent sessions. + +> [!TIP] +> **Cancelling the authorization dialog** +> +> If you dismiss the OAuth authorization dialog, the request is cancelled cleanly — no repeated prompts appear. The agent will report that authorization was declined. To try again, simply re-enable the server or repeat the request that triggered the flow. + +## Configuration + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp.example.com/mcp" + transport_type: "streamable" # or "sse" for legacy servers + headers: + Authorization: "Bearer ${env.MY_TOKEN}" # resolved per request + # Optional: use only for trusted internal/private MCP or OAuth endpoints. + allow_private_ips: true +``` + +For full configuration details, see the [Tool Config](../../configuration/tools/index.md) page. + +Set `allow_private_ips: true` on a remote MCP toolset only when the MCP server or its OAuth registration/token endpoints intentionally resolve to private, loopback, or link-local addresses. The default blocks those OAuth helper requests to reduce SSRF risk. + +> [!NOTE] +> **Headers forwarded during OAuth discovery** +> +> Configured `headers` are forwarded to OAuth protected-resource-metadata discovery requests directed at the MCP server's own host — not to third-party authorization servers. This allows services like Grafana Cloud that require a routing header (e.g. `X-Grafana-URL`) on the discovery request to scope the OAuth flow correctly. Headers are never sent to a different host than the one in `remote.url`. + +> [!NOTE] +> **Per-request header template expansion** +> +> Header values in `remote.headers` support `${env.VAR}` and `${headers.NAME}` placeholders. Both are resolved on every outbound HTTP request (not just once at initialization), so short-lived credentials and forwarded caller headers always reflect the latest values: +> +> - `${env.VAR}` — reads the named environment variable. Useful for credentials stored in a secret manager that rotates them in-process. +> - `${headers.NAME}` — forwards the named header from the caller's incoming HTTP request. Only meaningful when Docker Agent is running as an API server (`docker agent serve api`) and a client passes authentication headers that the upstream MCP server also accepts. + +> [!NOTE] +> **Automatic reconnection after idle timeouts** +> +> Remote MCP connections (Streamable HTTP / SSE) automatically reconnect after the server closes an idle connection — no configuration needed. Services like Notion and Linear close idle connections periodically; Docker Agent detects the clean close and reconnects with exponential backoff. To tune reconnect behaviour or disable reconnection entirely, use the [`lifecycle` block](../../configuration/tools/index.md#toolset-lifecycle). + +> [!NOTE] +> **Automatic recovery from revoked or rotated OAuth tokens** +> +> If a remote MCP server rejects the cached token with a `401 invalid_token` error (for example, because the token was revoked or rotated server-side), Docker Agent handles the failure automatically: +> +> - **Silent refresh:** when a refresh token is available, Docker Agent silently exchanges it for a new access token and replays the request — no user interaction required. +> - **Re-authentication prompt:** when the refresh token is absent or has also expired, the toolset transitions to a "needs re-auth" state and surfaces an OAuth prompt on your next message (exactly like the first-time flow). +> +> Either way, the agent never burns 5 reconnect attempts on an auth failure — it fails fast and either refreshes silently or defers to interactive re-auth. If you want to trigger re-auth immediately without waiting for the next message, run `/toolset-restart <name>` from the TUI. + +### OAuth for servers without Dynamic Client Registration + +Most remote MCP servers that require OAuth support [Dynamic Client Registration (RFC 7591)](https://datatracker.ietf.org/doc/html/rfc7591) — no configuration is needed, Docker Agent handles the flow for you. + +For servers that do **not** support DCR, Docker Agent falls back automatically: + +1. **Interactive credential prompt**: Docker Agent presents a dialog asking for your `client_id` (required) and optionally a `client_secret`. This covers servers that require pre-registered app credentials but don't advertise them via DCR. +2. **Explicit `oauth:` block** (recommended when you know the credentials in advance): add the block described below to skip the interactive prompt and supply credentials directly in config. + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp.example.com/mcp" + transport_type: "streamable" + oauth: + clientId: "my-app-client-id" + clientSecret: "my-app-client-secret" # optional (public clients may omit) + callbackPort: 8765 # optional; picks a free port otherwise + scopes: # optional; server-specific + - read + - write +``` + +| Field | Type | Required | Description | +| -------------- | --------------- | -------- | ------------------------------------------------------------------------------------------------ | +| `clientId` | string | ✗ | OAuth client ID registered with the remote MCP server. When omitted, Docker Agent uses Dynamic Client Registration or prompts interactively. | +| `clientSecret` | string | ✗ | OAuth client secret. Requires `clientId`. Omit for public clients using PKCE. | +| `callbackPort` | integer | ✗ | Local port to receive the OAuth redirect. If omitted, Docker Agent picks a random free port. | +| `scopes` | array[string] | ✗ | Scopes to request during the authorization step. Values are server-specific. | +| `callbackRedirectURL` | string | ✗ | Custom OAuth redirect URI. Useful when the auth server requires HTTPS or a pre-registered URL. The literal placeholder `${callbackPort}` is replaced with the actual local callback port. See below. | + +Secrets should be stored in a credential helper or environment variable rather than committed — see [Secrets](../../guides/secrets/index.md) for interpolation patterns. + +> [!TIP] +> The `oauth:` block also works **without** `clientId`. Use it to pin the callback port, request specific scopes, or set a custom redirect URL while still letting Docker Agent obtain the client ID via Dynamic Client Registration (or the interactive prompt). + +### Custom redirect URI (`callbackRedirectURL`) + +Some authorization servers require the OAuth `redirect_uri` to be HTTPS or to match a URL that was pre-registered during app creation — neither of which plays nicely with a locally-bound loopback address such as `http://127.0.0.1:8765/callback`. + +To work around this, set `callbackRedirectURL` to a public URL that redirects back to the local callback server. The literal placeholder `${callbackPort}` is substituted with the actual port the local callback server is listening on (either `callbackPort` when set, or the randomly-assigned port otherwise). + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp.example.com/mcp" + transport_type: "streamable" + oauth: + clientId: "my-app-client-id" + callbackPort: 8765 + # Advertise this URL to the authorization server. The external + # service at redirect.example.com is expected to 302-redirect the + # browser to http://127.0.0.1:8765/callback preserving the query + # string (code, state, …). + callbackRedirectURL: "https://redirect.example.com/cb?port=${callbackPort}" +``` + +The local callback server still listens on the loopback interface on `callbackPort`; only the `redirect_uri` advertised to the authorization server changes. + +**Validation rules:** + +- The URL must be absolute (scheme + host) once `${callbackPort}` has been substituted. +- Only `http` and `https` schemes are accepted. +- `http` is only allowed when the host is a loopback address (`127.0.0.1`, `::1`, `localhost`); any other host must use `https` to avoid exposing the authorization `code` on the wire (RFC 8252 §7.3). + +### Unmanaged OAuth flow (server mode) + +When running `docker agent serve api` (no local browser, no callback server), the runtime delegates the OAuth dance to the connected client via an MCP elicitation. There are two sub-behaviors, selected by the `--mcp-oauth-redirect-uri` flag: + +- **`--mcp-oauth-redirect-uri=<URL>` set** (recommended for hosts like Docker Desktop): the runtime generates `state` + PKCE + (optional) Dynamic Client Registration in-process, builds the full authorize URL, and emits an elicitation whose `Meta` includes: + + | Key | Value | + | ---------------------------- | ---------------------------------------------------------------- | + | `docker-agent/type` | `"oauth_flow"` | + | `docker-agent/server_url` | The MCP server URL (for display / favicon) | + | `docker-agent/authorize_url` | The full URL the client should open in the user's browser | + | `docker-agent/state` | The `state` value the client must echo back when replying | + | `auth_server` | Issuer of the authorization server | + | `auth_server_metadata` | RFC 8414 authorization-server metadata document | + | `resource_metadata` | RFC 9728 protected-resource metadata document | + + The client opens the browser at the URL provided in the `docker-agent/authorize_url` meta field, receives the OAuth callback at whatever endpoint the configured `redirect_uri` resolves to (typically a host-controlled bouncer that 302s into a deeplink), and replies to the elicitation with `accept` and `Content = {"code": "...", "state": "..."}`. The runtime verifies the `state`, exchanges the `code` at the token endpoint (using the same `redirect_uri` for RFC 6749 §4.1.3 binding), stores the token, and replays the original MCP request with `Authorization: Bearer ...`. + +- **Flag not set** (client-driven): the runtime emits the elicitation meta below and expects the client to drive the OAuth flow itself (PKCE, DCR, token exchange) and reply with `Content = {"access_token": "...", "refresh_token": "...", ...}`: + + | Key | Value | + | ---------------------------- | ---------------------------------------------------------------- | + | `docker-agent/type` | `"oauth_flow"` | + | `docker-agent/server_url` | The MCP server URL (for display / favicon) | + | `auth_server` | Issuer of the authorization server | + | `auth_server_metadata` | RFC 8414 authorization-server metadata document | + | `resource_metadata` | RFC 9728 protected-resource metadata document | + +The client-driven `{access_token, ...}` reply shape is still accepted on the `--mcp-oauth-redirect-uri` path too: a client that prefers to do the exchange itself can ignore the `docker-agent/authorize_url`/`docker-agent/state` keys. + +A per-toolset `callbackRedirectURL` (in the YAML) overrides the runtime-wide `--mcp-oauth-redirect-uri` for that toolset. + +> [!WARNING] +> **Security note** +> +> The `POST /api/mcp-oauth/callback` route is open by default (no auth required) when `--auth-token` is unset. State values are 128-bit opaque tokens, so brute-force is infeasible, but a state value that leaks (e.g. via debug logs or a compromised host) could be exploited by an attacker to inject a code. Set `--auth-token` when `docker agent serve api` listens on a network-reachable interface. When set, `--auth-token` enforces Bearer-token authentication on all API routes including this callback endpoint. + +## Project Management & Collaboration + +| Service | URL | Transport | Description | +| ---------- | ---------------------------------- | --------- | ------------------------------------- | +| Asana | `https://mcp.asana.com/sse` | sse | Task and project management | +| Atlassian | `https://mcp.atlassian.com/v1/mcp/authv2` | streamable | Jira, Confluence integration | +| Linear | `https://mcp.linear.app/mcp` | streamable | Issue tracking and project management | +| Monday.com | `https://mcp.monday.com/sse` | sse | Work management platform | +| Intercom | `https://mcp.intercom.com/sse` | sse | Customer communication platform | + +## Development & Infrastructure + +| Service | URL | Transport | Description | +| ------------------------ | ---------------------------------------------- | ---------- | --------------------------------- | +| GitHub | `https://api.githubcopilot.com/mcp` | sse | Version control and collaboration | +| Buildkite | `https://mcp.buildkite.com/mcp` | streamable | CI/CD platform | +| Netlify | `https://netlify-mcp.netlify.app/mcp` | streamable | Web hosting and deployment | +| Vercel | `https://mcp.vercel.com/` | sse | Web deployment platform | +| Cloudflare Bindings | `https://bindings.mcp.cloudflare.com/sse` | sse | Edge computing resources | +| Cloudflare Observability | `https://observability.mcp.cloudflare.com/sse` | sse | Monitoring and analytics | +| Grafbase | `https://api.grafbase.com/mcp` | streamable | GraphQL backend platform | +| Neon | `https://mcp.neon.tech/sse` | sse | Serverless Postgres database | +| Prisma | `https://mcp.prisma.io/mcp` | streamable | Database ORM and toolkit | +| Sentry | `https://mcp.sentry.dev/sse` | sse | Error tracking and monitoring | + +## Content & Media + +| Service | URL | Transport | Description | +| ---------- | ------------------------------------------------- | ---------- | --------------------------------- | +| Canva | `https://mcp.canva.com/mcp` | streamable | Design and graphics platform | +| Miro | `https://mcp.miro.com/` | streamable | Collaborative whiteboard platform (Enterprise plan required; see [official docs](https://developers.miro.com/docs/miro-mcp)) | +| Cloudinary | `https://asset-management.mcp.cloudinary.com/sse` | sse | Media management and optimization | +| InVideo | `https://mcp.invideo.io/sse` | sse | Video creation platform | +| Webflow | `https://mcp.webflow.com/sse` | sse | Website builder and CMS | +| Wix | `https://mcp.wix.com/sse` | sse | Website builder platform | +| Notion | `https://mcp.notion.com/mcp` | streamable | Documentation and knowledge base | + +## Communication & Voice + +| Service | URL | Transport | Description | +| ----------- | ----------------------------------- | ---------- | --------------------------- | +| Fireflies | `https://api.fireflies.ai/mcp` | streamable | Meeting transcription | +| Listenetic | `https://mcp.listenetic.com/v1/mcp` | streamable | Audio intelligence platform | +| Carbonvoice | `https://mcp.carbonvoice.app` | sse | Voice communication tools | +| Telnyx | `https://api.telnyx.com/v2/mcp` | streamable | Communications platform | +| Dialer | `https://getdialer.app/sse` | sse | Phone communication tools | + +## Storage & File Management + +| Service | URL | Transport | Description | +| ------- | ----------------------------------- | --------- | ------------------------ | +| Box | `https://mcp.box.com` | sse | Cloud content management | +| Egnyte | `https://mcp-server.egnyte.com/sse` | sse | Enterprise file sharing | + +## Business & Finance + +| Service | URL | Transport | Description | +| ------------- | ----------------------------------------- | ---------- | -------------------------- | +| PayPal | `https://mcp.paypal.com/sse` | sse | Payment processing | +| Plaid | `https://api.dashboard.plaid.com/mcp/sse` | sse | Financial data integration | +| Square | `https://mcp.squareup.com/sse` | sse | Payment processing | +| Close | `https://mcp.close.com/mcp` | streamable | CRM platform | +| Dodo Payments | `https://mcp.dodopayments.com/sse` | sse | Payment processing | + +## Analytics & Data + +| Service | URL | Transport | Description | +| ----------- | --------------------------------------- | ---------- | ------------------------------ | +| ThoughtSpot | `https://agent.thoughtspot.app/mcp` | streamable | Analytics and BI platform | +| Meta Ads | `https://mcp.pipeboard.co/meta-ads-mcp` | streamable | Facebook advertising analytics | + +## Utilities & Tools + +| Service | URL | Transport | Description | +| ------------- | ---------------------------------- | ---------- | ------------------------------- | +| Apify | `https://mcp.apify.com` | sse | Web scraping and automation | +| SimpleScraper | `https://mcp.simplescraper.io/mcp` | streamable | Web scraping tool | +| GlobalPing | `https://mcp.globalping.dev/sse` | sse | Network diagnostics | +| Jam | `https://mcp.jam.dev/mcp` | streamable | Bug reporting and collaboration | + +## Example: Multi-Service Agent + +Combine multiple remote MCP servers in a single agent: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + instruction: | + You help manage projects and deployments. + toolsets: + - type: mcp + remote: + url: "https://mcp.linear.app/mcp" + transport_type: "streamable" + instruction: Use Linear for issue tracking. + - type: mcp + remote: + url: "https://api.githubcopilot.com/mcp" + transport_type: "sse" + instruction: Use GitHub for code and PRs. + - type: mcp + remote: + url: "https://mcp.vercel.com/" + transport_type: "sse" + instruction: Use Vercel for deployments. +``` + +> [!NOTE] +> **Growing list** +> +> This list is updated as more services add MCP support. If a service you use isn't listed, check their documentation — many providers are adding MCP endpoints regularly. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/sessions/index.md b/_vendor/github.com/docker/docker-agent/docs/features/sessions/index.md new file mode 100644 index 000000000000..dd264814b476 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/sessions/index.md @@ -0,0 +1,135 @@ +--- +title: "Sessions" +description: "How Docker Agent stores conversations, resumes them across runs, and tracks their token cost." +keywords: docker agent, ai agents, features, sessions +weight: 25 +canonical: https://docs.docker.com/ai/docker-agent/features/sessions/ +--- + +_How Docker Agent stores conversations, resumes them across runs, and tracks their token cost._ + +## What a Session Is + +Every `docker agent run` creates or resumes a **session**: the record of a conversation, including every message, tool call, sub-agent run, and cost. Sessions are what makes `/undo`, `/sessions`, `--session <id>`, and cost tracking possible — the agent itself is stateless between runs, but the session is not. + +A session is only persisted to disk once it has content (the first message added), so a run you cancel before sending anything never leaves an empty session behind. + +## Where Sessions Are Stored + +Sessions live in a SQLite database, `session.db`, under the [data directory](../cli/index.md#global-flags) (`~/.cagent` by default): + +```bash +$ ls ~/.cagent/session.db +``` + +Override the location with `-s`/`--session-db`, or by overriding the data directory itself with `--data-dir`: + +```bash +# Use a project-local session database instead of the global one +$ docker agent run agent.yaml --session-db ./sessions.db +``` + +## Resuming a Session + +Pass `--session <id>` to continue a previous conversation instead of starting a new one: + +```bash +# Resume by explicit session ID +$ docker agent run agent.yaml --session 3f9c1e2a-... + +# Resume the most recently created session +$ docker agent run agent.yaml --session -1 + +# Resume the session created before that one +$ docker agent run agent.yaml --session -2 +``` + +`--session` accepts two kinds of reference: + +- **A relative offset** (`-1`, `-2`, …): sessions are ordered by **creation time**, newest first — `-1` is the most recently *created* session, `-2` the one created before it, and so on. This is creation order, not last-used order: resuming an older session with `--session <id>` does not make it the new `-1`; the next `-1` still resolves to whichever session was created most recently. A relative offset that has no matching session (for example `-1` with an empty database) is an error. +- **An explicit ID**: if a session with that ID already exists, it is resumed. If it doesn't exist yet, docker agent **creates it with that ID** instead of failing. This lets a supervisor (for example a board or a script) choose a session ID up front and reuse it across runs — the first run creates the session, later runs resume it. + +## Read-Only Sessions + +Add `--session-read-only` to open a session for viewing without sending new messages — useful for reviewing a past conversation without accidentally continuing it: + +```bash +$ docker agent run agent.yaml --session -1 --session-read-only +``` + +`--session-read-only` requires the TUI: it cannot be combined with `--exec`, since there would be nothing to display without one. + +## Browsing Sessions in the TUI + +Press `/sessions` to open the session browser: search and filter past conversations, see which ones were started in the current working directory ("This workspace") versus elsewhere ("Other locations"), and restore one with <kbd>Enter</kbd>. Restoring a session reopens it in its original working directory. See [Session Management](../tui/index.md#session-management) in the Terminal UI docs for the full set of session-browser and session-title features (starring, branching by editing a past message, and so on). + +### Tabs + +<kbd>Ctrl</kbd>+<kbd>T</kbd> opens a new tab running an additional agent session alongside the current one; <kbd>Ctrl</kbd>+<kbd>N</kbd>/<kbd>Ctrl</kbd>+<kbd>P</kbd> cycle between tabs and <kbd>Ctrl</kbd>+<kbd>W</kbd> closes the current one. By default, tabs are not restored the next time you launch the TUI. Set `restore_tabs: true` in your user config to reopen the same tabs (and their sessions) on the next launch: + +```yaml +# ~/.config/cagent/config.yaml +settings: + restore_tabs: true +``` + +## Session Titles + +Docker Agent auto-generates a short title for each session from your first message, using a one-shot call to the agent's own model. Point that call at a smaller, cheaper model instead with `title_model` on a model definition: + +```yaml +# examples/title_model.yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + # Generate session titles with the cheaper Haiku model instead of Sonnet. + title_model: fast + fast: + provider: anthropic + model: claude-haiku-4-5 + +agents: + root: + model: primary + description: An assistant that generates session titles with a cheaper model. + instruction: You are a helpful assistant. +``` + +When `title_model` is omitted, title generation reuses the agent's own model. Set or regenerate a title from inside the TUI with `/title` (see [Session Title Editing](../tui/index.md#session-title-editing)) — regenerating sends every user message in the session so far, not just the first — or generate one from the command line without starting a session at all: + +```bash +$ docker agent debug title agent.yaml "How do I configure a fallback model?" +``` + +See [`docker agent debug title`](../cli/index.md#docker-agent-debug) for details. + +## Usage & Cost Tracking + +Every tracked model call — the main conversation turns and compaction calls — updates the session's cumulative input/output token counts and cost. Check them at any time with `/cost` in the TUI, or disable tracking per-model with `track_usage: false` if you don't want a model's calls counted (for example, a free local model). Auxiliary one-shot calls the runtime makes on your behalf, such as automatic session-title generation, call the model directly and are not folded into this total. + +Cost is computed from the [models.dev](https://models.dev/) pricing catalogue by default. For a custom endpoint, a private deployment, or a negotiated enterprise rate the catalogue doesn't know about, declare pricing explicitly with a model's `cost:` block: + +```yaml +# examples/custom-pricing.yaml +models: + internal-gpt: + provider: internal-llm + model: gpt-4o + cost: + input: 1.25 # USD per 1M input tokens + output: 5.00 # USD per 1M output tokens + cache_read: 0.125 # USD per 1M cached input tokens + cache_write: 1.5625 # USD per 1M cache-write tokens +``` + +An all-zero `cost:` table means "priced, free" — distinct from a model with no `cost:` at all, which falls back to the catalogue (and bills $0 for models the catalogue doesn't know). + +> [!NOTE] +> **Cost never decreases** +> +> A session's cumulative cost is a running total updated after every *tracked* model call — the same main conversation turns and compaction calls described above. Compacting the conversation (manually with `/compact`, or automatically — see the agent's `session_compaction`/`compaction_threshold` fields in the [Agent Config reference](../../configuration/agents/index.md)) reshapes the message history sent back to the model, but never touches this running total. Auxiliary one-shot calls such as automatic session-title generation are not tracked and are not reflected in this total: `/cost` covers everything the session's tracked calls have spent, not literally every model call the runtime makes on your behalf. + +## Resuming Into a Worktree + +A session created during a `--worktree` run remembers which worktree it used. Resuming it with `--session` reattaches to the same worktree directory and branch automatically — you don't need to pass `--worktree` again. See [`--worktree`](../cli/index.md#docker-agent-run) in the CLI reference for the full worktree lifecycle. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/skills/index.md b/_vendor/github.com/docker/docker-agent/docs/features/skills/index.md new file mode 100644 index 000000000000..bba760387a0a --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/skills/index.md @@ -0,0 +1,378 @@ +--- +title: "Skills" +description: "Skills provide specialized instructions that agents can load on demand when a task matches a skill's description." +keywords: docker agent, ai agents, features, skills +weight: 110 +canonical: https://docs.docker.com/ai/docker-agent/features/skills/ +--- + +_Skills provide specialized instructions that agents can load on demand when a task matches a skill's description._ + +## How Skills Work + +1. Docker Agent scans standard directories for `SKILL.md` files +2. Skill metadata (name, description) is injected into the agent's system prompt +3. When a user request matches a skill, the agent reads the full instructions +4. The agent follows the skill's detailed instructions to complete the task + +## Enabling Skills + +```yaml +agents: + root: + model: openai/gpt-4o + instruction: You are a helpful assistant. + skills: true + toolsets: + - type: filesystem # required for reading skill files +``` + +> [!TIP] +> Skills are perfect for encoding team-specific workflows (PR review, deployment, coding standards) that apply across projects. + +## Filtering Skills + +The `skills` field also accepts a list, letting you restrict the agent to a specific subset of skills instead of exposing every discovered one. List items are classified automatically: + +- `"local"` or any `http://` / `https://` URL → a **source** to load skills from +- any other string → the **name** of a skill to include + +When only names are given, local sources are used by default. + +```yaml +agents: + # Load every discovered local skill (same as `skills: true`). + full: + skills: true + + # Load local skills, but only expose "commit" and "poem". + scoped: + skills: + - commit + - poem + + # Combine an explicit source with a name filter. + remote_filtered: + skills: + - https://skills.example.com + - commit + + # Disable skills entirely. + none: + skills: false +``` + +A name that doesn't match any discovered skill is logged as a warning at startup but is otherwise ignored. + +## Inline Skills + +Instead of (or alongside) loading skills from files and URLs, you can define skills directly in the agent config. An inline skill is a mapping item in the `skills` list, freely mixed with the string items above: + +```yaml +agents: + root: + model: openai/gpt-4o + instruction: You are a helpful assistant. + skills: + - name: changelog + description: Write a concise changelog entry from a diff or description. + instructions: | + Produce a single changelog entry in Keep a Changelog style. + Pick the right category (Added, Changed, Fixed, Removed) and write + one imperative sentence summarising the user-visible change. + + # A fork-mode inline skill runs in an isolated sub-agent. + - name: triage + description: Triage a bug report in an isolated context. + context: fork + instructions: | + Restate the problem, list likely root causes most-probable-first, + and propose the smallest reproduction and next concrete action. + + # Inline skills mix freely with sources and name filters. + - local + toolsets: + - type: filesystem +``` + +Inline skills carry their body in the config itself, so they need no `SKILL.md` file and require no filesystem source. They are **always exposed** — the name filter only applies to file- and URL-based skills. Because inline skills travel inside the agent YAML, they also work in `--sandbox` mode without any kit staging, and they can be shared with the agent via `share push`. + +### Inline Skill Fields + +| Field | Required | Description | +| --------------- | -------- | -------------------------------------------------------------------------- | +| `name` | Yes | Skill identifier used by `read_skill` / `run_skill` and the `/<name>` command | +| `description` | Yes | Short description shown to the agent for skill matching | +| `instructions` | Yes | The skill body (what a `SKILL.md` would contain below its frontmatter) | +| `context` | No | Set to `fork` to run the skill as an isolated sub-agent | +| `model` | No | Override the model used while running a fork-mode skill | +| `allowed_tools` | No | For a fork-mode skill, restricts the sub-session to the parent tools whose names match an entry (glob or exact). See [Scoping a fork skill's tools](#scoping-a-fork-skills-tools). | +| `toolsets` | No | For a fork-mode skill, names of top-level [`toolsets`](../../configuration/overview/index.md#reusable-toolsets-toolsets) to expose in the sub-session on top of the inherited tools. | + +> [!NOTE] +> **Inline vs. file-based skills** +> +> Inline skills support the subset of the SKILL.md format that fits in YAML. They cannot bundle supporting files (no `read_skill_file`) or use `` !`command` `` expansion. For skills that need bundled resources or executable helpers, use a `SKILL.md` directory instead. + +## SKILL.md Format + +<!-- yaml-lint:skip --> +```yaml +--- +name: create-dockerfile +description: Create optimized Dockerfiles for applications +license: Apache-2.0 +metadata: + author: my-org + version: "1.0" +--- + +# Creating Dockerfiles + +When asked to create a Dockerfile: + +1. Analyze the application type and language +2. Use multi-stage builds for compiled languages +3. Minimize image size by using slim base images +4. Follow security best practices (non-root user, etc.) +``` + +### Frontmatter Fields + +| Field | Required | Description | +| ---------------- | -------- | --------------------------------------------------------------------------- | +| `name` | Yes | Unique skill identifier | +| `description` | Yes | Short description shown to the agent for skill matching | +| `context` | No | Set to `fork` to run the skill as an isolated sub-agent (see below) | +| `model` | No | Override the model used while running the skill as a sub-agent (fork only) | +| `allowed-tools` | No | For a fork-mode skill, restricts the sub-session to the parent tools whose names match an entry (YAML list or comma-separated string). See [Scoping a fork skill's tools](#scoping-a-fork-skills-tools). | +| `toolsets` | No | For a fork-mode skill, names of top-level [`toolsets`](../../configuration/overview/index.md#reusable-toolsets-toolsets) to expose in the sub-session (YAML list or comma-separated string). | +| `license` | No | License identifier (e.g. `Apache-2.0`) | +| `compatibility` | No | Free-text compatibility notes | +| `metadata` | No | Arbitrary key-value pairs (e.g. `author`, `version`) | + +## Running a Skill as a Sub-Agent + +By default, when an agent invokes a skill it reads the instructions inline into its own conversation. For complex, multi-step skills this can consume a large portion of the agent's context window and pollute the parent conversation with intermediate tool calls. + +Adding `context: fork` to the SKILL.md frontmatter tells the agent to run the skill in an **isolated sub-agent** instead: + +<!-- yaml-lint:skip --> +```yaml +--- +name: bump-go-dependencies +description: Update Go module dependencies one by one +context: fork +--- + +# Bump Dependencies + +1. List outdated deps +2. Update each one, run tests, commit or revert +3. Produce a summary table +``` + +When the agent encounters a task that matches a `context: fork` skill, it uses the `run_skill` tool instead of `read_skill`. This: + +- **Spawns a child session** with the skill content as the system prompt and the caller's task as the user message +- **Isolates the context window** — the sub-agent has its own conversation history, so lengthy tool-call chains don't eat into the parent's token budget +- **Folds the result** — only the sub-agent's final answer is returned to the parent as the tool result +- **Inherits the parent's model and tools** — the sub-agent can use all tools available to the parent agent (scope this with `allowed_tools` / `toolsets`, see [Scoping a fork skill's tools](#scoping-a-fork-skills-tools)) + +> [!TIP] +> **When to use context: fork** +> +> Use `context: fork` for skills that involve many steps, heavy tool usage, or that should not clutter the main conversation — for example dependency bumping, large refactors, or code generation pipelines. + +### Overriding the model for a fork skill + +Fork skills can declare a `model` field in their frontmatter to use a +different model than the parent agent for the duration of the sub-session. +This is useful when a skill is best handled by a faster, cheaper, or more +specialised model — for example a powerful reasoning model for refactors, +or a fast model for routine bookkeeping work. The override only applies +while the skill is running; the parent agent keeps its own model. + +The `model` value accepts either a named model from the agent config or +an inline `provider/model` reference (and the same comma-separated alloy +syntax as the rest of the agent config): + +<!-- yaml-lint:skip --> +```yaml +--- +name: bump-go-dependencies +description: Update Go module dependencies one by one +context: fork +model: openai/gpt-4o-mini +--- + +# Bump Dependencies + +1. ... +``` + +If the model reference cannot be resolved (unknown name, missing +credentials, runtime not configured for model switching, …) the skill +falls back to the agent's currently-active model (its configured +default, or any override the user previously set via the model picker) +and a warning is logged. + +When the skill completes, the agent's previous model is restored — but +only if no one else changed the model in the meantime. If the user +switches the model via the TUI model picker while the fork skill is +running, their choice is preserved (the deferred restore becomes a +no-op). + +### Scoping a fork skill's tools + +By default a fork skill inherits the parent agent's entire tool set. Two +optional fields let you scope what the sub-session can use. Both apply +**only to fork-mode skills** and work the same whether the skill is +inline or loaded from a `SKILL.md` file. + +`allowed_tools` (frontmatter: `allowed-tools`) is an **allow-list** over +the inherited tools: only tools whose names match an entry are kept, +everything else is hidden from the sub-session. Entries support glob +patterns (e.g. `read_*`) and otherwise match exactly. This is the +Claude-Code-compatible `allowed-tools` field, now enforced for fork +skills rather than merely recorded. + +`toolsets` references reusable [top-level toolsets](../../configuration/overview/index.md#reusable-toolsets-toolsets) +by name. The referenced toolsets are exposed in the sub-session **in +addition to** the inherited tools, and they bypass the `allowed_tools` +filter (the skill explicitly asked for them). + +```yaml +toolsets: + web: + type: fetch + +agents: + root: + model: openai/gpt-4o + instruction: You are a helpful assistant. + toolsets: + - type: filesystem + - type: shell + skills: + # Inherits the parent tools but is restricted to read-only filesystem + # access while it runs — shell and write tools are hidden. + - name: audit + description: Review the repository layout without modifying anything. + context: fork + allowed_tools: + - read_file + - list_directory + - directory_tree + instructions: Inspect the repository structure and summarise it. + + # Brings in the top-level `web` toolset on top of the parent's tools. + - name: research + description: Research a topic using web fetches in an isolated context. + context: fork + toolsets: + - web + instructions: Research the requested topic and summarise with links. +``` + +The equivalent in a `SKILL.md` file uses frontmatter lists: + +<!-- yaml-lint:skip --> +```yaml +--- +name: research +description: Research a topic using web fetches +context: fork +allowed-tools: + - fetch +toolsets: + - web +--- +``` + +> [!NOTE] +> **Fork only** +> +> Both fields are rejected by config validation when set on a non-fork skill, and a `toolsets` entry that doesn't resolve to a top-level toolset is a load-time error. + +## Search Paths + +Skills are discovered from these locations (later overrides earlier): + +### Global + +| Path | Search Type | +| ------------------- | --------------------------------------- | +| `~/.codex/skills/` | Recursive (searches all subdirectories) | +| `~/.claude/skills/` | Flat (immediate children only) | +| `~/.agents/skills/` | Recursive (searches all subdirectories) | + +### Project (from git root to current directory) + +| Path | Search Type | +| ----------------- | ------------------------------------------ | +| `.claude/skills/` | Flat (cwd only) | +| `.github/skills/` | Flat (each directory from git root to cwd) | +| `.agents/skills/` | Flat (each directory from git root to cwd) | + +## Invoking Skills + +Skills can be invoked in multiple ways: + +- **Automatic:** The agent detects when your request matches a skill's description and loads it automatically +- **Explicit:** Reference the skill name in your prompt: "Use the create-dockerfile skill to..." +- **Slash command:** Use `/{skill-name}` to invoke a skill directly + +```bash +# In the TUI, invoke skill directly: +/create-dockerfile + +# Or mention it in your message: +"Create a dockerfile for my Python app (use the create-dockerfile skill)" +``` + +## Precedence + +When multiple skills share the same name: + +1. Global skills load first +2. Project skills load next, from git root toward current directory +3. Skills closer to the current directory override those further away +4. At the same directory level, `.agents/skills/` overrides `.github/skills/` + +## Skills in Sandbox Mode + +When you run an agent with [`--sandbox`](../../configuration/sandbox/index.md), the sandbox VM has its own filesystem with no access to your host's skill directories. Docker Agent handles this transparently via the [auto-kit](../../configuration/sandbox/index.md#auto-kit): every discovered local skill is staged into a per-agent kit on the host, run through best-effort secret redaction (see the [auto-kit](../../configuration/sandbox/index.md#secret-redaction) docs), and bind-mounted read-only into the sandbox so the agent sees the same skills inside the VM as on the host. No configuration is required — use `--no-kit` only if you explicitly want to run the sandbox without any host skills. + +## Creating a Skill + +```bash +# Create the skill directory +$ mkdir -p ~/.agents/skills/create-dockerfile + +# Write the SKILL.md file +$ cat > ~/.agents/skills/create-dockerfile/SKILL.md << 'EOF' +--- +name: create-dockerfile +description: Create optimized Dockerfiles for applications +--- + +# Creating Dockerfiles + +When asked to create a Dockerfile: + +1. Analyze the application type and language +2. Use multi-stage builds for compiled languages +3. Use slim base images to minimize size +4. Run as non-root user for security +EOF +``` + +The skill will automatically be available to any agent with skills enabled (`skills: true`, or a list that targets its name — see [Filtering Skills](#filtering-skills)). + +> [!NOTE] +> **See also** +> +> Skills are enabled in the [Agent Config](../../configuration/agents/index.md) with the `skills` property (boolean or list). For tool-based capabilities, see [Tools](../../concepts/tools/index.md). +> +> Example configs: [`examples/skills_inline.yaml`](https://github.com/docker/docker-agent/blob/main/examples/skills_inline.yaml) (inline skill definition), [`examples/skills_fork_toolsets.yaml`](https://github.com/docker/docker-agent/blob/main/examples/skills_fork_toolsets.yaml) (scoping a fork skill's tools), [`examples/skills_filter.yaml`](https://github.com/docker/docker-agent/blob/main/examples/skills_filter.yaml) (filtering which skills load). diff --git a/_vendor/github.com/docker/docker-agent/docs/features/snapshots/index.md b/_vendor/github.com/docker/docker-agent/docs/features/snapshots/index.md new file mode 100644 index 000000000000..bc624bf89123 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/snapshots/index.md @@ -0,0 +1,112 @@ +--- +title: "Snapshots" +description: "Shadow-git snapshots capture your workspace at turn boundaries so you can review what an agent changed and undo it without touching your real git history." +keywords: docker agent, ai agents, features, snapshots +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/features/snapshots/ +--- + +_Shadow-git snapshots capture your workspace at turn boundaries so you can review what an agent changed and undo it without touching your real git history._ + +## Overview + +When snapshots are enabled, Docker Agent records the state of your working +directory as the agent runs. Each checkpoint is stored in a **shadow git +repository** kept under the Docker Agent data directory — completely separate +from your project's own `.git`. This lets you: + +- **Review** exactly which files an agent touched on a given turn. +- **Undo** the most recent change with `/undo`. +- **Reset** the workspace back to any earlier checkpoint — or all the way to + its pre-agent state. + +Snapshots only ever touch files on disk. They never write commits to your +repository, never move your `HEAD`, and never appear in `git log` or +`git status`. + +> [!NOTE] +> **Git repositories only** +> +> The snapshot machinery is a no-op outside a git worktree. It needs a git +> repository to scope which files belong to your project and to mirror the +> repository's ignore rules. + +## Enabling Snapshots + +The simplest way is to enable snapshots globally for every agent in your user +config: + +```yaml +# ~/.config/cagent/config.yaml +settings: + snapshot: true +``` + +Omit `snapshot` or set it to `false` to leave automatic snapshots off. + +You can also wire the [`snapshot` built-in hook](../../configuration/hooks/index.md#available-built-ins) +into a single agent instead of enabling it globally: + +```yaml +hooks: + turn_start: + - type: builtin + command: snapshot + turn_end: + - type: builtin + command: snapshot + session_end: + - type: builtin + command: snapshot +``` + +Manually configured snapshot hooks always run, even when `settings.snapshot` +is unset. See [`examples/snapshot_hooks.yaml`](https://github.com/docker/docker-agent/blob/main/examples/snapshot_hooks.yaml) +for a complete configuration. + +## Using Snapshots in the TUI + +When snapshots are enabled, the [TUI](../tui/index.md) +exposes two slash commands: + +- **`/undo`** restores files from the most recent snapshot (one step back). +- **`/snapshots`** opens a dialog listing every captured snapshot and the + number of files in each. Use <kbd>↑</kbd>/<kbd>↓</kbd> (or + <kbd>j</kbd>/<kbd>k</kbd>) to highlight an entry, then press <kbd>r</kbd> to + reset the workspace to that point. Pick `<original>` to revert every snapshot + and bring the workspace back to its pre-agent state. <kbd>Esc</kbd> closes the + dialog without changing anything. + +Neither command removes messages from the session transcript — they only touch +files on disk. Both commands (and their command-palette entries) are hidden +when snapshots are turned off. + +## How It Works + +- **Shadow repository.** The first time a snapshot is taken for a worktree, + Docker Agent initializes a separate shadow git directory under the data + directory (`~/.cagent/snapshot/...` by default), keyed by a hash of the + worktree path. The shadow repo stores tree objects only — it never writes + commits and never touches your source repository's `.git`. +- **Ignore rules are mirrored.** Before each capture, the source repository's + `.gitignore` and `info/exclude` rules are mirrored into the shadow repo so + ignored files never appear in snapshots. +- **Large files are skipped.** Newly-added files larger than 2 MiB are excluded + from snapshots to keep the shadow repo small. +- **Checkpoints only on change.** A checkpoint is recorded only when files + actually changed, so a final no-op model response does not hide the last + meaningful snapshot. +- **Scoped to the working directory.** Snapshot operations are scoped to the + agent's working directory within the worktree, so a sub-directory agent only + captures and restores files under that directory. +- **Garbage collection.** Wiring `snapshot` into `session_end` (or enabling it + globally) runs `git gc` against the shadow repo so old, unreferenced objects + are pruned over time. + +## See Also + +- [Hooks](../../configuration/hooks/index.md) — the `snapshot` + built-in and the events it can run on. +- [Terminal UI](../tui/index.md) — the `/undo` and + `/snapshots` commands. +- [`examples/snapshot_hooks.yaml`](https://github.com/docker/docker-agent/blob/main/examples/snapshot_hooks.yaml) — a complete snapshot hook configuration. diff --git a/_vendor/github.com/docker/docker-agent/docs/features/tui/index.md b/_vendor/github.com/docker/docker-agent/docs/features/tui/index.md new file mode 100644 index 000000000000..5a06b6ebbc88 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/features/tui/index.md @@ -0,0 +1,591 @@ +--- +title: "Terminal UI (TUI)" +description: "Docker Agent's default interface is a rich, interactive terminal UI with file attachments, themes, session management, and more." +keywords: docker agent, ai agents, features, terminal ui (tui) +linkTitle: "Terminal UI" +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/features/tui/ +--- + +_Docker Agent's default interface is a rich, interactive terminal UI with file attachments, themes, session management, and more._ + +![Docker Agent TUI in action showing an interactive agent session](../../demo.gif) + +## Launching the TUI + +Both the full TUI and the lean TUI display a centered ASCII art Docker Agent banner on startup when the chat is empty. The banner is automatically hidden once the agent starts responding or when a custom welcome message is configured. + +```bash +# Launch with a config +$ docker agent run agent.yaml + +# Start with an initial message +$ docker agent run agent.yaml "Help me refactor this code" + +# Auto-approve all tool calls +$ docker agent run agent.yaml --yolo + +# Enable debug logging +$ docker agent run agent.yaml --debug + +# Override the application name shown in the status bar and window title +$ docker agent run agent.yaml --app-name "My Project" + +# Preselect a color theme +$ docker agent run agent.yaml --theme dracula + +# Hide the sidebar (cannot be re-enabled via Ctrl+B) +$ docker agent run agent.yaml --sidebar=false + +# Disable specific slash commands +$ docker agent run agent.yaml --disable-commands="/cost,/eval,/model" + +# Open in read-only mode to review a past session without sending new messages +$ docker agent run agent.yaml --session -1 --session-read-only + +# Use the lean TUI for this run +$ docker agent run agent.yaml --lean +``` + +### Lean TUI + +The lean TUI uses a simplified terminal interface with minimal chrome. To make it the default for interactive runs, set `lean` in your user config: + +```yaml +# ~/.config/cagent/config.yaml +settings: + lean: true +``` + +Omit `lean` or set it to `false` to keep the full TUI as the default. You can still use `--lean` for a single run, or `--lean=false` to use the full TUI when `settings.lean` is enabled. See [User Settings](../../configuration/user-settings/index.md) for the full precedence rules between flags and user config. + +The lean TUI supports **steering** and **follow-ups** while the agent is running. Press <kbd>Enter</kbd> to steer the active turn, or <kbd>Alt</kbd>+<kbd>Enter</kbd> to queue the message as a separate turn after the current one finishes. Pending messages appear with muted styling at the end of the live stream. + +The lean TUI supports a focused set of slash commands: `/new`, `/compact`, `/model`, `/effort`, `/clear`, `/help`, `/exit` (alias: `/quit`), plus any agent-defined commands. Type `/model` (or `/model <provider/model>`) to switch the active model inline — the command opens a fuzzy-searchable list of available models. + +## Slash Commands + +Type `/` during a session to see available commands, or press <kbd>Ctrl</kbd>+<kbd>K</kbd> for the command palette: + +| Command | Description | +| ------------------ | ------------------------------------------------------------------------------------ | +| `/new` | Start a new conversation | +| `/clear` | Clear the current conversation (keep session, drop messages) | +| `/compact` | Summarize and compact the conversation history | +| `/fork` | Fork the current session into a new branch | +| `/copy` | Copy the entire conversation to clipboard | +| `/copy-last` | Copy only the last assistant message to clipboard | +| `/undo` | Restore file changes from the latest snapshot (only when snapshots are enabled) | +| `/snapshots` | List captured snapshots (only when snapshots are enabled) | +| `/export` | Export the session as HTML | +| `/sessions` | Browse and load past sessions | +| `/plans` | Browse and manage plans: every [shared plan](../../tools/plan/index.md) plus the current session's [session plan](../../tools/session_plan/index.md). Filter, open a detail view, refresh, export to a file, and — for shared plans — set status, edit/create in `$VISUAL`/`$EDITOR`, and delete, all guarded against concurrent edits. Not available in the lean TUI | +| `/model` | Change the model for the current agent | +| `/effort` | Set the current model's reasoning-effort level (`/effort <none\|minimal\|low\|medium\|high\|xhigh\|max>`, or `/effort` alone to pick from the supported levels; reasoning models only). Press <kbd>Tab</kbd> after `/effort` and a space to complete a level the current model supports | +| `/settings` | Manage appearance, behavior, and notification preferences | +| `/yolo` | Toggle automatic tool call approval | +| `/title` | Set or regenerate session title | +| `/attach` | Attach a file to your message | +| `/shell` | Open a shell | +| `/star` | Star/unstar the current session | +| `/context` | Show a context-window breakdown: estimated tokens per category (system prompt, tool definitions, prompt files, messages, tool results, compaction summary), a team-level **Live sessions** view (the current session plus every running sub-agent session with its agent, short session ID, and context budget), plus a per-file inventory of attached files and prompt files. When a compaction has occurred, the dialog also displays the verbatim text of the most recent compaction summary. When a dedicated `compaction_model` caps the effective limit below the primary model's own window, a second line reads "compaction cap: `<model>` • `<N>` tokens" — Live-sessions rows are silent on the cap, and the sidebar shows a minimal ⚠ capped marker without repeating the model or the figure (the `/context` header is the authoritative source of the model + number). Use the arrow keys to select a row: press <kbd>Enter</kbd> on a live session to explicitly compact it, or <kbd>d</kbd> on an attached file to drop it | +| `/drop` | Remove an attached file from the session context (`/drop <path>`, or `/drop` alone to review and drop from the `/context` dialog). Press <kbd>Tab</kbd> after `/drop` and a space to complete an attached file's path | +| `/cost` | Show cost breakdown for this session. Includes a **By Agent** section (alongside **By Model**) showing cumulative cost per agent; unattributed usage and compaction spend appear in their own buckets. | +| `/eval` | Create an evaluation report | +| `/pause` | Pause/resume the runtime loop. While the agent is mid-request, the resize handle shows "Pausing…" until the in-flight request completes; once the loop is blocked the indicator changes to "⏸ Paused". Run `/pause` again to resume. | +| `/tools` | Show every toolset (with lifecycle state) and the tools they expose | +| `/skills` | List skills available to the current agent | +| `/toolset-restart` | Force a supervisor-driven reconnect of the named toolset (`/toolset-restart <name>`). Press <kbd>Tab</kbd> after `/toolset-restart` and a space to complete a toolset name; non-restartable toolsets are shown dimmed and cannot be selected. | +| `/permissions` | Inspect and edit tool permission rules | +| `/speak` | Voice input via system speech-to-text (macOS only) | +| `/exit` | Exit the application (aliases: `/quit`, `/q`) | + +Slash commands (both built-in and named) execute immediately when entered. Regular chat messages sent while the agent is working are steered into the ongoing stream by default: the agent picks them up mid-turn (they appear in the transcript at the point the agent sees them) without breaking the stream. Prefer the previous end-of-turn behavior? Switch **While agent is working** to `Queue` on the **Behavior** tab of `/settings`; queued messages are processed in order once the stream stops. + +Agent-defined commands (prompts, URL links, agent-switching shortcuts) are configured under `commands:` in the agent YAML — see [Custom Commands](../../configuration/commands/index.md) for the full reference, including how to hide commands with `--disable-commands`. + +### Agents Panel + +The sidebar's **Agents** section lists every agent in the team and has two display modes selectable via **Sidebar info mode** in `/settings`: + +- **Compact** (default) — The current agent is shown as a focus **card** (rendered in place at its position in the list) with its name, a wrapped description, its full `provider/model`, and a thinking line. Every other agent is shown as a compact **two-line row** — line 1 is the shortcut/spinner, the agent name (in its accent color), and a right-aligned thinking **gauge**; line 2 is the indented full `provider/model` and, once the agent has run, its latest **context usage** as a right-aligned percentage of its context window. +- **Detailed** — Each agent is shown as a responsive card with labeled **Effort**, **Context**, and **Cost** metrics on a single line (or split across lines at narrow sidebar widths), making cumulative per-agent cost visible at a glance across the team. + +Agents are separated by a blank line so rows stay visually distinct. The effort **gauge** is the only visual language for thinking; the focus card and the Agent Inspector spell out the exact level alongside it. Left-click any agent to switch to it. + +On large teams the roster can be trimmed to the agents that matter right now: enable **Active agents only** (nested under **Agents** in `/settings` → Appearance → Sidebar sections, off by default) to list only agents active in the current session — the selected or working agent, participants of an in-flight transfer, and any agent with recorded participation (usage or attributed cost, including agents restored with a reloaded session). The filter also applies to the top/bottom band, is purely presentational — <kbd>Ctrl</kbd>+<kbd>number</kbd> shortcuts keep their original team positions and agent cycling still walks the whole team — and is unavailable while the Agents section itself is hidden. + +#### Agent inspector + +Open a read-only **Agent Inspector** to inspect any agent's full configuration combined with its live state. The instruction/system prompt is deliberately omitted; everything else the agent declares is shown: + +- **Right-click any agent** (card or row) to open the inspector without switching to it. +- **<kbd>Ctrl</kbd>+left-click any agent** does the same — a fallback for terminals that don't forward right-clicks. +- **Left-click** always switches to the agent. + +The title is rendered in the agent's accent color. Sections appear in this order, and any empty section is omitted: + +- **Description** — the agent's wrapped description. +- **Live state** — a `● current agent` line when the inspected agent is the one currently running. +- **Model / Fallback / Thinking** — the `provider/model`, any fallback models, and the gauge + value thinking line (omitted for models with no selectable thinking, e.g. harness-backed agents). +- **Context** — the agent's latest known context usage, e.g. `Context: 12.8K of 128.0K tokens (10%)` (a bare token count when the context limit is unknown; omitted until the agent has run). Sub-agent and background-agent runs are accounted for. When a dedicated `compaction_model` caps the effective limit below the primary model's own window, the token-usage line also shows a short "⚠ capped" marker (see `/context` for the model and figure). +- **Cost** — the agent's cumulative cost across all runs in the session tree. Repeated session snapshots are not double-counted. Omitted until the agent has run. +- **Sub-agents (N) / Handoffs (N) / Skills (N)** — compact, inline, comma-separated lists wrapped to the dialog width. +- **Limits** — the configured per-agent limits that are set, e.g. `Limits: max-iter 50 · history 40 · max-tool-calls 5`. +- **Options** — the enabled option flags, e.g. `Options: add-date · add-environment-info · redact-secrets`. +- **Toolsets (N)** — one line per toolset with a status marker, its name, kind, and tool count, followed by the indented tool names. +- **Commands (N)** — the slash commands the agent defines, each with its description. + +Each toolset carries a single-width status marker reflecting its **live** lifecycle: `●` started (serving), `○` stopped (not yet started), or `⚠` error. The tools listed under a toolset are the **live** tool names when it has started; for a toolset that has not started, the inspector instead shows its declared `tools:` allow-list prefixed with `declared:` (and shows nothing when the toolset declares no allow-list and therefore serves every tool). This lets you see both what an agent is configured with and what is actually running, even before the agent has been used. + +The dialog scrolls when the content is long; press <kbd>Esc</kbd> to close it. Remote runtimes (which hold no local team config) degrade gracefully — the config-derived sections are simply omitted. + +Model identifiers on line 2 are truncated **from the left** (e.g. `…claude-sonnet-4-6`) only when they overflow, so the informative tail (variant/version) is preserved. As the sidebar narrows the model keeps its own line, and near the minimum width line 1's gauge collapses to a single cell to keep the name readable. + +The thinking state of each model is shown with a gauge + value on the card and a gauge or badge on the row (no `✻` glyph): + +| Model state | Card line | Row badge | +| ---------------------- | ------------------------------ | ---------------------- | +| Effort level | `thinking ▰▰▰▰▱▱ high` | `▰▰▰▰▱▱` (effort gauge) | +| Adaptive budget | `thinking auto adaptive` | `auto` | +| Token budget | `thinking ◉ 8.2K tokens` | `◉ 8.2K` | +| Disabled (capable) | `thinking ▱▱▱▱▱▱ off` (dimmed) | `▱▱▱▱▱▱` (empty gauge) | +| Not reasoning-capable | _(omitted)_ | _(omitted)_ | + +The **effort gauge** is a fixed-width six-cell indicator (`▰` filled, `▱` empty) so the badge column stays aligned. It maps the six selectable levels one-to-one onto filled-cell counts — `minimal` → `▰▱▱▱▱▱`, `low` → `▰▰▱▱▱▱`, `medium` → `▰▰▰▱▱▱`, `high` → `▰▰▰▰▱▱`, `xhigh` → `▰▰▰▰▰▱`, `max` → `▰▰▰▰▰▰` — so the cell count alone is lossless, with a low→high color ramp as a secondary cue. A capable-but-disabled model shows a dim empty gauge (`▱▱▱▱▱▱` `off`), adaptive budgets show `auto`, and token budgets keep `◉ <count>`. The same gauge + value renders on the focus card, the Agent Inspector, and the row. + +Harness-backed agents (e.g. `claude-code`) show the harness type as their model and no thinking gauge. Press **Shift+Tab** to cycle the current model's thinking-effort level; a `✻ Thinking: <level>` toast confirms the change (useful when the sidebar is hidden). + +### Agent Delegation Feedback + +When a parent agent calls `transfer_task` to delegate work to a sub-agent, the TUI provides live visual feedback in both the sidebar and the chat. + +**Sidebar — Transfer box:** As soon as the delegation starts, an animated **Transfer** box appears below the agent roster, showing the direction of the handoff with a traveling dot: + +```text +╭─ Transfer ─────────────────╮ +│ parent ●──────► child │ +╰────────────────────────────╯ +``` + +The box stays visible for at least 1.5 seconds. Once the sub-agent produces its first message, reasoning, or tool output, the box hides (still honoring the minimum window) to keep the sidebar focused on the active agent. If the sub-agent is slow or silent, the box hides after a 3-second maximum cutoff. The header shows a `↔` marker while any delegation is still in flight, even after the box hides. + +**Sidebar — Return box:** When the sub-agent finishes and control returns to the parent, a brief **Return** box animates the reverse direction for up to 1.5 seconds, then disappears: + +```text +╭─ Return ───────────────────╮ +│ child ●──────► parent │ +╰────────────────────────────╯ +``` + +**Chat — return transition:** Alongside the sidebar Return animation, the chat shows a one-line static transition between the two agent badges: + +```text +[child] returned control to [parent] +``` + +This transition is not persisted — it does not reappear when you reload the session. + +### Context-Usage Gauge + +The context percentage shown in the sidebar token-usage section, and the fill bar in the lean TUI status line, both color-escalate as the active session approaches the auto-compaction threshold: + +| State | Color | Trigger | +| ------- | ------ | ------- | +| Normal | (default) | Usage below 75% of the compaction threshold | +| Warning | Orange | Usage at or above 75% of the compaction threshold | +| Critical | Red | Usage at or above 95% of the compaction threshold | + +While a compaction is running the percentage is replaced by a **"compacting…"** indicator; token counts remain visible in the lean TUI status line. + +The thresholds are proportional to the agent's configured `compaction_threshold` (default `0.9`), so a custom value keeps a predictable visual runway. See [Compaction Threshold](../../configuration/models/index.md#delegating-session-compaction) for configuration details. + +Clicking the token/context part of the sidebar's usage reading (the glyph, token count, context percentage — or the "compacting…" marker — and the `⚠ capped` marker) opens the `/context` dialog with the full breakdown. Clicking the cost part (the `$` figure and the sub-session count) opens the `/cost` dialog instead. The "Token Usage" section title itself is not clickable. + +### Thinking and Tool Details + +Reasoning/thinking blocks are collapsed by default and carry a `Thinking` header badge. When collapsed, the TUI shows a short preview and compact tool summaries. Expand a block to see the full thinking content and the real tool renderers, including detailed tool output such as file edit diffs. + +To start new sessions with thinking/tool blocks expanded by default, set `expand_thinking` in your user config: + +```yaml +# ~/.config/cagent/config.yaml +settings: + expand_thinking: true +``` + +Set it to `false` or omit it to keep the default collapsed behavior. See [User Settings](../../configuration/user-settings/index.md) for the full settings reference. + +### Mermaid Diagrams + +The TUI renders Mermaid diagram blocks inline rather than displaying raw syntax. When an assistant message contains a fenced code block tagged ` ```mermaid `, the TUI parses the diagram and draws an ASCII representation directly in the conversation: + +| Diagram type | Support | +| ---------------------------------------------- | ------------------------------------------------- | +| `graph` / `flowchart` | ✅ Rendered inline | +| `sequenceDiagram` | ✅ Rendered inline | +| `stateDiagram` / `stateDiagram-v2` | ✅ Rendered inline (supports `direction TD/TB/BT/LR/RL`) | +| Other types (`classDiagram`, `erDiagram`, …) | Falls back to a syntax-highlighted code block | + +Mermaid rendering works in both the full TUI and the lean TUI. Unsupported or syntactically invalid diagram blocks are displayed as ordinary fenced code blocks — no configuration is required and there is no way to disable it. + +### LaTeX Math Rendering + +The TUI renders LaTeX math expressions as terminal-friendly Unicode text. When an assistant message contains inline math (delimited by `$…$`) or display math (delimited by `$$…$$`), the TUI converts supported LaTeX commands to their Unicode equivalents and displays them directly in the conversation. + +Supported features include: + +- Greek letters (`\alpha`, `\beta`, `\gamma`, …) +- Mathematical operators (`\times`, `\div`, `\pm`, `\oplus`, …) +- Relations (`\le`, `\ge`, `\approx`, `\equiv`, …) +- Set operators (`\cap`, `\cup`, `\subset`, `\in`, …) +- Calculus symbols (`\int`, `\sum`, `\prod`, `\partial`, `\nabla`, …) +- Arrows and logic (`\to`, `\implies`, `\forall`, `\exists`, …) +- Superscripts and subscripts (e.g., `x^2`, `a_i`) +- Fractions (`\frac{a}{b}`), square roots (`\sqrt{x}`), and matrices +- Common functions (`\sin`, `\cos`, `\log`, `\lim`, …) + +Unsupported or syntactically invalid LaTeX expressions fall back to displaying the raw source. LaTeX rendering works in both the full TUI and the lean TUI, requires no configuration, and cannot be disabled. + +### Markdown Images + +The TUI fetches and renders images referenced in agent responses using the Kitty graphics protocol. When an assistant message contains a standard Markdown image reference, the TUI downloads the image in the background and displays it inline at the point of the reference. While the image is loading a placeholder is shown; once loaded, the message re-renders with the image in place. + +Only `http://`, `https://`, and `data:image/…;base64,…` URIs are resolved. `file://`, `sandbox://`, and any other URI scheme are rejected as a security measure against prompt-injection attacks that could otherwise read local files. Bare relative paths (e.g. `./output.png`, used for agent-generated images) are read via the local filesystem. Images that fail to load are silently dropped — the surrounding message text is unaffected. Image rendering requires a terminal that supports the Kitty graphics protocol; it is automatically disabled when the terminal does not support it. You can also disable it explicitly via `render_images: false` in `~/.config/cagent/config.yaml` or the **Render images** toggle in `/settings`. + +### Snapshots, `/undo`, and `/snapshots` + +Enable shadow-git snapshots globally in `~/.config/cagent/config.yaml`: + +```yaml +settings: + snapshot: true +``` + +When enabled, Docker Agent records filesystem snapshots at turn boundaries. The TUI exposes two slash commands that operate on those snapshots: + +- **`/undo`** restores files from the most recent snapshot (one step back). +- **`/snapshots`** opens a dialog showing how many snapshots have been captured and the number of files in each one. Use <kbd>↑</kbd>/<kbd>↓</kbd> (or <kbd>j</kbd>/<kbd>k</kbd>) to highlight an entry, then press <kbd>r</kbd> to reset the workspace to that point. Pick `<original>` to revert every snapshot and bring the workspace back to its pre-agent state. <kbd>Esc</kbd> closes the dialog without changing anything. + +Neither command removes messages from the session transcript — they only touch files on disk. Both commands (and the matching command-palette entries) are hidden when snapshots are turned off. Omit `snapshot` or set it to `false` to leave automatic snapshots off; agents can still configure snapshot hooks manually. + +See [Snapshots](../snapshots/index.md) for how the shadow-git machinery works and how to wire it per-agent. + +## File Attachments + +Attach file contents to your messages using the `@` trigger: + +1. Type `@` to open the file completion menu +2. Start typing to filter files (respects `.gitignore`) +3. Select a file to insert the reference + +```bash +# In the chat input: +Explain what the code in @pkg/agent/agent.go does +``` + +The agent receives the full file contents in a structured `<attachments>` block, while the UI shows just the reference. + +For large or frequently-reused documents, or for getting content to an agent over the API or chat server instead of the TUI, see [Choosing a Large-Input Strategy](../../guides/headless/index.md#choosing-a-large-input-strategy). + +Attached files are also recorded on the session so sub-agents spawned by task transfer can read them. To review what is attached, open `/context`: the dialog lists every attached file (and resolved prompt file) with a per-file token estimate and, when a compaction has occurred, displays the verbatim text of the most recent compaction summary. Use <kbd>↑</kbd>/<kbd>↓</kbd> to select an attached file and press <kbd>d</kbd> (or <kbd>x</kbd>/<kbd>Del</kbd>) to drop it, or run `/drop <path>` directly — press <kbd>Tab</kbd> after `/drop` and a space to complete the path from the currently attached files. Dropping stops sharing the file with sub-agents and skills; content already inlined in earlier messages stays in the conversation until compaction, and the file can always be re-attached with `@` or `/attach`. + +### Team Context Budgets and Targeted Compaction + +The `/context` dialog also shows a **Live sessions** section: the current session plus every currently running sub-agent session (foreground children spawned by task transfer and long-running `run_background_agent` tasks). Each row shows the agent name, a short session ID (so two concurrent runs of the same agent stay distinguishable), and that session's context budget: used tokens, context limit, and percentage, or an explicit "limit unknown" reading when the model's window cannot be resolved. Live-sessions rows do not repeat the compaction-cap wording themselves — the dialog's header line is the sole authority on which model, if any, caps the effective limit. + +When a compaction has occurred, the dialog displays the verbatim text of the most recent compaction summary below the file inventory, under a "Latest compaction summary" section. This shows exactly what was summarized, preserving hard newlines and soft-wrapping long lines to the dialog width. + +Select a live session with <kbd>↑</kbd>/<kbd>↓</kbd> and press <kbd>Enter</kbd> to explicitly compact it. Cross-agent compaction happens only on this explicit request: no idle-triggered automatic compaction is added, and the existing automatic threshold and overflow-recovery compaction of sub-agent sessions is unchanged. The request is queued onto the target session's own run loop and executes at the next safe point between model turns, so it cannot corrupt an in-flight turn. The dialog closes and a notification confirms the request; a second notification reports the outcome (compacted, skipped, or failed) with the agent's name. Selecting the main row runs the same compaction as `/compact`. `/compact` itself keeps compacting the current root session. Remote runtimes do not expose live-session tracking, so the section is omitted there. + +## Runtime Model Switching + +Change the AI model during a session with `/model` or <kbd>Ctrl</kbd>+<kbd>M</kbd>. Model switching works in both the full TUI and the lean TUI. + +1. Press <kbd>Ctrl</kbd>+<kbd>M</kbd> (full TUI) or type `/model` (both TUIs) +2. Select from config models or type a custom `provider/model` +3. The model switch is saved with the session and restored on reload + +When a models gateway is configured (`--models-gateway`) and it exposes an OpenAI-style `/v1/models` endpoint, the picker lists the models actually served by the gateway (merged with the models defined in the agent config). When the gateway doesn't expose `/v1/models`, the picker falls back to the regular catalog. + +The picker's catalog entries come from [models.dev](https://models.dev) and are cached locally for a day. Press <kbd>Ctrl</kbd>+<kbd>R</kbd> in the picker to force model discovery to run again, including a refetch of the models.dev catalog. + +> [!TIP] +> Use model switching to try a more capable model for complex tasks, or a cheaper one for simple queries — without modifying your YAML config. + +## Editable Messages + +Edit any previous user message to branch the conversation. Hover a past user message and click **✎ edit** (or select it with the keyboard and press <kbd>e</kbd>) to modify it — the agent will re-process from that point, while the original session history is preserved. This is great for exploring alternative approaches without losing your work. + +Hovering a user or assistant message also reveals a **⎘ copy** button that copies the message text to the clipboard (<kbd>c</kbd> when a message is selected). + +## Error Recovery + +When an agent turn fails (fatal model error, hook block, loop detection, tool-setup failure), the TUI displays the error in the message stream and persists it to the session store. Errors survive a reload and are shown exactly where they occurred, making them visible in shared or remote sessions. + +Each error message includes a clickable **↻ retry** button. Clicking it resumes the conversation from the point of failure — without retyping your last message. This lets you recover from transient failures (rate limits, network blips, model API errors) in one click. + +## Session Management + +Docker Agent automatically saves your sessions. Use `/sessions` to browse past conversations: + +- **Browse** past sessions with search and filtering. The search matches against session **titles** and **session IDs** (full UUIDs, dash-less variants, and partial fragments all resolve correctly — useful when jumping back to a session from a copied ID or log). +- **Workspace grouping**: sessions are grouped by **git repository root** (worktree-aware) — sessions from any subdirectory or linked worktree of the same repository are grouped together under "This workspace", and the header shows the repository root path. Sessions outside the current repository appear under "Other locations" with their originating directory. Press <kbd>Ctrl</kbd>+<kbd>G</kbd> in the browser to cycle between all, current-workspace only, and other-directory views. Restoring a session reopens it in its original directory, so the label always matches where a restore will land. +- **Star** important sessions with `/star` +- **Branch** conversations by editing any previous user message — preserving the original session history +- **Resume** sessions with `docker agent run config.yaml --session <id>` +- **Relative refs**: `--session -1` for the last session, `-2` for the one before + +### Session Title Editing + +Customize session titles to make them more meaningful and easier to find. By default, Docker Agent auto-generates titles based on your first message, but you can override or regenerate them at any time. + +**Using the `/title` command:** + +```bash +/title # Regenerate title using AI (based on recent messages) +/title My Custom Title # Set a specific title +``` + +**Using the sidebar:** + +1. Click the pencil icon (✎) next to the session title in the sidebar +2. Type your new title +3. Press <kbd>Enter</kbd> to save, or <kbd>Escape</kbd> to cancel + +> [!NOTE] +> Manually set titles are preserved and won’t be overwritten by auto-generation. Title changes are persisted immediately to the session. + +## Keyboard Shortcuts + +| Shortcut | Action | +| ---------- | ----------------------------------------------- | +| Ctrl+K | Open command palette | +| Ctrl+M | Switch model | +| Ctrl+R | Reverse history search (search previous inputs) | +| Ctrl+G | Cancel reverse history search | +| Ctrl+S | Cycle to next agent in the team | +| Shift+Tab | Cycle the current model's thinking-effort level (shows a `✻ Thinking: <level>` toast) | +| Ctrl+1 – 9 | Switch directly to agent _N_ in the team list | +| Ctrl+T | Open a new tab (additional agent session) | +| Ctrl+W | Close the current tab | +| Ctrl+N | Next tab | +| Ctrl+P | Previous tab | +| Ctrl+B | Toggle the sidebar (full-UI mode only; disabled when --sidebar=false) | +| Ctrl+Y | Toggle YOLO mode (auto-approve tool calls) | +| Ctrl+O | Toggle hide tool results | +| Ctrl+Z | Suspend TUI to background (resume with `fg`) | +| Ctrl+X | Clear queued messages | +| Escape | Cancel current operation | +| Enter | Send message (or steer while the agent is running) | +| Alt+Enter | Queue a follow-up turn while the agent is running | +| Shift+Enter | Insert a newline | +| Up/Down | Navigate message history | + +Press <kbd>Ctrl</kbd>+<kbd>H</kbd> to view the complete list of all available keyboard shortcuts. + +### Custom Keybindings + +You can remap the shortcuts above by adding a `keybindings` list to the `settings` block of your `~/.config/cagent/config.yaml` (see [User Settings](../../configuration/user-settings/index.md#settings-reference) for the field reference). Each entry maps an action to one or more key combinations in [Bubbles key format](https://github.com/charmbracelet/bubbles) (for example `ctrl+q`, `alt+enter`, `f2`). Unlisted actions keep their defaults. + +This is the recommended way to replace the `Ctrl+J` newline fallback, which conflicts with common editor/terminal shortcuts (for example inside VS Code). + +```yaml +settings: + keybindings: + # Insert a newline with Alt+Enter instead of Ctrl+J. Shift+Enter still + # works automatically on terminals that report it. + - action: "editor_newline" + keys: ["alt+enter"] + # Allow several keys for one action. + - action: "commands" + keys: ["f2", "ctrl+k"] + - action: "quit" + keys: ["ctrl+q"] +``` + +**Valid actions:** + +| Action | Default | Description | +| -------------------------- | ------------ | -------------------------------------- | +| `editor_send` | `enter` | Send the current message | +| `editor_newline` | `ctrl+j` | Insert a newline in the input | +| `quit` | `ctrl+c` | Quit (opens the exit confirmation) | +| `switch_focus` | `tab` | Switch focus between panels | +| `commands` | `ctrl+k` | Open the command palette | +| `help` | `ctrl+h` | Show the help dialog | +| `toggle_yolo` | `ctrl+y` | Toggle YOLO mode | +| `toggle_hide_tool_results` | `ctrl+o` | Toggle hiding tool results | +| `cycle_agent` | `ctrl+s` | Cycle to the next agent | +| `model_picker` | `ctrl+m` | Open the model picker | +| `clear_queue` | `ctrl+x` | Clear queued messages | +| `suspend` | `ctrl+z` | Suspend the TUI | +| `toggle_sidebar` | `ctrl+b` | Toggle the sidebar | +| `edit_external` | `ctrl+g` | Edit input in an external editor | +| `history_search` | `ctrl+r` | Incremental history search | + +`Shift+Enter` for newline is detected from your terminal's capabilities and is always available where supported, independent of `editor_newline`. + +Invalid entries are ignored with a warning (visible with `--debug`) so a bad config never breaks the TUI: unknown actions, empty or malformed keys, and keys that would collide with another action are dropped while every other binding keeps working. + +## History Search + +Press <kbd>Ctrl</kbd>+<kbd>R</kbd> to enter incremental history search mode. Start typing to filter through your previous inputs. Press <kbd>Enter</kbd> to select a match, or <kbd>Escape</kbd> to cancel. + +## Settings + +Run `/settings` to open the settings dialog. Use <kbd>Tab</kbd> to switch between **Appearance**, **Behavior**, and **Notifications**. + +> [!TIP] +> **Full settings reference** +> +> This section covers the `/settings` dialog. For the complete list of `settings:` fields (including ones with no dialog UI, like `permissions`, `hooks`, and `keybindings`) and how they interact with CLI flags and aliases, see [User Settings](../../configuration/user-settings/index.md). + +The **Appearance** tab selects the theme and customizes the layout. Layout changes show a live schematic preview and apply immediately to the UI behind the dialog: + +- **Sidebar position**: `Right` (default), `Left`, `Top`, or `Bottom`. Left/right keep the full vertical sidebar next to the chat; top/bottom render it as a compact horizontal band above or below the chat (session title, working directory, token usage, plus a one-line summary of the current agent and its model; in multi-agent configurations all team agents are listed by name after the current agent). +- **Sidebar info mode**: `Compact` (default) or `Detailed`. Controls how the Agents panel renders agent rows — see [Agents Panel](#agents-panel) for details. Persisted as `settings.layout.sidebar_info_mode: detailed`; compact is the default and omitted from the config. +- **Section spacing**: `Compact`, `Normal` (default), or `Relaxed`, the number of blank lines between the sidebar sections (1, 2, or 3). +- **Sidebar sections**: toggle the visibility of the **Session path** (the working directory line, including its git branch) and the **Token usage**, **Agents**, **Tools**, and **Todos** sections. The session title is always shown. + +Appearance also controls split-diff rendering, expanded thinking, and whether tool results are hidden by default. Select **Theme** to open the theme picker. + +The **Behavior** tab controls busy-message handling, the auto-approve default, tab restoration, automatic snapshots, lean UI, and the maximum tab-title length. Restore-tabs and lean-UI changes take effect on the next launch. Enabling auto-approve requires confirmation. + +The **Notifications** tab enables completion sounds and sets the minimum task duration before a sound plays. + +Press <kbd>Enter</kbd> to apply and persist, or <kbd>Escape</kbd> to cancel and restore the previous layout. The settings are saved globally in `~/.config/cagent/config.yaml`: + +```yaml +# ~/.config/cagent/config.yaml +settings: + busy_send_mode: queue # steer (default), queue + layout: + sidebar_position: left # right (default), left, top, bottom + sidebar_info_mode: detailed # compact (default, omitted), detailed + section_spacing: compact # normal (default), compact, relaxed + hide_session_path: false + hide_usage: true + hide_agents: false + active_agents_only: false # true to filter to session-active agents + hide_tools: false + hide_todos: false +``` + +## Theming + +Customize the TUI appearance with built-in or custom themes: + +```bash +# Open Settings and select Theme under Appearance +/settings +``` + +### Built-in Themes + +`default`, `default-light`, `catppuccin-latte`, `catppuccin-mocha`, `dracula`, `gruvbox-dark`, `gruvbox-light`, `nord`, `one-dark`, `solarized-dark`, `tokyo-night` + +### Auto Theme (match the terminal) + +The special theme `auto` follows the terminal's light/dark background instead of naming a fixed theme. Select **Auto (match terminal)** from **Settings → Appearance → Theme**, pass `--theme auto`, or set it in your user config: + +```yaml +settings: + theme: auto + theme_dark: default # optional, theme used on dark backgrounds (default: default) + theme_light: default-light # optional, theme used on light backgrounds (default: default-light) +``` + +At startup the terminal background is queried (OSC 11) to pick the dark or light theme of the pair; non-interactive runs (pipes, CI) fall back to the dark theme. In terminals that report appearance changes (DEC mode 2031 — Ghostty, kitty, contour, …), flipping the OS or terminal appearance while Docker Agent is running switches the theme live. Terminals without that mode re-sync when the window regains focus. + +### Custom Themes + +Create theme files in `~/.cagent/themes/` as YAML. Theme files are **partial overrides** — you only need to specify the colors you want to change. Any omitted keys fall back to the built-in default theme values. + +```yaml +# ~/.cagent/themes/my-theme.yaml +name: "My Custom Theme" + +colors: + # Backgrounds + background: "#1a1a2e" + background_alt: "#16213e" + + # Text colors + text_bright: "#ffffff" + text_primary: "#e8e8e8" + text_secondary: "#b0b0b0" + text_muted: "#707070" + + # Accent colors + accent: "#4fc3f7" + brand: "#1d96f3" + + # Status colors + success: "#4caf50" + error: "#f44336" + warning: "#ff9800" + info: "#00bcd4" + +# Optional: Customize syntax highlighting colors +chroma: + comment: "#6a9955" + keyword: "#569cd6" + literal_string: "#ce9178" + +# Optional: Customize markdown rendering colors +markdown: + heading: "#4fc3f7" + link: "#569cd6" + code: "#ce9178" +``` + +### Applying Themes + +**In user config** (`~/.config/cagent/config.yaml`, see [User Settings](../../configuration/user-settings/index.md) for the full reference): + +```yaml +settings: + theme: my-theme # References ~/.cagent/themes/my-theme.yaml +``` + +**At launch:** Pass `--theme <name>` to `docker agent run` to preselect a theme for that session. This overrides `settings.theme` in your config but is not saved. Invalid theme names print an error at startup listing the available options. Has no effect in `--exec` mode. `--theme auto` enables the [auto theme](#auto-theme-match-the-terminal) for the session. + +**At runtime:** Open `/settings`, select **Theme** on the Appearance tab, and choose from the available themes. Your selection is saved globally in `~/.config/cagent/config.yaml` under `settings.theme` and persists across sessions. + +> [!TIP] +> **Hot Reload** +> +> Custom themes auto-reload when you save changes to the file — no restart needed. This makes it easy to tweak colors in real-time. + +> [!WARNING] +> **Partial overrides** +> +> All user themes are applied on top of the `default` theme. If you want to customize a built-in theme (e.g., `dracula`), copy its full YAML from the [built-in themes on GitHub](https://github.com/docker/docker-agent/tree/main/pkg/tui/styles/themes) into `~/.cagent/themes/` and edit the copy. Otherwise, omitted values will use `default` colors, not the original theme's colors. + +## Tool Permissions + +When an agent calls a tool, Docker Agent shows a confirmation dialog by default. You can: + +- **Approve once** — Allow this specific call +- **Always allow** — Permanently approve this tool/command for the session +- **Deny** — Reject the tool call + +**Granular permissions:** The permission system supports pattern-based matching. When you “Always allow” a specific tool command, only that exact pattern is auto-approved — other commands from the same tool still require confirmation. This lets you auto-approve safe, read-only operations while maintaining control over destructive ones. + +> [!TIP] +> **YOLO mode** +> +> Use `--yolo` or the `/yolo` command to auto-approve all tool calls. You can also toggle this mid-session. For aliases, set `--yolo` when creating the alias: `docker agent alias add fast myorg/coder --yolo`. + +## Notifications + +The TUI displays transient notification banners for agent warnings, errors, and other runtime events. Notifications auto-dismiss after a short delay unless the mouse is hovering over them — hovering pauses the timer so you have time to read the message. + +| Interaction | Behaviour | +| ----------- | --------- | +| Hover | Pauses auto-dismiss; the notification stays visible until the mouse moves away | +| Click | Copies the notification text to the clipboard | +| × (close) | Dismisses immediately; the glyph turns red when hovered | + +Hint text in the top-left corner of the notification border shows the available actions at a glance. diff --git a/_vendor/github.com/docker/docker-agent/docs/getting-started/_index.md b/_vendor/github.com/docker/docker-agent/docs/getting-started/_index.md new file mode 100644 index 000000000000..46eeae898947 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/getting-started/_index.md @@ -0,0 +1,5 @@ +--- +title: "Getting Started" +description: "Install Docker Agent and build your first agent." +weight: 10 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/getting-started/installation/index.md b/_vendor/github.com/docker/docker-agent/docs/getting-started/installation/index.md new file mode 100644 index 000000000000..43e52344c5b8 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/getting-started/installation/index.md @@ -0,0 +1,150 @@ +--- +title: "Installation" +description: "Get Docker Agent running on your system in minutes." +keywords: docker agent, ai agents, getting started, installation +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/getting-started/installation/ +--- + +_Get Docker Agent running on your system in minutes._ + +## Prerequisites + +- An API key for at least one AI provider (OpenAI, Anthropic, Google, etc.) +- **Optional:** [Docker Desktop](https://www.docker.com/products/docker-desktop/) — for running containerized MCP tools and Docker Model Runner + +## Docker Desktop (Pre-installed) + +Starting with [Docker Desktop 4.63](https://docs.docker.com/desktop/release-notes/#4630), **Docker Agent is already available**. No separate installation needed — just open a terminal and run: + +```bash +$ docker agent version +``` + +> [!TIP] +> Docker Desktop bundles Docker Agent and keeps it up to date. This is the easiest way to get started, especially if you want to use Docker MCP tools and Docker Model Runner. + +## Homebrew (macOS / Linux) + +Install Docker Agent using [Homebrew](https://brew.sh/): + +```bash +# Install +$ brew install docker-agent + +# Verify +$ docker-agent version +``` + +You can also install Docker Agent as a docker CLI plugin, by copying the `docker-agent` binary in `~/.docker/cli-plugins`. You can then run `docker agent version`. + +## Download Binary Releases + +Download [prebuilt binary releases](https://github.com/docker/docker-agent/releases) for Windows, macOS, and Linux from the GitHub Releases page. + +### macOS / Linux + +```bash +# Download the latest release +OS=$(uname -s | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m); case "$ARCH" in x86_64) ARCH=amd64;; aarch64) ARCH=arm64;; esac +curl -L "https://github.com/docker/docker-agent/releases/latest/download/docker-agent-${OS}-${ARCH}" -o docker-agent +chmod +x docker-agent +sudo mv docker-agent /usr/local/bin/ +docker-agent version + +# or alternatively, instead of moving to /usr/local/bin: +mkdir -p ~/.docker/cli-plugins +sudo mv docker-agent ~/.docker/cli-plugins +docker agent version +``` + +### Windows + +Download `docker-agent-windows-amd64.exe` from the [releases page](https://github.com/docker/docker-agent/releases), rename it to `docker-agent.exe` and add it to your PATH. Alternatively you can move it to `~/.docker/cli-plugins` + +## Optional Self-Updates + +When Docker Agent is installed from a standalone GitHub release binary, you can opt in to automatic self-updates by setting `DOCKER_AGENT_AUTO_UPDATE` to a truthy value (`1`, `true`, `yes`, or `on`): + +```bash +# Enable for one command +DOCKER_AGENT_AUTO_UPDATE=1 docker agent run + +# Or enable for the current shell session +export DOCKER_AGENT_AUTO_UPDATE=1 +docker agent run +``` + +With self-updates enabled, Docker Agent checks the latest GitHub release before normal commands run. If a newer release exists and your session is interactive, Docker Agent asks whether you want to install it or keep running your current version. When the answer is yes (or the session is non-interactive, such as CI or piped input, in which case the update proceeds automatically), it downloads the asset for your OS and architecture, verifies the release-provided SHA-256 digest/checksum, replaces the current binary, and restarts the command with the same arguments. + +Self-updates are fail-safe: if checking, downloading, verifying, installing, or restarting fails, Docker Agent keeps running the current binary. Version/help/completion commands and Docker CLI plugin metadata handshakes do not trigger self-updates. + +> [!NOTE] +> **Package-manager installs** +> +> Docker Desktop and Homebrew already manage Docker Agent updates. Prefer those update mechanisms when you installed Docker Agent that way. Self-updates are mainly intended for standalone release binaries. + +## Build from Source + +For the latest features, or to contribute, build from source: + +### Prerequisites + +- [Go 1.26](https://go.dev/dl/) or higher +- [Task](https://taskfile.dev/installation/) (build tool) +- [golangci-lint](https://golangci-lint.run/docs/welcome/install/local/) (for linting) + +```bash +# Clone the repository +git clone https://github.com/docker/docker-agent.git +cd docker-agent + +# Build the binary +task build + +# The binary is at ./bin/docker-agent +./bin/docker-agent --help +``` + +> [!TIP] +> **Building on Windows** +> +> On Windows, use `task build-local` instead of `task build`. This builds the binary inside a Docker container using Docker Buildx, which avoids issues with Windows-specific toolchain setup and CGo cross-compilation. The output goes to the `./dist` directory. + +## Set Up API Keys + +Docker Agent needs API keys for the model providers you want to use. Set them as environment variables: + +```bash +# Pick one (or more) depending on your provider +export OPENAI_API_KEY="sk-..." # OpenAI +export ANTHROPIC_API_KEY="sk-ant-..." # Anthropic +export GOOGLE_API_KEY="AI..." # Google Gemini (or GEMINI_API_KEY) +export GITHUB_TOKEN="ghp-..." # GitHub Copilot (PAT with copilot scope) +export MISTRAL_API_KEY="..." # Mistral +export OPENROUTER_API_KEY="..." # OpenRouter +``` + +See [Configuration Overview](../../configuration/overview/index.md#environment-variables) for the full list of supported providers and environment variables. + +> [!NOTE] +> You only need the key(s) for the provider(s) you configure in your agent YAML. If you use Docker Model Runner (DMR), no API key is needed — models run locally. + +## Verify Installation + +```bash +# Check the version +$ docker agent version + +# Run the default agent +$ docker agent run + +# Or run an agent from an OCI registry +$ docker agent run myorg/agent:tag +``` + +## What's Next? + +- [**Quick Start**](../quickstart/index.md) — create and run your first agent in under 5 minutes. +- [**Troubleshooting**](../../community/troubleshooting/index.md) — something not working? Debug mode, common issues, and solutions. diff --git a/_vendor/github.com/docker/docker-agent/docs/getting-started/introduction/index.md b/_vendor/github.com/docker/docker-agent/docs/getting-started/introduction/index.md new file mode 100644 index 000000000000..0ade379b873c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/getting-started/introduction/index.md @@ -0,0 +1,74 @@ +--- +title: "Introduction" +description: "Docker Agent is a multi-agent runtime that lets you build, run, and share AI agents with a YAML or HCL config — no glue code required." +keywords: docker agent, ai agents, getting started, introduction +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/getting-started/introduction/ +--- + +_Docker Agent is a multi-agent runtime that lets you build, run, and share AI agents with a YAML or HCL config — no glue code required._ + +## What is Docker Agent? + +Docker Agent is an open-source tool from Docker that orchestrates AI +agents with specialized capabilities and tools. Instead of writing +code to wire up LLMs, tools, and workflows, you **declare** your +agents in YAML or HCL — their model, personality, tools, and how they +collaborate — and Docker Agent handles the rest. + +- **Multi-Agent Architecture** — build hierarchical teams of agents that specialize in different tasks and delegate work to each other. +- **Rich Tool Ecosystem** — built-in tools for files, shell, memory, and todos. Extend with any MCP server from [Docker's MCP catalog](https://hub.docker.com/u/mcp). +- **Multi-Model Support** — OpenAI, Anthropic, Google Gemini, AWS Bedrock, Docker Model Runner, and reusable provider definitions with shared defaults. +- **Package & Share** — push agents to OCI registries and pull them anywhere, just like Docker images. +- **Multiple Interfaces** — interactive TUI, headless CLI, HTTP API server, MCP mode, and A2A protocol support. +- **Security-First Design** — tool confirmation prompts, containerized MCP tools via Docker, client isolation, and resource scoping. + +## Why Docker Agent? + +After spending years building AI agents using various frameworks, the +Docker team kept asking the same questions: + +- **How do we make building agents less of a hassle?** — Most agents + use the same building blocks. Docker Agent provides them out of the + box. +- **Can we reuse those building blocks?** — Declarative YAML or HCL + configs mean you can mix and match agents, models, and tools without + rewriting code. +- **How can we share agents easily?** — Push agents to any OCI + registry and run them anywhere with a single command. + +Docker Agent is built in the open so the community can make use of +this work and contribute to its future. + +## How it works + +At its core, Docker Agent follows a simple loop: + +1. **You define agents** in YAML or HCL — their model, instructions, tools, and sub-agents. +2. **You run an agent** via the TUI, CLI, or API. +3. **The agent processes your request** — calling tools, delegating to sub-agents, and reasoning step by step. +4. **Results stream back in real-time** via an event-driven architecture. + +```yaml +# A minimal agent definition +agents: + root: + model: openai/gpt-5 + description: A helpful assistant + instruction: You are a helpful assistant. + toolsets: + - type: think +``` + +```bash +# Run it +$ docker agent run agent.yaml +``` + +> [!TIP] +> Jump straight to the [Quick Start](../quickstart/index.md) if you want to build your first agent right away. + +## What's next? + +- [**Installation**](../installation/index.md) — install Docker Agent on macOS, Linux, or Windows. +- [**Quick Start**](../quickstart/index.md) — build your first agent in under 5 minutes. diff --git a/_vendor/github.com/docker/docker-agent/docs/getting-started/quickstart/index.md b/_vendor/github.com/docker/docker-agent/docs/getting-started/quickstart/index.md new file mode 100644 index 000000000000..f3f9056a829d --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/getting-started/quickstart/index.md @@ -0,0 +1,156 @@ +--- +title: "Quick Start" +description: "Get up and running with Docker Agent in under 5 minutes. Pick whichever path suits you best." +keywords: docker agent, ai agents, getting started, quick start +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/getting-started/quickstart/ +aliases: + - /ai/docker-agent/tutorial/ +--- + +_Get up and running with Docker Agent in under 5 minutes. Pick whichever path suits you best._ + +## Option A: Run the Default Agent + +The fastest way to try Docker Agent — no config file needed: + +```bash +# Launch the default agent with the interactive TUI +$ docker agent run +``` + +This starts a general-purpose assistant with sensible defaults. Just start chatting. + +> [!NOTE] +> This needs a model: a cloud provider API key, or a local model pulled through Docker Model Runner. [Set Up a Model](../set-up-a-model/index.md) walks through both paths. + +## Option B: Run an Agent from a Registry + +Run an agent shared through any OCI-compatible registry — no local YAML needed: + +```bash +$ docker agent run myorg/agent:tag +``` + +## Option C: Generate a Config Interactively + +Use the `docker agent new` command to scaffold a config file through prompts: + +```bash +# Interactive wizard +$ docker agent new + +# Or specify options directly +$ docker agent new --model openai/gpt-5 + +# Override iteration limits +$ docker agent new --model dmr/ai/gemma3-qat:12B --max-iterations 15 +``` + +This generates an `agent.yaml` in the current directory. Then run it: + +```bash +$ docker agent run agent.yaml +``` + +## Option D: Write Your Own Config + +Create an `agent.yaml` by hand for full control. Here's a minimal example: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: A helpful coding assistant + instruction: | + You are an expert software developer. Help users write + clean, efficient code. Explain your reasoning. + toolsets: + - type: filesystem + - type: shell + - type: think +``` + +This gives your agent: + +- **Claude Sonnet 4.5** as the underlying model +- **Filesystem access** to read and write files +- **Shell access** to run commands +- **Think tool** for step-by-step reasoning + +This config needs `ANTHROPIC_API_KEY` set. See [Set Up a Model](../set-up-a-model/index.md) for where to put it, or use a local `dmr/...` model that needs no key. + +```bash +# Launch the interactive terminal UI +$ docker agent run agent.yaml +``` + +> [!TIP] +> **Prefer HCL?** +> +> You can write the same config as `agent.hcl` using labeled blocks and heredocs. See [HCL Configuration](../../configuration/hcl/index.md). + +## Try It Out + +Once your agent is running, try asking it to: + +- _"List the files in the current directory"_ +- _"Create a Python script that fetches weather data"_ +- _"Explain what the code in main.go does"_ + +> [!TIP] +> Add `--yolo` to auto-approve all tool calls: `docker agent run agent.yaml --yolo` + +## Take the Interactive Tour + +Prefer to learn by doing? Run: + +```bash +$ docker agent getting-started +``` + +This launches a short, scripted tour inside the chat UI: sending messages, approving tool calls, the command palette, and slash commands. It's skippable at any point with <kbd>Esc</kbd>, and you can replay it later with the same command or the `/getting-started` slash command. + +## Non-Interactive Mode + +Use `docker agent run --exec` for one-shot tasks: + +```bash +# Ask a single question +$ docker agent run --exec agent.yaml "Create a Dockerfile for a Node.js app" + +# Pipe input +$ cat error.log | docker agent run --exec agent.yaml "What's wrong in this log?" +``` + +## Add More Power + +Give your agent persistent memory and web search: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Research assistant with memory + instruction: | + You are a research assistant. Search the web for information, + remember important findings, and provide thorough analysis. + toolsets: + - type: think + - type: memory + path: ./research.db + - type: mcp + ref: docker:duckduckgo +``` + +> [!NOTE] +> **Docker MCP Tools** +> +> The `ref: docker:duckduckgo` syntax runs the DuckDuckGo MCP server in a Docker container. This is the recommended way to use MCP tools — secure, isolated, and easy to configure. Requires Docker Desktop. + +## What's Next? + +- [**Understand Agents**](../../concepts/agents/index.md) — learn how agents work and what you can configure. +- [**Multi-Agent Systems**](../../concepts/multi-agent/index.md) — build teams of collaborating agents. +- [**Configuration Reference**](../../configuration/overview/index.md) — full reference for all YAML and HCL options. +- [**Troubleshooting**](../../community/troubleshooting/index.md) — something not working? Debug tips and common fixes. diff --git a/_vendor/github.com/docker/docker-agent/docs/getting-started/set-up-a-model/index.md b/_vendor/github.com/docker/docker-agent/docs/getting-started/set-up-a-model/index.md new file mode 100644 index 000000000000..bff584def8d3 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/getting-started/set-up-a-model/index.md @@ -0,0 +1,276 @@ +--- +title: "Set Up a Model" +description: "Make a model available to Docker Agent: connect a cloud provider, run a local model with Docker Model Runner, or register a custom OpenAI-compatible endpoint." +keywords: docker agent, ai agents, getting started, set up a model, api key, local model, docker model runner, custom endpoint +weight: 25 +canonical: https://docs.docker.com/ai/docker-agent/getting-started/set-up-a-model/ +--- + +_Most agents need a model to think with: connect a built-in cloud provider, run a model locally with Docker Model Runner, or register a custom OpenAI-compatible endpoint. This page walks through each path end to end — plus the exception: agents that delegate to the Claude Code CLI on a Claude subscription, which need no model at all._ + +## Pick a Path + +| | Built-in cloud provider (Path A) | Local model (Path B) | +| ------------- | ------------------------------------------------ | ---------------------------------------- | +| You need | An account and a credential (usually an API key) | Docker Desktop with Model Runner enabled | +| Cost | Pay per token | Free once the model is downloaded | +| Your data | Sent to the provider | Never leaves your machine | +| Model quality | Frontier models (Claude, GPT-5, Gemini) | Open models sized to your hardware | + +You can set up both. When you don't name a model, Docker Agent's `auto` selection picks the first cloud provider with a configured credential and falls back to a locally pulled Docker Model Runner model. + +Two more paths cover the remaining cases: if your models sit behind your own OpenAI-compatible endpoint (vLLM, LiteLLM, a corporate gateway), register it with its base URL as a [custom endpoint](#path-c-custom-openai-compatible-endpoint) (Path C); and if you have a **Claude subscription**, the [Claude Code harness](#path-d-claude-code-harness-claude-subscription) (Path D) runs the official `claude` CLI as the agent, with no API key and no local model required. + +> [!TIP] +> **Prefer a wizard?** +> +> `docker agent setup` walks through the same choices interactively: pick a built-in provider and store its credential, check Docker Model Runner and pull a local model, register a custom OpenAI-compatible endpoint, or set up the Claude Code harness. This page is the manual version. See the [CLI reference](../../features/cli/index.md#docker-agent-setup). + +## Path A: Built-in Cloud Provider + +Docker Agent ships built-in support for many cloud providers: Anthropic, OpenAI, Google Gemini, Groq, Hugging Face, AWS Bedrock, GitHub Copilot, and more. You pick these by name instead of registering a custom provider. The providers `docker agent setup` lists — Groq and Hugging Face among them — come with a predefined endpoint, so setting the provider's credential is enough; some other built-in aliases need manual configuration, such as Azure OpenAI with your resource endpoint as `base_url`. The credential is usually an API key, but not always: Hugging Face uses the `HF_TOKEN` token, GitHub Copilot a `GITHUB_TOKEN`, AWS Bedrock your AWS credentials, and `chatgpt` signs in with your ChatGPT account in the browser via `docker agent setup`, with no key to paste. The steps below show the API-key flow that most providers follow. + +### 1. Get an API key + +Create a key in your provider's console: + +| Provider | Environment variable | Get a key at | +| ------------- | -------------------- | ------------------------------------------------------------------- | +| Anthropic | `ANTHROPIC_API_KEY` | [console.anthropic.com](https://console.anthropic.com/settings/keys) | +| OpenAI | `OPENAI_API_KEY` | [platform.openai.com](https://platform.openai.com/api-keys) | +| Google Gemini | `GOOGLE_API_KEY` | [aistudio.google.com](https://aistudio.google.com/apikey) | + +Every other provider with an API key works the same way. See [Model Providers](../../providers/overview/index.md) for the full list, each provider's credential variable, and the exceptions noted above. + +### 2. Store the key + +The fastest option is an environment variable in your shell: + +```bash +$ export ANTHROPIC_API_KEY=sk-ant-... +``` + +That lasts for the current shell session. To set a key up once, use any other built-in secret source: + +```bash +# Env file, passed at run time +$ echo 'ANTHROPIC_API_KEY=sk-ant-...' > .env +$ docker agent run --env-from-file .env + +# Docker Agent env file, read automatically on every run +# (`docker agent setup` writes it for you with owner-only permissions) +$ echo 'ANTHROPIC_API_KEY=sk-ant-...' >> ~/.config/cagent/.env +$ chmod 600 ~/.config/cagent/.env +``` + +The entry name must match the environment variable the provider expects. [Managing Secrets](../../guides/secrets/index.md) covers every source (Docker Compose secrets, credential helpers, 1Password references) and the order they are checked in. + +> [!IMPORTANT] +> Keys never go in `agent.yaml`. If you use an env file, add it to `.gitignore`. + +### 3. Verify + +`docker agent doctor` shows whether the key is visible and where it comes from: + +```bash +$ docker agent doctor +``` + +```text +User configuration + ~/.config/cagent/config.yaml: ok + +Model provider credentials + PROVIDER STATUS CREDENTIAL SOURCE + anthropic found ANTHROPIC_API_KEY environment + openai not set OPENAI_API_KEY - + ... + +Docker Model Runner + Status: not installed (https://docs.docker.com/ai/model-runner/get-started/) + +Model auto-selection + auto -> anthropic/claude-sonnet-4-6 + +No issues found. +``` + +### 4. Run + +```bash +$ docker agent run +``` + +With no config file, the default agent picks the provider you configured. To name a model explicitly, use `--model` or the `model` field in your config: + +```bash +$ docker agent run --model anthropic/claude-sonnet-4-5 +``` + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: A helpful coding assistant + instruction: You are an expert software developer. +``` + +## Path B: Local Model (Docker Model Runner) + +Docker Model Runner (DMR) runs open models on your own machine: no API key, no per-token cost, and prompts never leave your computer. + +### 1. Install Docker Model Runner + +Model Runner ships with [Docker Desktop](https://www.docker.com/products/docker-desktop/) (enable it under **Settings > AI**) and is also available for Docker Engine. Check that it responds: + +```bash +$ docker model status +``` + +If the command is missing or fails, follow the [Model Runner get-started guide](https://docs.docker.com/ai/model-runner/get-started/). + +### 2. Pull a model + +```bash +$ docker model pull ai/qwen3 +``` + +`ai/qwen3` is the model Docker Agent reaches for by default, but any model from the [Docker Hub `ai` catalog](https://hub.docker.com/u/ai) works. Pick one sized for your machine's memory. List what you have locally: + +```bash +$ docker model ls +``` + +### 3. Verify + +```bash +$ docker agent doctor +``` + +```text +User configuration + ~/.config/cagent/config.yaml: ok + +Model provider credentials + PROVIDER STATUS CREDENTIAL SOURCE + anthropic not set ANTHROPIC_API_KEY - + ... + +Docker Model Runner + Status: reachable, 1 model(s) pulled: + - ai/qwen3:latest + +Model auto-selection + auto -> dmr/ai/qwen3:latest + +No issues found. +``` + +### 4. Run + +```bash +$ docker agent run --model dmr/ai/qwen3 +``` + +Or in your config: + +```yaml +agents: + root: + model: dmr/ai/qwen3 + description: A local assistant + instruction: You are a helpful assistant. +``` + +When no cloud key is configured, bare `docker agent run` auto-selects a pulled local model, so after `docker model pull` you can run with no flags at all. The [Docker Model Runner provider page](../../providers/dmr/index.md) covers context size, runtime flags, and other tuning options. + +## Path C: Custom OpenAI-compatible Endpoint + +If your models are served from your own endpoint (vLLM, LiteLLM, a corporate gateway, an API proxy), register it as a custom provider: you supply its base URL, the API format, and the environment variable holding its API key, if it needs one. Built-in providers such as Groq or Hugging Face don't need this; use [Path A](#path-a-built-in-cloud-provider) and set their credential instead. + +The interactive wizard is the quickest way: + +```bash +$ docker agent setup # pick "Custom OpenAI-compatible endpoint" +``` + +Or define the provider once in your user configuration (`~/.config/cagent/config.yaml`): + +```yaml +providers: + myprovider: + base_url: https://llm.corp.example.com/v1 + api_type: openai_chatcompletions + token_key: MYPROVIDER_API_KEY +``` + +Its models then work with every command: + +```bash +$ docker agent models --provider myprovider +$ docker agent run --model myprovider/<model> +``` + +See [Provider Definitions](../../providers/custom/index.md#global-providers-user-configuration) for the full reference, including per-agent-file providers and gateway behavior. + +## Path D: Claude Code Harness (Claude Subscription) + +If you already pay for a Claude subscription, an agent can delegate its work to +the official Claude Code CLI instead of calling a model API. This is an +**external CLI, not provider API access**: Docker Agent launches `claude`, +which authenticates with its own subscription login — no `ANTHROPIC_API_KEY`, +no Docker Model Runner, and no token ever passes through Docker Agent. + +### 1. Install and log in + +Install [Claude Code](https://docs.anthropic.com/en/docs/claude-code), then +log in **as the same OS user and environment that run `docker agent`**: + +```bash +$ claude auth login --claudeai # interactive, opens a browser +$ claude auth status --text # verify +``` + +### 2. Create a harness agent + +`docker agent setup` (pick "Claude Code harness") generates this file for you, +or write it yourself: + +```yaml +# claude-code-agent.yaml +agents: + root: + description: Claude Code running on your Claude subscription + harness: + type: claude-code + effort: medium # low | medium | high | xhigh | max; omit for the Claude Code default +``` + +### 3. Verify and run + +```bash +$ docker agent doctor claude-code-agent.yaml # checks the CLI is installed and logged in +$ docker agent run claude-code-agent.yaml +``` + +The harness runs the CLI non-interactively and bypasses Claude Code's +permission prompts, so use it in a repository you trust — see the security +notes and full field reference in [Coding Harnesses](../../features/harnesses/index.md). + +## Check Your Setup Anytime + +`docker agent doctor` reports which providers have credentials (and from which source), whether Docker Model Runner is reachable and which models are pulled, and which model `auto` would pick. Secret values are never printed. + +```bash +$ docker agent doctor # credential, DMR, and auto-selection state +$ docker agent doctor ./agent.yaml # also check that file's requirements +``` + +It exits non-zero when something would block a run, which makes it usable as a CI preflight. See the [CLI reference](../../features/cli/index.md#docker-agent-doctor). + +## What's Next? + +- [**Quick Start**](../quickstart/index.md) — run your first agent now that a model is available. +- [**Models**](../../concepts/models/index.md) — inline vs. named models, fallbacks, and `auto` selection. +- [**Managing Secrets**](../../guides/secrets/index.md) — every way to store credentials, compared. +- [**Troubleshooting**](../../community/troubleshooting/index.md#missing-credentials-or-model-errors) — decode "no model available" and credential errors. diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/_index.md b/_vendor/github.com/docker/docker-agent/docs/guides/_index.md new file mode 100644 index 000000000000..3e7b3780ad13 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/_index.md @@ -0,0 +1,5 @@ +--- +title: "Guides" +description: "Practical guides for building and running agents." +weight: 70 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/compaction/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/compaction/index.md new file mode 100644 index 000000000000..67027ff65c03 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/compaction/index.md @@ -0,0 +1,149 @@ +--- +title: "Managing Context & Compaction" +description: "How to keep long Docker Agent sessions from filling the model's context window: automatic and on-demand compaction, trimming tool results, and reading the context gauge." +keywords: docker agent, ai agents, guides, context window, compaction, session compaction +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/guides/compaction/ +--- + +_How to keep long-running sessions from filling the model's context window._ + +## Why long sessions fill the context window + +Every model has a fixed context window — a maximum number of tokens it can read per request. As a session grows, the system prompt, tool definitions, prompt files, and the full message history (including every tool call and its result) all count against that budget. A long-running agent — one that reads many files, runs many commands, or just keeps chatting for a while — eventually approaches the limit. Once a request no longer fits, the model provider rejects it and the session stalls. + +Docker Agent addresses this with **compaction**: replacing older parts of the conversation with a compact AI-generated summary, freeing up room for the session to keep going. This guide covers the levers you have — automatic compaction, on-demand compaction, and trimming individual tool results — and how to read the context gauge so you know where a session stands. + +## Let Docker Agent compact automatically + +By default, every agent proactively compacts its own session once estimated token usage crosses **90%** of the model's context window: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: A long-running research assistant + instruction: You are a helpful assistant. +``` + +No configuration is required to get this behavior — it's on by default. Three fields let you tune it: + +| Field | Where | Description | +| --- | --- | --- | +| `session_compaction` | agent | Set to `false` to disable automatic compaction entirely for this agent (both the proactive threshold trigger and the post-overflow auto-recovery). The manual `/compact` command still works. Default: `true`. | +| `compaction_threshold` | agent or model | Fraction of the context window (greater than `0`, at most `1`) at which proactive compaction fires. A value set on the model takes precedence over the agent-level value. Default: `0.9`. | +| `compaction_model` | agent, model, or provider | Delegate the compaction (summary-generation) call to a different, usually cheaper and faster, model. The agent-level value wins, then the model-level value, then the provider-level default. | + +Lower the threshold to compact earlier and keep individual requests smaller and cheaper; raise it to keep more verbatim history in context before the first summary happens: + +```yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + # Compact at 80% of the window instead of the default 90%. + compaction_threshold: 0.8 +``` + +Compaction itself is a model call — feeding the full conversation to a model and asking for a summary — and it's the most expensive call in a session simply because it's the one that runs when the context is largest. There's rarely a reason to spend your primary reasoning model on it. Point `compaction_model` at something smaller instead; every other call still runs on the primary model: + +```yaml +models: + primary: + provider: anthropic + model: claude-sonnet-4-5 + compaction_model: fast + fast: + provider: anthropic + model: claude-haiku-4-5 +``` + +> [!IMPORTANT] +> **Context window mismatch** +> +> If `compaction_model` has a **smaller** context window than the primary model, Docker Agent triggers compaction against the smaller window so the summary call can always ingest the full conversation. Pair the primary model with a compaction model whose window is at least as large to keep the proactive trigger aligned with the primary model's window. +> +> The `/context` header and the sidebar's context gauge surface this cap when it applies: the `/context` header shows a second line reading "compaction cap: `<model>` • `<N>` tokens", and the sidebar shows a short "⚠ capped" marker. Live-sessions rows do not carry cap wording; the sidebar marker deliberately doesn't repeat the model name or figure — the `/context` header is the sole authority on why the reported limit is smaller than the primary model's own window. + +Disable compaction only when you specifically want a session to keep full, unabridged history and are willing to risk hitting the context limit: + +```yaml +agents: + archivist: + model: anthropic/claude-sonnet-4-5 + description: An assistant that never auto-compacts its sessions. + instruction: You keep full conversation history and never lose context. + session_compaction: false +``` + +See [`examples/compaction_model.yaml`](https://github.com/docker/docker-agent/blob/main/examples/compaction_model.yaml) and [`examples/compaction_threshold.yaml`](https://github.com/docker/docker-agent/blob/main/examples/compaction_threshold.yaml) for complete configurations, and [Delegating Session Compaction](../../configuration/models/index.md#delegating-session-compaction) in the Model Config reference for the full field-level details. + +## Compact on demand + +You don't have to wait for the automatic threshold. Two TUI commands give you direct control: + +- **`/compact`** — summarize and compact the current session's history right now, regardless of how full the context window is. Useful before starting a new phase of work that doesn't need the earlier detail. +- **`/context`** — open a context-window breakdown: estimated tokens per category (system prompt, tool definitions, prompt files, messages, tool results, compaction summary), a **Live sessions** view listing the current session plus every running sub-agent session with its own context budget, and a per-file inventory of attachments and prompt files. When a compaction has occurred, the dialog also displays the verbatim text of the most recent compaction summary, preserving hard newlines and soft-wrapping long lines to the dialog width. + +From `/context`, select any live session with the arrow keys and press <kbd>Enter</kbd> to explicitly compact it — including a sub-agent's session, not just the main one. This is the only way cross-agent compaction happens: there's no idle-triggered automatic compaction of sub-agent sessions, so a long-running background agent stays under your control. The request is queued onto the target session's own run loop and applied at the next safe point between model turns, so it never corrupts an in-flight turn. + +```bash +$ docker agent run agent.yaml +# ... work for a while ... +# Type /context to see the current breakdown, or /compact to summarize now +``` + +## Trim tool results to save room + +Compaction deals with the whole conversation at once. For sessions dominated by a few oversized tool results — a full build log, a large file dump — three agent-level fields let you cap the damage before it ever reaches compaction: + +| Field | What it bounds | Behavior | +| --- | --- | --- | +| `max_tool_result_tokens` | Each tool result, as it's added to the session | Oversized results are truncated **middle-out**: the head and tail are kept (usually the most informative parts) and the removed middle is replaced with a truncation marker. | +| `max_old_tool_call_tokens` | The total budget for **old** tool call arguments and results | Once older tool calls exceed the budget, their content is replaced wholesale with a placeholder — freeing context space without touching recent, still-relevant calls. | +| `num_history_items` | The number of non-system conversation messages kept in history | A message-**count** limit, not a token budget. The oldest non-protected messages are dropped first once the count is exceeded; **system and user messages are always protected** and are never counted against or removed by this limit, so the assembled history can exceed `num_history_items` and every user message survives even a long single-turn agentic loop. | + +`max_tool_result_tokens` and `max_old_tool_call_tokens` are approximated as `len/4` tokens (the industry rule-of-thumb of ~4 characters per token); `num_history_items` counts messages, not tokens. All three are disabled by default (`0`). Set a positive value to enable them: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: An assistant whose tool results are capped at ~2000 tokens each. + instruction: | + You are a helpful assistant with shell access. Very large command + outputs are truncated in the middle — the beginning and end are + always preserved, and a marker shows where content was removed. + max_tool_result_tokens: 2000 + toolsets: + - type: shell +``` + +> [!TIP] +> **Use both together** +> +> `max_tool_result_tokens` bounds each result the moment it's recorded; `max_old_tool_call_tokens` reclaims space from calls that are no longer fresh. Combine them on tool-heavy agents (shell, filesystem) to keep the session lean well before it approaches the compaction threshold. + +See [`examples/max_tool_result_tokens.yaml`](https://github.com/docker/docker-agent/blob/main/examples/max_tool_result_tokens.yaml) for a complete example, and [Agent Config](../../configuration/agents/index.md#properties-reference) for the full field reference. + +## Read the context gauge + +The TUI's sidebar token-usage section (and the fill bar in the [lean TUI](../../features/tui/index.md#lean-tui) status line) color-escalates as a session approaches its compaction threshold, so you can see trouble coming before a request fails: + +| State | Color | Trigger | +| --- | --- | --- | +| Normal | (default) | Usage below 75% of the compaction threshold | +| Warning | Orange | Usage at or above 75% of the compaction threshold | +| Critical | Red | Usage at or above 95% of the compaction threshold | + +While a compaction is running, the percentage is replaced by a **"compacting…"** indicator; token counts remain visible in the lean TUI status line. The thresholds scale with the agent's configured `compaction_threshold` (default `0.9`), so a custom value keeps a predictable visual runway — for example, a `compaction_threshold: 0.8` session turns orange at 60% usage (75% of 0.8) instead of 67.5%. + +Open `/context` at any time for the full per-category breakdown behind that percentage. + +## What happens to cost across compaction + +Compaction summarizes history, but it never resets what a session has actually cost you. Session cost tracking is **monotonic across compaction**: the running total only ever goes up, even though the summarized conversation itself is now smaller. Check `/cost` to see the current breakdown at any point, before or after a compaction has run. + +## Related: deferred tool loading + +Compaction and result trimming manage context that's already in the session. If large toolsets are inflating your **starting** context instead — many MCP servers, hundreds of tools — look at [deferred tool loading](../../configuration/tools/index.md#deferred-tool-loading), which registers a toolset's tools lazily instead of eagerly at startup. diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/go-sdk/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/go-sdk/index.md new file mode 100644 index 000000000000..909729e16f3c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/go-sdk/index.md @@ -0,0 +1,650 @@ +--- +title: "Go SDK" +description: "Use Docker Agent as a Go library to embed AI agents in your applications." +keywords: docker agent, ai agents, guides, go sdk +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/guides/go-sdk/ +--- + +_Use Docker Agent as a Go library to embed AI agents in your applications._ + +## Overview + +Docker Agent can be used as a Go library, allowing you to build AI agents directly into your Go applications. This gives you full programmatic control over agent creation, tool integration, and execution. + +> [!NOTE] +> **Import Path** +> +> ```go +> import "github.com/docker/docker-agent/pkg/..." +> ``` + +## Core Packages + +| Package | Purpose | +| ---------------------- | ---------------------------------------- | +| `pkg/agent` | Agent creation and configuration | +| `pkg/runtime` | Agent execution and event streaming | +| `pkg/session` | Conversation state management | +| `pkg/team` | Multi-agent team composition | +| `pkg/tools` | Tool interface and utilities | +| `pkg/tools/builtin` | Built-in tools (shell, filesystem, etc.) | +| `pkg/model/provider/*` | Model provider clients | +| `pkg/config/latest` | Configuration types | +| `pkg/environment` | Environment and secrets | +| `pkg/embeddedchat` | Headless chat session for embedding the agent runtime in a custom UI | +| `pkg/tui/components/toolconfirm` | Tool-confirmation policy: `Decision` enum, `BuildPermissionPattern`, key bindings, and rejection-reason presets. Share this instead of copying the permission-pattern logic. | +| `pkg/tui/service` | `StaticSessionState` — a `SessionStateReader` with conservative fixed values, for rendering message/tool views outside the full TUI app. Replaces hand-rolled nine-method stubs. | +| `pkg/tui/animation` | `Stopper` / `StopView` — animation lifecycle contract. Call `StopAnimation` on views removed from the UI to prevent leaked tick subscriptions. | +| `pkg/tui/components/transcript` | Embedded transcript view with read-only `Messages()` accessor for observing conversation structure in host tests and persistence layers. | + +## Embedding TUI Components + +When building custom UIs on top of Docker Agent's TUI primitives, four packages define the contracts that keep the runtime and the UI in sync: + +- **`pkg/tui/components/toolconfirm`** — import this package for the permission-decision policy rather than copying the pattern-building logic. The `Decision` enum, `BuildPermissionPattern` helper, and rejection-reason presets are the canonical source of truth: whatever pattern is shown to the user in the confirmation dialog is exactly the pattern granted to the runtime. +- **`pkg/tui/service`** — use `StaticSessionState` as a stub `SessionStateReader` when rendering individual message or tool views outside the full TUI app. It returns conservative fixed values for all nine interface methods, eliminating the need for hand-rolled stubs. +- **`pkg/tui/animation`** — implement `animation.Stopper` on any view that owns a tick-based animation. Call `StopAnimation` whenever a view is removed from the UI hierarchy to prevent leaked `time.Tick` subscriptions from firing against a dead view. +- **`pkg/tui/components/transcript`** — embed the transcript view for displaying conversation history. Use the `Messages()` method to read the current slice of transcript messages (treat as read-only — mutations desync renders). This is useful for host-side tests asserting on chat history, and for persistence layers that need to snapshot conversation state. + +## Headless Embedded Chat (`pkg/embeddedchat`) + +`pkg/embeddedchat` is a thin wrapper around the Docker Agent runtime that lets you drive an agent from your own UI instead of running Docker Agent's Bubble Tea application. It handles runtime construction, event projection, and conversation state, exposing a simple `Send` / `Confirm` / `Restart` / `Close` API. + +### Creating a session + +```go +import ( + "context" + "fmt" + "strings" + + dagentcfg "github.com/docker/docker-agent/pkg/config" + dagentruntime "github.com/docker/docker-agent/pkg/runtime" + "github.com/docker/docker-agent/pkg/embeddedchat" +) + +chat, err := embeddedchat.New(ctx, embeddedchat.Config{ + // AgentSource can be a file path, raw YAML bytes, or an OCI reference. + AgentSource: dagentcfg.NewBytesSource("agent", []byte(agentYAML)), +}) +if err != nil { + return err +} +defer chat.Close() +``` + +### Sending a message and reading events + +`Send` appends the user message to the conversation and returns a channel of `Event` values. Drain the channel until it closes. + +```go +events, err := chat.Send(ctx, "Hello! What can you do?") +if err != nil { + return err +} + +var response strings.Builder +for ev := range events { + switch { + case ev.Text != "": + response.WriteString(ev.Text) + case ev.Tool != nil && ev.Tool.NeedsConfirmation: + // Approve the pending tool call (use ResumeApproveSession to allow all). + if err := chat.Confirm(ctx, dagentruntime.ResumeApprove()); err != nil { + return err + } + case ev.Tool != nil && ev.Tool.Finished: + fmt.Printf("[tool %s finished]\n", ev.Tool.Def.Name) + case ev.Err != nil: + fmt.Printf("error: %v\n", ev.Err) + case ev.Done: + fmt.Println("\n[turn complete]") + } +} +fmt.Print(response.String()) +``` + +### Restarting the conversation + +To start a fresh conversation without recreating the runtime: + +```go +if err := chat.Restart(); err != nil { + return err +} +``` + +### Event types + +| Field | When set | +| -------------- | ------------------------------------------------------------------------ | +| `Text` | Assistant text delta; accumulate into a string for the full reply. | +| `Tool` | A tool call started, needs confirmation, or finished. | +| `Tool.NeedsConfirmation` | Runtime is blocked until `Confirm` is called. | +| `Tool.Finished` | Tool call completed; `Tool.IsError` is true if it errored. | +| `Err` | A user-facing runtime error; no further content events follow. | +| `Done` | Clean end of turn; no more events. | +| `RuntimeEvent` | The original `runtime.Event` for callers that need the full stream. | + +For advanced use (custom elicitation, raw event inspection), call `chat.Runtime()` to access the underlying `runtime.Runtime` directly. + +> [!WARNING] +> **Breaking change: `Runtime.ResumeElicitation` (#3584)** +> +> `Runtime.ResumeElicitation` gained an `elicitationID` parameter so responses can +> be correlated with a specific concurrent elicitation request (needed once +> multiple background jobs can be eliciting input at the same time). It is +> declared **variadic** (`elicitationID ...string`) specifically so existing +> *callers* of the 3-argument form keep compiling unchanged — `rt.ResumeElicitation(ctx, action, content)` +> still works and falls back to resolving the sole pending request. +> +> If you implement your own `runtime.Runtime` (rather than embedding +> `runtime.LocalRuntime`/`runtime.RemoteRuntime`), you do need to update your +> method's signature to match, and also add an `OnElicitationRequest(handler +> func(runtime.Event))` method (a no-op is fine if your runtime never raises +> elicitations) — both are required interface methods, matching the existing +> no-op-able pattern already used by `OnToolsChanged`/`OnBackgroundEvent`. + +## Optional Provider Build Tags + +By default Docker Agent includes all four cloud providers (OpenAI, Anthropic, Google, Amazon Bedrock). When embedding Docker Agent in your own binary you can compile out unneeded providers — together with their transitive SDK dependencies — to reduce binary size. + +Each provider is gated by a negative build tag prefixed `docker_agent_` to avoid collisions with your own project's tags: + +| Build tag | Provider dropped | Major dependency removed | +| ---------------------------- | ------------------------ | ------------------------------------------------- | +| `docker_agent_no_openai` | OpenAI | `github.com/openai/openai-go` | +| `docker_agent_no_anthropic` | Anthropic | `github.com/anthropics/anthropic-sdk-go` (partial — see note) | +| `docker_agent_no_google` | Google / Vertex AI | `google.golang.org/genai`, Vertex auth stack, and indirectly the Anthropic and OpenAI SDKs via Vertex Model Garden | +| `docker_agent_no_bedrock` | Amazon Bedrock | `github.com/aws/aws-sdk-go-v2` stack (the largest provider dependency tree) | + +To build without Bedrock and OpenAI: + +```bash +go build -tags 'docker_agent_no_bedrock docker_agent_no_openai' ./... +``` + +Requesting a model whose provider was compiled out fails at construction time with a clear `"not compiled into this build"` error. The `dmr` (Docker Model Runner) provider and the rule-based router are always compiled in. + +> [!WARNING] +> **Anthropic + Google dependency** +> +> The Google provider's Vertex Model Garden support also imports the Anthropic SDK, so the Anthropic dependency is only fully removed when _both_ `docker_agent_no_anthropic` and `docker_agent_no_google` are set. + +## RAG Toolset (opt-out) + +The RAG toolset (`type: rag`) is included in `NewDefaultToolsetRegistry()` (from `pkg/teamloader/toolsets`) and `loaderdefaults.Opts()` (from `pkg/teamloader/defaults`, using the conventional import alias `loaderdefaults`). + +The underlying tree-sitter code parser uses cgo, but build-tag guards in `pkg/rag/treesitter` mean importing the package is safe regardless of `CGO_ENABLED`: with `CGO_ENABLED=0` the parser stub compiles in and returns a runtime error on first use rather than failing at compile time. + +If you want to exclude the RAG toolset from your binary entirely — surfacing a load-time warning on the agent rather than a deferred runtime error from the `!cgo` stub — remove it from the registry before passing it to `teamloader.Load`: + +```go +import ( + "github.com/docker/docker-agent/pkg/teamloader" + loadertoolsets "github.com/docker/docker-agent/pkg/teamloader/toolsets" +) + +// Opt out of the RAG toolset; a config that declares type: rag attaches +// a load-time warning to the agent instead of failing at document processing. +creators := loadertoolsets.DefaultToolsetCreators() +delete(creators, "rag") +registry := teamloader.NewToolsetRegistry(creators) +``` + +Pass the custom registry via `teamloader.WithToolsetRegistry(registry)` when calling `teamloader.Load`. Note that `teamloader.Load()` does not return an error for unknown toolset types — the failure is recorded as a load-time warning and can be retrieved with `agent.DrainWarnings()`; it is also surfaced via logging and TUI notifications. + +## Registering Custom Built-in Themes + +When embedding Docker Agent, you can contribute your own built-in themes via `styles.RegisterBuiltinThemes`. Registered themes integrate seamlessly with the existing theme picker, `/theme` command, and `settings.theme` config key — they behave exactly like Docker Agent's own bundled themes. + +```go +import ( + "embed" + + "github.com/docker/docker-agent/pkg/tui/styles" +) + +//go:embed themes/*.yaml +var brandThemes embed.FS + +// Call at startup, before applying any persisted theme: +if err := styles.RegisterBuiltinThemes(brandThemes); err != nil { + return err +} +``` + +Each theme file lives at `themes/<name>.yaml` inside the embedded filesystem and is a **partial override** — only the colors you want to change are required; everything else falls back to `DefaultTheme()`. + +```yaml +# themes/brand.yaml +name: Brand +colors: + accent: "#FF6A00" + background: "#1A0F0A" +``` + +If `name:` is omitted, Docker Agent uses the filename stem as the display name in the theme picker (e.g. `brand` from `themes/brand.yaml`). + +To replace Docker Agent's default theme entirely, ship the file as `themes/default.yaml` — it masks the bundled default while inheriting any colors you don't set. + +**Semantics:** + +- Registered sources take precedence over bundled themes; a registered ref overrides a bundled theme of the same name. +- Among multiple registered sources, last-registered wins on a collision. +- `RegisterBuiltinThemes` validates eagerly (nil fs, missing `themes/` dir) so errors surface at registration time, not at picker time. + +## MCP OAuth Token Persistence + +By default, MCP OAuth tokens are stored in-memory only and are not persisted across process restarts. The CLI registers a keyring-backed store automatically at startup; when embedding Docker Agent as a library you must do this yourself if you want tokens to survive restarts. + +Call `keyringstore.Register()` **before** any MCP toolset is initialised to enable the OS keyring-backed token store: + +```go +import "github.com/docker/docker-agent/pkg/tools/mcp/keyringstore" + +func main() { + // Must be called before teamloader.Load() on configs with remote MCP + // toolsets; calling it after the store is created panics. + keyringstore.Register() + // ... rest of your startup code +} +``` + +> [!WARNING] +> **Call order matters** +> +> If `keyringstore.Register()` is called after the default token store has already been lazily initialised, Docker Agent panics. The store is initialised when any remote MCP toolset is constructed — which happens inside `teamloader.Load()`. Always call `keyringstore.Register()` before calling `teamloader.Load()` on a config that includes remote MCP toolsets. + +If you do not need persistent OAuth tokens (for example, in short-lived batch jobs or tests), omit the call and tokens will be kept in-memory for the process lifetime. + +## JavaScript Command Expressions (opt-in) + +Slash-command instructions can embed `${...}` JavaScript expressions (`${args[0]}`, `${args.join(" ")}`, `${tool({...})}`). Evaluating them requires the goja JavaScript engine, which is deliberately kept out of `pkg/runtime`'s import graph so code-built embedders don't link it by default. + +The CLI, `teamloader.Load()`, `pkg/cli.Run()` and `embeddedchat/defaults` enable it automatically. If you build teams in code, call `runtime.ResolveCommand` (or `cli.PrepareUserMessage`) directly **and** use `${...}` expressions in commands, register the evaluator yourself: + +```go +import "github.com/docker/docker-agent/pkg/runtime/jscommands" + +func main() { + jscommands.Register() + // ... rest of your startup code +} +``` + +Without the registration, `${...}` expressions are left unexpanded and a warning naming the fix is logged; everything else about command resolution (including the legacy `!tool(...)` syntax) works as usual. + +## Basic Example + +Create a simple agent and run it: + +```go +package main + +import ( + "context" + "fmt" + "log" + "os/signal" + "syscall" + + "github.com/docker/docker-agent/pkg/agent" + "github.com/docker/docker-agent/pkg/config/latest" + "github.com/docker/docker-agent/pkg/environment" + "github.com/docker/docker-agent/pkg/model/provider/openai" + "github.com/docker/docker-agent/pkg/runtime" + "github.com/docker/docker-agent/pkg/session" + "github.com/docker/docker-agent/pkg/team" +) + +func main() { + ctx, cancel := signal.NotifyContext(context.Background(), + syscall.SIGINT, syscall.SIGTERM) + defer cancel() + + if err := run(ctx); err != nil { + log.Fatal(err) + } +} + +func run(ctx context.Context) error { + // Create model provider + llm, err := openai.NewClient( + ctx, + &latest.ModelConfig{ + Provider: "openai", + Model: "gpt-4o", + }, + environment.NewDefaultProvider(), + ) + if err != nil { + return err + } + + // Create agent + assistant := agent.New( + "root", + "You are a helpful assistant.", + agent.WithModel(llm), + agent.WithDescription("A helpful assistant"), + ) + + // Create team and runtime + t := team.New(team.WithAgents(assistant)) + rt, err := runtime.New(t) + if err != nil { + return err + } + + // Run with a user message + sess := session.New( + session.WithUserMessage("What is 2 + 2?"), + ) + + messages, err := rt.Run(ctx, sess) + if err != nil { + return err + } + + // Print the response + fmt.Println(messages[len(messages)-1].Message.Content) + return nil +} +``` + +## Custom Tools + +Define custom tools for your agent: + +```go +package main + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/docker/docker-agent/pkg/tools" +) + +// Define the tool's input schema +type AddNumbersArgs struct { + A int `json:"a"` + B int `json:"b"` +} + +// Implement the tool handler +func addNumbers(_ context.Context, toolCall tools.ToolCall) (*tools.ToolCallResult, error) { + var args AddNumbersArgs + if err := json.Unmarshal([]byte(toolCall.Function.Arguments), &args); err != nil { + return nil, err + } + + result := args.A + args.B + return tools.ResultSuccess(fmt.Sprintf("%d", result)), nil +} + +func main() { + // Create the tool definition + addTool := tools.Tool{ + Name: "add", + Category: "math", + Description: "Add two numbers together", + Parameters: tools.MustSchemaFor[AddNumbersArgs](), + Handler: addNumbers, + } + + // Use with an agent + calculator := agent.New( + "root", + "You are a calculator. Use the add tool for arithmetic.", + agent.WithModel(llm), + agent.WithTools(addTool), + ) + // ... +} +``` + +## Streaming Responses + +Process events as they happen: + +```go +func runStreaming(ctx context.Context, rt runtime.Runtime, sess *session.Session) error { + events := rt.RunStream(ctx, sess) + + for event := range events { + switch e := event.(type) { + case *runtime.StreamStartedEvent: + fmt.Println("Stream started") + + case *runtime.AgentChoiceEvent: + // Print response chunks as they arrive + fmt.Print(e.Content) + + case *runtime.ToolCallEvent: + fmt.Printf("\n[Tool call: %s]\n", e.ToolCall.Function.Name) + + case *runtime.ToolCallConfirmationEvent: + // Auto-approve tool calls + rt.Resume(ctx, runtime.ResumeRequest{ + Type: runtime.ResumeTypeApproveSession, + }) + + case *runtime.ToolCallResponseEvent: + fmt.Printf("[Tool response: %s]\n", e.Response) + + case *runtime.StreamStoppedEvent: + fmt.Println("\nStream stopped") + + case *runtime.ErrorEvent: + return fmt.Errorf("error: %s", e.Error) + } + } + + return nil +} +``` + +## Multi-Agent Teams + +Create agents that delegate to sub-agents: + +```go +package main + +import ( + "github.com/docker/docker-agent/pkg/agent" + "github.com/docker/docker-agent/pkg/team" + "github.com/docker/docker-agent/pkg/tools/builtin" +) + +func createTeam(llm provider.Provider) *team.Team { + // Create a child agent + researcher := agent.New( + "researcher", + "You research topics thoroughly.", + agent.WithModel(llm), + agent.WithDescription("Research specialist"), + ) + + // Create root agent with sub-agents + coordinator := agent.New( + "root", + "You coordinate research tasks.", + agent.WithModel(llm), + agent.WithDescription("Team coordinator"), + agent.WithSubAgents(researcher), + agent.WithToolSets(builtin.NewTransferTaskTool()), + ) + + return team.New(team.WithAgents(coordinator, researcher)) +} +``` + +## Built-in Tools + +Use Docker Agent's built-in tools: + +```go +import ( + "github.com/docker/docker-agent/pkg/config" + "github.com/docker/docker-agent/pkg/tools/builtin" +) + +func createAgentWithBuiltinTools(llm provider.Provider) *agent.Agent { + // Runtime config for tools that need it + rtConfig := &config.RuntimeConfig{ + Config: config.Config{ + WorkingDir: "/path/to/workdir", + }, + } + + return agent.New( + "root", + "You are a developer assistant.", + agent.WithModel(llm), + agent.WithToolSets( + // Shell tool for running commands + builtin.NewShellTool(os.Environ(), rtConfig), + // Filesystem tools + builtin.NewFilesystemTool(rtConfig.Config.WorkingDir), + // Think tool for reasoning + builtin.NewThinkTool(), + // Todo tool for task tracking + builtin.NewTodoTool(), + ), + ) +} +``` + +## HTTP Middleware / Transport Wrappers + +Use `options.WithHTTPTransportWrapper` to inject HTTP middleware into the transport chain of all provider clients built by Docker Agent. This is useful for request tracing, injecting custom headers, collecting metrics, or any other cross-cutting concern at the HTTP layer. + +```go +import ( + "net/http" + + "github.com/docker/docker-agent/pkg/model/provider/options" +) + +type headerTransport struct { + base http.RoundTripper +} + +func (t *headerTransport) RoundTrip(req *http.Request) (*http.Response, error) { + req = req.Clone(req.Context()) + req.Header.Set("X-Request-Source", "my-app") + return t.base.RoundTrip(req) +} + +// Example: add a custom header to every outbound LLM request +wrapper := options.WithHTTPTransportWrapper( + func(base http.RoundTripper) http.RoundTripper { + return &headerTransport{base: base} + }, +) + +client, err := openai.NewClient(ctx, &latest.ModelConfig{ + Provider: "openai", + Model: "gpt-4o", +}, env, wrapper) +``` + +The wrapper receives the already-instrumented transport (OpenTelemetry, SSE decompression, Desktop proxy support) as its `base` argument, so wrapping it preserves all built-in behaviour. + +**Supported providers:** Anthropic, OpenAI, Gemini (GeminiAPI backend), Bedrock. Works in both direct and gateway/proxy mode. + +> [!WARNING] +> **Vertex AI not supported** +> +> Vertex AI uses an ADC-managed HTTP client that Docker Agent cannot intercept. When a transport wrapper is set, Docker Agent falls back to the GeminiAPI backend instead of Vertex AI — a debug message is logged. + +In **gateway mode** the wrapper is called on every LLM request because gateway clients are rebuilt each call for short-lived auth tokens. In **direct mode** it is called once at client construction. Rate-limit responses (HTTP 429) are classified as non-retryable by the runtime and cause the model chain to skip to the next fallback, so wrappers that track per-request outcomes will observe these as failures rather than retried calls. + +Returning `nil` from your wrapper function is not allowed; Docker Agent logs a warning and keeps the original transport instead. + +## Using Different Providers + +```go +import ( + "github.com/docker/docker-agent/pkg/model/provider/anthropic" + "github.com/docker/docker-agent/pkg/model/provider/gemini" + "github.com/docker/docker-agent/pkg/model/provider/openai" +) + +// OpenAI +openaiClient, _ := openai.NewClient(ctx, &latest.ModelConfig{ + Provider: "openai", + Model: "gpt-4o", +}, env) + +// Anthropic +anthropicClient, _ := anthropic.NewClient(ctx, &latest.ModelConfig{ + Provider: "anthropic", + Model: "claude-sonnet-4-5", +}, env) + +// Google Gemini +geminiClient, _ := gemini.NewClient(ctx, &latest.ModelConfig{ + Provider: "google", + Model: "gemini-3.5-flash", +}, env) +``` + +## Session Options + +```go +import "github.com/docker/docker-agent/pkg/session" + +sess := session.New( + // Set a title for the session + session.WithTitle("Code Review Task"), + + // Add user message + session.WithUserMessage("Review this code for bugs"), + + // Limit iterations + session.WithMaxIterations(20), +) +``` + +## Error Handling + +```go +messages, err := rt.Run(ctx, sess) +if err != nil { + if errors.Is(err, context.Canceled) { + // User cancelled + log.Println("Operation cancelled") + return nil + } + if errors.Is(err, context.DeadlineExceeded) { + // Timeout + log.Println("Operation timed out") + return nil + } + // Other error + return fmt.Errorf("runtime error: %w", err) +} + +// Check for errors in the event stream +for event := range rt.RunStream(ctx, sess) { + if errEvent, ok := event.(*runtime.ErrorEvent); ok { + return fmt.Errorf("stream error: %s", errEvent.Error) + } +} +``` + +## Complete Example + +See the [examples/golibrary](https://github.com/docker/docker-agent/tree/main/examples/golibrary) directory for complete working examples: + +- `simple/` — Basic agent with no tools +- `tool/` — Custom tool implementation +- `stream/` — Streaming event handling +- `multi/` — Multi-agent with sub-agents +- `builtintool/` — Using built-in tools diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/headless/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/headless/index.md new file mode 100644 index 000000000000..76a87bd4d505 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/headless/index.md @@ -0,0 +1,225 @@ +--- +title: "Running Agents Headless & in CI" +description: "Run Docker Agent without a TUI: structured JSON output, event hooks, sandboxed CI isolation, and a GitHub Actions example." +keywords: docker agent, ai agents, guides, headless, ci, github actions, sandbox +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/guides/headless/ +--- + +_Run Docker Agent without a TUI: structured JSON output, event hooks, sandboxed CI isolation, and a GitHub Actions example._ + +## `--exec` Mode Basics + +`--exec` runs an agent without the interactive TUI: output goes to stdout and the process exits when the conversation is done. It's the mode to use in scripts, CI, and any context without a terminal. + +```bash +# One-shot task, message as an argument +$ docker agent run --exec agent.yaml "Summarize the open issues in this repo" + +# Pipe the message via stdin instead +$ echo "Summarize the open issues in this repo" | docker agent run --exec agent.yaml - + +# Multiple messages are processed as a multi-turn conversation, in order +$ docker agent run --exec agent.yaml "question 1" "question 2" "question 3" +``` + +See [`docker agent run --exec`](../../features/cli/index.md#docker-agent-run---exec) for the full flag reference. + +## Choosing a Large-Input Strategy + +Docker Agent has several unrelated mechanisms for getting a large document, file, or dataset in front of an agent. Which one fits depends on whether the content is local to the machine running Docker Agent, how often it needs to be revisited, and whether you're driving the agent through the CLI/TUI or over one of the HTTP servers: + +| You have… | Use… | Notes | +| --- | --- | --- | +| A file on disk, for one interactive turn | `@path` or `/attach` in the TUI (see [File Attachments](../../features/tui/index.md#file-attachments)), `--attach` at startup (seeds an interactive TUI run just as readily as `--exec`), or `/attach` under `--exec` | Read from the local filesystem and inlined into the message once it clears a local admission check. That never crosses Docker Agent's own inbound HTTP boundary for a local (non-`--remote`) run or for the *first* message of a `--remote` run — but a locally resolved attachment added to a *later* message on a remote run does cross it; see the remote-runtime row below. The admission check itself, and how a rejection is reported, differ by entry point; see the read-time limits below. | +| Instructions/context every agent turn should see | `add_prompt_files` in the agent config, or `--prompt-file` on the CLI (see [Prompt Files](../../configuration/agents/index.md#prompt-files)) | Re-read from disk **in full** on every turn and injected as instruction context; local, not an HTTP upload, and not subject to the attachment inlining checks above — memory and the model's context window are the practical ceilings. | +| A one-off piece of text for a **local** headless run | stdin, without `--remote` (see [`--exec` Mode Basics](#--exec-mode-basics) above) | The piped text becomes the message directly; it never crosses Docker Agent's own inbound HTTP boundary and has no size cap of its own, though Docker Agent may still send it onward to a model/provider over HTTP. | +| A one-off piece of text driving a **remote** runtime | stdin with `docker agent run --remote ... -` | The CLI serializes that stdin text into a native API run request sent to whichever Docker Agent server the `--remote` address points at — a `serve api` process or another run's [`--listen`](../../features/api-server/index.md#listen) control plane, never `serve chat` — so it's measured against that server's own limit: `serve api`'s configurable `--max-request-size`, or a `--listen` control plane's fixed, non-configurable 1 MiB cap. See the HTTP body limit below. That *initial* request carries only message text: conversion currently drops any attachment resolved locally (`@path`/`/attach`, `--attach`) for the first message before it's sent. A *later* message to the same remote run — sent while the agent is still busy, via the default steer behavior or an explicit follow-up (Alt+Enter) — does forward a locally resolved attachment as part of that native API request, so it counts toward the same limit and can 413 like any other oversized request. Client-side `--prompt-file` values are **not** forwarded to a remote runtime either way; prompt files configured on the agent itself (`add_prompt_files`) still resolve, but on the server's filesystem. | +| A document collection you'll query repeatedly, or one too large to inline at all | The [`rag` toolset](../../tools/rag/index.md) | Indexed once in the background; each query retrieves only the relevant chunks into context, instead of the whole collection. | +| An OpenAI-compatible client driving Docker Agent over HTTP | [Chat Server](../../features/chat-server/index.md) | Accepts OpenAI-style `text` and [`image_url`](../../features/chat-server/index.md#image-inputs) content parts. The whole request travels as a single HTTP body capped by that server's `--max-request-size`; a data URL's bytes count toward it, while a remote `http(s)://` image URL is passed to the provider rather than fetched by the chat server, and works only if that provider/model supports it. | +| A native integration driving Docker Agent's own session/control protocol | [API Server](../../features/api-server/index.md) | Supports the documented session, run, and event-streaming flows over a single capped HTTP body; see the note below on the upload contract this does *not* provide. | +| A supervisor process driving an already-running interactive session | An attached run's [`--listen`](../../features/api-server/index.md#listen) control plane | Exposes the same session/follow-up/event-streaming API as the API server, but with a fixed, non-configurable 1 MiB request-body cap and no `--auth-token` — there's no `--max-request-size` or `--auth-token` flag for this surface. Keep it on loopback, a unix socket, or behind an authenticating reverse proxy if it must be reachable from elsewhere. | + +Three independent ceilings apply, and hitting one says nothing about the others: + +1. **The HTTP body limit** — applies to any request reaching one of Docker Agent's three inbound HTTP surfaces: `docker agent serve api`, `docker agent serve chat`, or an interactive run's [`--listen`](../../features/api-server/index.md#listen) control plane. `docker agent run --remote ... -` builds a native run request from stdin and sends it to whichever of `serve api` or a `--listen` control plane the remote address points at — never `serve chat`, which speaks a different protocol. `serve api` and `serve chat` each enforce their own `--max-request-size` (1 MiB default, configurable) and return `413 Request Entity Too Large` above it; a `--listen` control plane enforces the same 1 MiB default but exposes no `--max-request-size` flag (or `--auth-token`) to change it — it's fixed, and reducing the request is the only remedy. See [Troubleshooting: HTTP 413](../../community/troubleshooting/index.md#http-413-request-body-too-large) for how to diagnose and resolve it. Local (non-`--remote`) stdin and prompt files never cross this boundary; a locally resolved `@path`/`/attach`/`--attach` attachment doesn't either for a remote run's initial message, but one added to a later steer or follow-up message on that same remote run does — see the remote-runtime row above. +2. **Local read-time limits, which differ by path** — the TUI and non-TUI (CLI/`--exec`) message assembly don't share one text/binary rule. The TUI (both `/attach` and a typed `@path` reference) runs every file reference through one flat size ceiling *before* it looks at the file's type; non-TUI assembly — the CLI's `--attach` flag and `--exec`'s own `/attach` parsing — inlines text up to its own ceiling and hands supported binary files (images, PDFs) to a separate path with a higher cap, so a binary file that's fine for `--attach`/`--exec` can still be too big for the TUI's flatter, lower ceiling. Either way an oversized file is rejected rather than silently truncated or allowed to exhaust memory, but whether you're actually told about it depends on the surface: only the interactive TUI's `/attach` command shows a visible error notification (with a file-picker fallback), while a bare `@path` reference is only checked speculatively as you type — a rejection there is logged at debug level only, and the reference is left as plain text in your message with no on-screen notice. Outside the interactive TUI, neither the CLI's `--attach` flag nor `--exec`'s `/attach` (which reuses the same non-TUI assembly and rejection path as `--attach`, not the TUI's notification flow) prints anything about a rejected attachment in normal run output — the message just falls back to text-only, and the reason is visible only in the debug log when `--debug` is enabled. Prompt files (`add_prompt_files`/`--prompt-file`) have no equivalent guard — they're read in full on every turn regardless of size, so memory and the model's context window are what actually bound them. +3. **Model/provider context and media limits** — even content that clears the first two layers still has to fit the model's token/context window, and binary attachments (images, PDF, audio, video) only work if the model declares support for that media type (see [Attachment Capability Overrides](../../configuration/models/index.md#attachment-capability-overrides)). Exceeding the context window is a separate failure from either limit above — see [Context Window Exceeded](../../community/troubleshooting/index.md#context-window-exceeded). + +> [!NOTE] +> **No file-upload endpoint** +> +> None of Docker Agent's three inbound HTTP surfaces — the API server, the chat server, or an attached run's `--listen` control plane — exposes a multipart file-upload endpoint, and none of them fetches a remote URL on your behalf — the chat server's `image_url` support only ever passes a remote URL through to the provider (see the table above). Content reaches an agent either locally (`@path`/`/attach`, prompt files, `rag`) or embedded directly in the HTTP message body those servers already document; there is no separate attachment channel over any of them. + +## Structured Output for Machines + +Two independent things make an `--exec` run's output easy to parse: how the transcript is emitted, and what shape the model's own answer takes. + +**`--json`** switches the transcript itself from human-readable text to newline-delimited JSON: one JSON object per runtime event (messages, tool calls, tool results, errors, …), instead of formatted text interleaved with tool-call boxes. Pipe it into `jq` or any NDJSON-aware log processor: + +```bash +$ docker agent run --exec agent.yaml --json "List the 5 largest files in this repo" | jq -c 'select(.type == "agent_choice")' +``` + +**`structured_output`** constrains the *model's own response* to a JSON schema you define on the agent, independent of `--json`. Use it when downstream code needs the model's answer in a predictable shape (a list of findings, a classification, …) rather than free-form prose. See [Structured Output](../../configuration/structured-output/index.md) for the full field reference — combine it with `--json` in `--exec` to get both a parseable transcript and a schema-validated final answer. + +## Reacting to Events + +`--on-event <type>=<cmd>` runs a shell command whenever an event of the given type fires, with the event's JSON payload piped to the command's stdin. Use `*=<cmd>` to match every event type. The flag is repeatable. + +> [!WARNING] +> **`--on-event` does nothing under `--exec`** +> +> Event hooks are installed on the interactive App's event bus. A `docker agent run --exec` run returns before that wiring happens, so `--on-event` is silently a no-op there — no error, no hook ever runs. Use `--on-event` with a normal interactive run or `--lean` (which still installs hooks; it just skips the alternate screen). For a headless `--exec` run, get the same effect by parsing the `--json` NDJSON stream yourself and shelling out on the events you care about — for example `stream_stopped`, which fires when a turn ends normally. + +```bash +# Post a Slack notification when the agent finishes a turn (interactive or --lean only) +$ docker agent run agent.yaml --lean --on-event stream_stopped="./notify-slack.sh" "Fix the failing test" + +# Log every event to a file for later inspection +$ docker agent run agent.yaml --lean --on-event "*=cat >> events.ndjson" "Fix the failing test" + +# Headless equivalent: capture the --json NDJSON stream, then react to it yourself +$ docker agent run --exec agent.yaml --json "Fix the failing test" | tee events.ndjson +$ jq -e 'select(.type == "stream_stopped")' events.ndjson >/dev/null && ./notify-slack.sh +``` + +Hooks run asynchronously and are never waited on: each is spawned detached from the run's own context, and the process exits (`os.Exit`) as soon as the run finishes without waiting for, or signaling, any hook subprocess still in flight. A hook's own failure is logged but never fails the run — and, independent of that, its fate at process exit is unspecified: it may keep running as an orphaned process, or it may be torn down by whatever supervises the job (a CI runner tearing down its container, a shell killing its process group, …), depending on your environment rather than on anything docker-agent guarantees. Don't rely on `--on-event` for anything that must demonstrably finish before the process exits; have the hook script itself detach (e.g. `nohup`/`disown`) and/or write its own completion marker if you need proof it ran. + +## Running Unattended in CI + +Interactively, the TUI prompts for confirmation before a tool call runs unless it's covered by an `allow` permission pattern. There's no one to answer that prompt in CI, so an unattended `--exec` run needs an explicit policy for what may run without asking — otherwise every tool call the model attempts is rejected outright (there's no stdin to prompt, so `--exec` without one just answers "no" on your behalf; see [`--json`'s auto-reject behavior](#structured-output-for-machines) above). + +Two different questions come up here, and it's worth keeping them separate: + +- **What is allowed to run without asking?** — the safety mode (`--safety strict|balanced|restricted|autonomous`, with `--yolo` as the legacy spelling of `autonomous`) and permission allow-lists answer this. +- **What happens if the model runs something it shouldn't have?** — only `--sandbox` answers that one. The rest of this section explains why, and treats that distinction as the whole point. + +### `--sandbox`: the isolation boundary + +For an untrusted or autonomous agent — anything acting without a human watching approvals — **`--sandbox` is the isolation boundary to reach for**, not a cleverer allow-list. It runs the entire agent, shell calls included, inside a VM managed by [`sbx`](https://docs.docker.com/ai/sandboxes/): a misbehaving or successfully-prompt-injected agent can't touch anything outside the mounted working directory or reach other host/CI state, regardless of which command it runs. That VM isn't disposable or ephemeral — a sandbox matching the current workspace and mount set is retained and reused across subsequent runs rather than torn down when the session ends (see [How It Works](../../configuration/sandbox/index.md#how-it-works)). See [Sandbox Mode](../../configuration/sandbox/index.md) for the full flag reference, `sbx` requirement, network allowlist, and kit staging behavior. + +```bash +$ docker agent run --sandbox --exec agent.yaml --json "Fix the failing test" +``` + +Because the blast radius is contained by the VM boundary, `--sandbox` also makes unattended operation reasonable in CI — and it defaults to exactly that: unless you already passed a `--yolo` or `--safety` flag of your own, `--sandbox` injects `--yolo` for the agent process it runs inside the VM, so the command above already runs unattended with no confirmation prompts. Passing `--yolo` explicitly (`--sandbox --yolo --exec ...`) is equivalent and can make the intent clearer in a script, but it's optional. To keep confirmation prompts even inside the sandbox, select a stricter mode (`--sandbox --safety strict`) or opt out of the legacy default with `--yolo=false` — `--sandbox` only fills in `--yolo` when neither safety flag was set. + +If your CI provider already runs each job in its own disposable VM or container — many hosted runners do — and nothing on the runner matters once the job ends, that may already give you an isolation boundary on its own. `--sandbox` still gives you the same guarantee independent of the CI provider, and starts to matter as soon as the agent runs on a persistent self-hosted runner, a long-lived container, or your own workstation. + +### Defense in depth, not a boundary: permissions and shell command matching + +Permission allow-lists (`permissions.allow` on the agent, or `settings.permissions.allow` globally — see [Permissions](../../configuration/permissions/index.md)) and the balanced safety mode's shell classifier (see [Safety modes](../../configuration/permissions/index.md#safety-modes)) narrow what runs without asking. Used well, they cut down how often you're prompted and catch obviously destructive calls before they run. They are **not** a security boundary: + +- Both work by matching the shell command **string** (or, for `permissions`, the tool's arguments). The classifier's safe-list refuses to vouch for any command carrying shell metacharacters (`;`, `&`, `|`, `<`, `>`, backticks, `$(`, newlines — spaced or not), so `ls && rm -rf ~`, `grep foo|rm -rf /`, and `grep x > /etc/passwd` all fall through to a confirmation instead of inheriting a safe verdict. But string matching still can't reason about what a command actually *does* — see the next point. +- Command-string and argument matching in general can't reason about what a command actually does; a dynamically built string, an unusual quoting form, or a wrapper script can slip past any fixed set of patterns. + +For unattended runs, the `restricted` safety mode packages this stance as a fail-closed default: classifier-safe calls run, every other unmatched call is **denied outright** instead of falling through to a confirmation prompt nobody will answer. Pair it with an allow-list scoped to what the job actually needs — explicit `allow` rules still win over the mode, so the job's known-good commands run even when the classifier can't vouch for them: + +```yaml +# agent.yaml — the allow-list overrides restricted's deny for these calls +permissions: + allow: + - "shell:cmd=go test*" + - "shell:cmd=go build*" +``` + +```bash +# Safe and allow-listed calls run; every other call is denied without prompting +$ docker agent run --exec --safety restricted agent.yaml --json "Fix the failing test" +``` + +Like the allow-list itself, `restricted` is defense in depth, not a security boundary: it narrows what runs unattended, but only `--sandbox` contains what a misbehaving agent can do with the calls that are allowed. + +Treat permissions and the balanced/restricted modes as a way to reduce prompt fatigue and catch the obvious cases, paired with least-privilege CI credentials — never as the reason a CI job is safe to run unattended. For that, use `--sandbox`. + +> [!WARNING] +> **`--yolo` without `--sandbox` runs untrusted, unattended code with no boundary** +> +> A CI job is exactly the environment where a runaway or misled agent does the most damage before anyone notices — no one is at the keyboard to catch a bad `shell` call before it runs, and, per above, a permission allow-list or the shell classifier can't be trusted to catch everything either. If you can't add `--sandbox`, prefer `--safety restricted` with a permission allow-list scoped to what the job actually needs over blanket `--yolo`, and budget for the credentials and blast radius of the agent's toolsets as if the job itself were compromised — see [`examples/permissions.yaml`](https://github.com/docker/docker-agent/blob/main/examples/permissions.yaml) for a worked allow/deny list. + +> [!NOTE] +> **A worktree is not a security boundary either** +> +> [`--worktree`](../../features/cli/index.md#docker-agent-run) isolates *which branch and checkout* the agent modifies — it gives the agent its own working directory and branch so your primary checkout stays untouched — but the shell toolset still runs as a native process on the host, and the worktree shares the repository's underlying object store with the rest of your checkouts. It's checkout isolation, not a security boundary. Only `--sandbox` provides that. + +## Providing Secrets in CI + +Never put provider API keys or MCP tokens in the agent config file. Inject them as environment variables from your CI provider's secret store, or via `--env-from-file` with a file materialized at job start. See [Managing Secrets](../secrets/index.md) for every supported method, including Docker Compose secrets and 1Password references — both of which map cleanly onto CI secret stores. + +## Disabling Telemetry + +Docker Agent's anonymous usage telemetry is enabled by default. In CI you may want it off: + +```bash +$ TELEMETRY_ENABLED=false docker agent run --exec agent.yaml "..." +``` + +See [Telemetry](../../community/telemetry/index.md) for exactly what is (and isn't) collected. + +## Example: GitHub Actions + +A bare OCI registry reference (`myorg/coder`) has no local config you control, so a security-sensitive CI job should check in a small agent config instead. This example runs a checked-in review agent non-interactively against the repository being built: + +```yaml +# .github/agents/review-agent.yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Reviews the changes in a pull request for bugs and security issues + instruction: Review the changes in this PR for bugs and security issues. + toolsets: + - type: shell +``` + +```yaml +# .github/workflows/agent-review.yml +name: Agent code review +on: + pull_request: + +permissions: + contents: read + +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install docker-agent + run: | + curl -L "https://github.com/docker/docker-agent/releases/latest/download/docker-agent-linux-amd64" -o docker-agent + chmod +x docker-agent + sudo mv docker-agent /usr/local/bin/ + + - name: Run the review agent + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + TELEMETRY_ENABLED: "false" + run: | + docker-agent run --exec --yolo .github/agents/review-agent.yaml --json \ + "Review the changes in this PR for bugs and security issues" \ + | tee agent-events.ndjson + + - name: Upload transcript + if: always() + uses: actions/upload-artifact@v4 + with: + name: agent-events + path: agent-events.ndjson +``` + +This job auto-approves every shell call the review agent makes (`--yolo`) rather than trying to allow-list every `git`/`grep`/`cat` invocation a code review might need — the read surface for "review this diff" is open-ended, and a fixed pattern list is exactly the kind of shell-matching boundary the [previous section](#defense-in-depth-not-a-boundary-permissions-and-shell-command-matching) says not to rely on. If your CI environment has `sbx` installed and configured (GitHub-hosted `ubuntu-latest` does not ship it out of the box), add `--sandbox` and get a real isolation boundary around that `--yolo`: + +```bash +$ docker-agent run --sandbox --exec --yolo .github/agents/review-agent.yaml --json "..." +``` + +Without `--sandbox`, this workflow's safety instead rests on least-privilege secrets (only `ANTHROPIC_API_KEY` is injected — no repo-write token), the top-level `permissions: contents: read` block and `persist-credentials: false` on the checkout step (which together mean the job never holds a write-capable `GITHUB_TOKEN` and never persists one to disk for `git` to pick up), and the job running on a GitHub-hosted, ephemeral runner that's discarded after the job. + +This example omits the GitHub MCP toolset (`docker:github-official`) shown in earlier revisions of this guide: that server requires a `GITHUB_PERSONAL_ACCESS_TOKEN` this workflow doesn't provide, and — because the toolset above has no `name:` field — its tools would be exposed under their raw MCP names (`get_file_contents`, `search_code`, …) rather than a `github_*`-style qualified name, so permission patterns written against that prefix wouldn't match anything anyway. If your review agent needs GitHub API access, add the toolset back with an explicit `name: github`, wire `GITHUB_PERSONAL_ACCESS_TOKEN` through `env:` from a repository secret, and write any `permissions` patterns against the tool names it actually exposes (`github_get_*` only works once the toolset carries that `name:`). + +Swap the model, toolsets, and provider secret for your own — the shape (checkout, install the binary, run `--exec` with `--json` against a checked-in config, upload the transcript) generalizes to any CI provider that can run a shell step. diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/secrets/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/secrets/index.md new file mode 100644 index 000000000000..26fe93547132 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/secrets/index.md @@ -0,0 +1,247 @@ +--- +title: "Managing Secrets" +description: "How to securely provide API keys and credentials to Docker Agent using environment variables, env files, Docker Compose secrets, and 1Password references." +keywords: docker agent, ai agents, guides, managing secrets +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/guides/secrets/ +--- + +_How to securely provide API keys and credentials to Docker Agent._ + +## Overview + +Docker Agent needs API keys to talk to model providers (OpenAI, Anthropic, etc.) and MCP tool servers (GitHub, Slack, etc.). These keys are **never stored in config files**. Instead, Docker Agent resolves them at runtime through a chain of secret providers, checked in order (see `pkg/environment/default.go`): + +| Priority | Provider | Description | +| --- | --- | --- | +| 1 | [Environment variables](#environment-variables) | `export OPENAI_API_KEY=sk-...` | +| 2 | [Docker Compose secrets](#docker-compose-secrets) | Files in `/run/secrets/` | +| 3 | [Docker Agent env file](#docker-agent-env-file) | `~/.config/cagent/.env`, written by `docker agent setup` | +| 4 | [Credential helper](#credential-helper) | Custom command declared in `~/.config/cagent/config.yaml` under `credential_helper:` | +| 5 | [Docker Desktop](#docker-desktop) | Secrets stored by the Docker Desktop backend (no setup on a Desktop install) | + +The first provider that has a value wins. You can mix and match — for example, use environment variables for one key and the Docker Agent env file for another. + +> [!NOTE] +> Older Docker Agent versions could also read secrets from the macOS Keychain and the `pass` password manager. These sources are no longer consulted: migrate any keys stored there to one of the sources above, e.g. by re-running `docker agent setup`. + +Whatever provider returns the value, if that value looks like a [1Password secret reference](#1password-references) (it starts with `op://`), Docker Agent resolves it through the `op` CLI before handing it to a model provider or tool. + +When Docker Agent runs an agent with `--sandbox` and a Docker AI gateway is configured, the sandbox proxy authenticates gateway requests itself: it injects your Docker login token into HTTPS requests to the gateway host (docker.com domains only). The token never enters the sandbox — inside it, `DOCKER_TOKEN` is a proxy-managed placeholder. + +## Environment Variables + +The simplest approach. Set variables in your shell before running Docker Agent: + +```bash +export OPENAI_API_KEY=sk-... +export ANTHROPIC_API_KEY=sk-ant-... +docker agent run agent.yaml +``` + +Common variables: + +| Variable | Provider | +| --- | --- | +| `OPENAI_API_KEY` | OpenAI | +| `ANTHROPIC_API_KEY` | Anthropic | +| `GOOGLE_API_KEY` | Google Gemini | +| `MISTRAL_API_KEY` | Mistral | +| `OPENROUTER_API_KEY` | OpenRouter | +| `XAI_API_KEY` | xAI | +| `NEBIUS_API_KEY` | Nebius | + +MCP tools may require additional variables. For example, the GitHub MCP server needs `GITHUB_PERSONAL_ACCESS_TOKEN`. These are passed to tools via the `env` field in your config: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + env: + GITHUB_PERSONAL_ACCESS_TOKEN: $GITHUB_PERSONAL_ACCESS_TOKEN +``` + +## Env Files + +For convenience, you can store secrets in a `.env` file and pass it to Docker Agent with `--env-from-file`: + +```bash +# .env +OPENAI_API_KEY=sk-... +ANTHROPIC_API_KEY=sk-ant-... +GITHUB_PERSONAL_ACCESS_TOKEN=ghp_... +``` + +```bash +docker agent run agent.yaml --env-from-file .env +``` + +The file format supports: + +- `KEY=VALUE` pairs, one per line +- Comments starting with `#` +- Quoted values: `KEY="value with spaces"` +- Blank lines are ignored + +> [!IMPORTANT] +> Add `.env` to your `.gitignore` to avoid committing secrets to version control. + +## Docker Agent env file + +A `.env` file (same format as above) at `~/.config/cagent/.env` is read automatically on every run — no `--env-from-file` flag needed. It is where [`docker agent setup`](../../features/cli/index.md#docker-agent-setup) stores API keys when you choose the env-file location, and you can edit it by hand: + +```bash +# ~/.config/cagent/.env +OPENAI_API_KEY=sk-... +``` + +The file is created with owner-only permissions (`0600`), but the values are stored in plain text. + +## Docker Compose Secrets + +When running Docker Agent in a container with Docker Compose, you can use [Compose secrets](https://docs.docker.com/compose/how-tos/use-secrets/) to inject credentials securely. Compose mounts secrets as files under `/run/secrets/`, and Docker Agent reads from this location automatically. + +### From a file + +Store each secret in its own file, then reference it in `compose.yaml`: + +```bash +echo -n "sk-ant-your-key-here" > .anthropic_api_key +``` + +```yaml +# compose.yaml +services: + agent: + image: docker/docker-agent + command: run --exec /app/agent.yaml "Hello!" + secrets: + - ANTHROPIC_API_KEY + volumes: + - ./agent.yaml:/app/agent.yaml:ro + +secrets: + ANTHROPIC_API_KEY: + file: ./.anthropic_api_key +``` + +Docker Compose mounts the file as `/run/secrets/ANTHROPIC_API_KEY`. Docker Agent picks it up with no extra configuration. + +### From a host environment variable + +In CI/CD pipelines, secrets are often injected as environment variables. Compose can forward these to `/run/secrets/`: + +```yaml +secrets: + ANTHROPIC_API_KEY: + environment: "ANTHROPIC_API_KEY" +``` + +### Multiple secrets + +```yaml +services: + agent: + image: docker/docker-agent + command: run --exec /app/agent.yaml "Summarize my GitHub issues" + secrets: + - ANTHROPIC_API_KEY + - GITHUB_PERSONAL_ACCESS_TOKEN + volumes: + - ./agent.yaml:/app/agent.yaml:ro + +secrets: + ANTHROPIC_API_KEY: + file: ./.anthropic_api_key + GITHUB_PERSONAL_ACCESS_TOKEN: + file: ./.github_token +``` + +### Why use Compose secrets over environment variables? + +| Aspect | Environment Variables | Compose Secrets | +| --- | --- | --- | +| Storage | In memory, visible via `docker inspect` | Mounted as tmpfs files under `/run/secrets/` | +| Visibility | Shown in process list and inspect output | Not exposed in `docker inspect` | +| Best for | Development | Production and CI/CD | + +## Credential Helper + +Docker Agent can shell out to an external credential helper you define in your user config. This is useful when your organisation already has a secrets daemon you want to reuse (HashiCorp Vault, 1Password CLI, `bitwarden-cli`, etc.). + +Declare the helper in `~/.config/cagent/config.yaml`: + +```yaml +# ~/.config/cagent/config.yaml +credential_helper: + command: op + args: ["read", "op://Personal/docker-agent"] +``` + +The command is invoked with the variable name appended as the final argument, and must print the secret value to stdout. + +## Docker Desktop + +On machines where Docker Desktop is installed, Docker Agent queries Docker Desktop's backend for secrets stored against your signed-in Docker account. This is transparent — no extra configuration — and it is how signed-in Docker users get provider API keys without setting any environment variables. + +## Docker Authentication + +Routing model traffic through the [Docker models gateway](../../configuration/models/index.md) needs a Docker token. Docker Desktop hands out one that is valid for 15 minutes and cannot be renewed by Docker Agent, so when Desktop has nothing usable to offer — it is signed out, not running, or its own refresh is stuck — Docker Agent exchanges the long-lived access token that `docker login` left in your credential store for a fresh Docker token, the same exchange `docker login` itself performs. Signing in with `docker login` is therefore enough; Docker Desktop is not required. + +Only Docker access tokens are exchanged — the `dckr_…` secrets `docker login` stores — never an account password, and the exchange goes to Docker Hub over HTTPS. The resulting bearer token is cached in a private file under Docker Agent's cache directory so sibling processes reuse it instead of minting their own, and it stops being used within seconds of a `docker logout` or an account switch. Run `docker agent debug auth` to see which token is in use and where it came from. + +Set `DOCKER_AGENT_NO_TOKEN_EXCHANGE=1` to opt out: Docker Agent then relies on Docker Desktop alone. + +## 1Password References + +Any secret value resolved through the chain above can be a **1Password secret reference** instead of the literal secret. If the value starts with `op://`, Docker Agent resolves it by invoking the [1Password CLI](https://developer.1password.com/docs/cli/) (`op read <reference>`) and uses the result. + +This works with every provider — most commonly an environment variable or env file: + +```bash +export OPENAI_API_KEY="op://Personal/OpenAI/api-key" +docker agent run agent.yaml +``` + +References follow the `op://<vault>/<item>/<field>` format. Make sure the `op` CLI is installed and you are signed in (`op signin`) so that non-interactive reads succeed. + +> [!WARNING] +> **Behaviour when resolution fails** +> +> If the value starts with `op://` but the `op` CLI is not installed, or the reference cannot be read (not signed in, wrong path, locked vault), Docker Agent logs a warning and uses an **empty value** — it never forwards the raw `op://` reference to a model provider or tool. Resolved references (and deterministic failures) are cached for the lifetime of the run; transient failures such as a cancelled lookup are not cached, so a later attempt can retry. + +## Choosing a Method + +| Method | Best for | Setup effort | +| --- | --- | --- | +| Environment variables | Quick local development, scripts | Low | +| Env files | Team projects, multiple keys | Low | +| Docker Agent env file | Keys used across all projects, written by `docker agent setup` | Low | +| Docker Compose secrets | Containerized deployments, CI/CD | Medium | +| Credential helper | Reusing an existing secrets daemon (Vault, 1Password CLI, ...) | Medium | +| 1Password references (`op://`) | Teams already using 1Password | Low | + +You can combine methods. For example, store long-lived provider keys in the Docker Agent env file and pass project-specific MCP tokens via env files. + +## Preventing Secret Leaks + +Provider keys live in the secret store and are passed to Docker Agent through the chain above — the agent itself never receives them as input. But the **content of a conversation** can still leak credentials: a user pasting a token, a tool returning a config file with embedded keys, a transcript dumped into a prompt. + +For that defense-in-depth case, set `redact_secrets: true` on an agent. It scrubs detected secrets out of: + +- the arguments of every outgoing tool call (before the tool sees them), +- every outgoing chat message (before the model provider sees them), and +- every tool's output (before it reaches event consumers, the persisted session file, the `post_tool_use` hook input, or the next LLM call). + +```yaml +agents: + root: + model: openai/gpt-5 + description: A helpful assistant + instruction: You are a helpful assistant. + redact_secrets: true + toolsets: + - type: shell +``` + +The ruleset covers GitHub PATs, AWS / GCP / Azure credentials, Stripe / Slack / GitLab / Hugging Face tokens, JWTs, PEM-encoded private keys, Docker Hub PATs, and many others. Each detected span is replaced with the literal `[REDACTED]`. See the [Redacting Secrets](../../configuration/agents/index.md#redacting-secrets) section in the agent configuration reference for the full picture and important caveats about false negatives. diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/thinking/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/thinking/index.md new file mode 100644 index 000000000000..fbdef06dee3b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/thinking/index.md @@ -0,0 +1,363 @@ +--- +title: "Thinking / Reasoning" +description: "Control how much a model reasons before responding. Works across OpenAI, Anthropic, Google Gemini, AWS Bedrock, and Docker Model Runner." +keywords: docker agent, ai agents, guides, thinking / reasoning +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/guides/thinking/ +--- + +_Control how much a model reasons before responding. Works across OpenAI, Anthropic, Google Gemini, AWS Bedrock, and Docker Model Runner._ + +## What Is Thinking? + +Several modern models support an extended reasoning phase that happens before they produce visible output. During this phase the model plans, evaluates options, and works through the problem — internally, not shown in the response by default. This typically improves accuracy on complex tasks like coding, math, and multi-step planning, at the cost of higher token usage and latency. + +Docker Agent exposes this through a single `thinking_budget` field on any named model. The value format differs slightly by provider, but the semantics are the same: higher effort means more thorough reasoning. + +> [!NOTE] +> **Think tool vs. thinking budget** +> +> The [think tool](../../tools/think/index.md) is a scratchpad for models that lack native reasoning. If your model supports `thinking_budget`, you do not need the think tool. + +## Quick Reference + +| Provider | Format | Values | Default | +| ------------------- | ---------- | --------------------------------------------------------------------------------------- | ------------------ | +| OpenAI | string | `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`; `xhigh` on gpt-5.2+, `none`/`max` on gpt-5.6+ only, `minimal` dropped on gpt-5.6+ | `medium` (API default) | +| Anthropic | int or str | 1024–32768 tokens, or `minimal`–`max`, `adaptive`, `adaptive/<effort>`, `none` | off | +| Gemini 2.5 | int | `0` (off), `-1` (dynamic), or token count (max 24576 / 32768) | `-1` (dynamic) | +| Gemini 3 | string | `minimal`, `low`, `medium`, `high` | API default (model-dependent) | +| AWS Bedrock | int or str | 1024–32768 tokens (`minimal`–`max` mapped to tokens); `adaptive`, `adaptive/<effort>` for Opus 4.6+ (rejected by older Claude models) | off | +| Docker Model Runner | int or str | token count, `minimal`–`max` (mapped to tokens), `adaptive` (unlimited), `none` | engine default | + +String values are case-insensitive. The full set of accepted strings is `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`, `adaptive`, and `adaptive/<effort>` — but each provider only honors the subset listed above. Unsupported values either fail at request time (OpenAI) or are mapped/ignored as described per provider below. + +> `thinking_budget` is only applied by the providers listed above. Other OpenAI-compatible providers (xAI, Mistral, Ollama, …) currently ignore it — see [xAI and Mistral](#xai-grok-and-mistral). + +## OpenAI + +OpenAI reasoning models (o-series, gpt-5, gpt-5-mini, gpt-5.6 family) use a string effort level that maps to their `reasoning_effort` API parameter. The `xhigh` level requires gpt-5.2+; `none` and `max` require gpt-5.6+ (Sol/Terra/Luna); `minimal` is dropped on gpt-5.6+. + +```yaml +models: + gpt-thinker: + provider: openai + model: gpt-5.6 + thinking_budget: high # none | minimal | low | medium | high | xhigh | max +``` + +**Effort levels:** + +| Level | Description | +| --------- | -------------------------------------------------------- | +| `none` | No reasoning. Sent as-is on gpt-5.6+ (a real API value); on older models it just disables the local `thinking_budget` (the API's own default still applies). | +| `minimal` | Fastest; lightest reasoning pass. Not accepted on gpt-5.6+ (dropped from the API). | +| `low` | Quick reasoning for straightforward tasks. | +| `medium` | Balanced default. | +| `high` | More thorough; recommended for complex tasks. | +| `xhigh` | Near-maximum effort; slower but most accurate. Requires gpt-5.2+. | +| `max` | Maximum effort. Requires gpt-5.6+. | + +Token counts, `adaptive`, and `adaptive/<effort>` are rejected with a configuration error at request time. `xhigh` is only supported by gpt-5.2 and later minor versions (e.g. gpt-5.2, gpt-5.4-mini); `none` and `max` are only supported by gpt-5.6 and later (Sol/Terra/Luna); `minimal` is not accepted on gpt-5.6+. Older models (o1, o3-mini) only accept `low`/`medium`/`high` — sending an unsupported level returns an API error. + +> [!WARNING] +> **Tokens and max_tokens** +> +> Older OpenAI reasoning models always reason internally — even with `thinking_budget: none` there are hidden reasoning tokens that count against `max_tokens`. On gpt-5.6+ (Sol/Terra/Luna), `none` is a real API value that genuinely disables reasoning. Docker Agent automatically raises the output-token floor for its internal low-effort calls (e.g. title generation) so hidden reasoning cannot starve visible text output. + +## Anthropic + +Anthropic Claude supports two thinking modes: a **token budget** (older models) and **adaptive / effort-based** thinking (newer models). + +### Token budget (Claude 4 and earlier) + +Set an explicit number of thinking tokens (1024–32768). This must be less than `max_tokens`: + +```yaml +models: + claude-thinker: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 16384 # tokens reserved for internal reasoning +``` + +Docker Agent auto-adjusts `max_tokens` when you set a thinking budget but leave `max_tokens` at its default. If you set `max_tokens` explicitly, it must be greater than `thinking_budget`. + +### Adaptive thinking (Opus 4.6+ and Sonnet 4.6) + +Newer Claude models support adaptive thinking, where the model decides how much to think. **Claude Opus 4.6, 4.7, 4.8, and Sonnet 4.6 only support adaptive thinking** — they reject token-based budgets. Use `adaptive`, `adaptive/<effort>`, or a bare effort level — on Anthropic, a bare effort level like `high` is shorthand for adaptive thinking at that effort: + +```yaml +models: + claude-adaptive: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: adaptive # model decides effort (defaults to high) + + claude-adaptive-low: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: low # same as adaptive/low + + claude-adaptive-max: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: adaptive/max # adaptive/low | adaptive/medium | adaptive/high | adaptive/xhigh | adaptive/max +``` + +**Adaptive effort levels and per-model support:** + +| Level | Opus 4.5 | Sonnet 4.5 / Haiku | Sonnet 4.6 | Opus 4.6 | Opus 4.7 / 4.8 | Fable 5 | Mythos 5 | Mythos preview | +| --------- | :------: | :----------------: | :--------: | :------: | :------------: | :-----: | :------: | :------------: | +| `low` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| `medium` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| `high` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| `xhigh` | — | — | — | — | ✓ | ✓ | ✓ | — | +| `max` | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | + +`minimal` is treated as `low` (bare form only). `high` is the default when `adaptive` is used without an effort level. + +> [!WARNING] +> **Effort strings require adaptive-capable models** +> +> Every string effort value on Anthropic is sent as adaptive thinking (`output_config.effort`), which only newer Claude models (Opus 4.6+, Sonnet 4.6) accept. For older models like Sonnet 4.5, use an integer token budget instead. Conversely, models that _only_ support adaptive thinking (Opus 4.6, 4.7, 4.8, Sonnet 4.6) automatically have token budgets coerced to `adaptive` (a warning is logged). + +### Disabling thinking + +```yaml +thinking_budget: none # or 0 +``` + +### Interleaved thinking + +Interleaved thinking lets the model reason between tool calls — useful for complex agentic tasks. Docker Agent auto-enables it whenever a thinking budget is configured on a Claude model, so you only need to set it explicitly to turn it off: + +```yaml +models: + claude-interleaved: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 16384 + # interleaved_thinking is auto-enabled; disable it explicitly if needed: + provider_opts: + interleaved_thinking: false +``` + +> [!NOTE] +> **Temperature and top_p** +> +> When extended thinking is enabled, Anthropic requires `temperature=1.0`. Docker Agent automatically suppresses any `temperature` or `top_p` settings you have configured — they are silently ignored while thinking is active. + +### Thinking display + +Newer Claude models (Opus 4.7+, Fable 5) hide thinking content by default at the API level. To keep reasoning visible, Docker Agent requests `summarized` thinking whenever adaptive/effort-based thinking is used without an explicit `thinking_display`. Use `thinking_display` in `provider_opts` to override: + +```yaml +models: + opus-47: + provider: anthropic + model: claude-opus-4-7 + thinking_budget: adaptive + provider_opts: + thinking_display: omitted # summarized | omitted (display: pre-4.6 models only) +``` + +| Value | Behavior | +| ------------ | ------------------------------------------------------------------------------------- | +| `summarized` | Thinking blocks returned with a text summary (Docker Agent default for adaptive thinking). | +| `display` | Full thinking blocks returned for display. Pre-4.6 token-thinking models only — rejected by Opus/Sonnet 4.6+, Sonnet 5, and Fable 5 (Docker Agent fails fast with a configuration error). | +| `omitted` | Thinking blocks hidden — only the signature is returned. | + +Full thinking tokens are billed regardless of `thinking_display`. + +### Task budget (Anthropic) + +`task_budget` caps total tokens across an entire multi-step agentic task (thinking + tool calls + output combined): + +```yaml +models: + opus-bounded: + provider: anthropic + model: claude-opus-4-7 + thinking_budget: adaptive + task_budget: 128000 # total token ceiling for the whole task +``` + +See the [Anthropic provider page](../../providers/anthropic/index.md#task-budget) for details. + +## Google Gemini + +Gemini 2.5 and Gemini 3 use different formats. + +### Gemini 2.5 (token budget) + +```yaml +models: + gemini-off: + provider: google + model: gemini-2.5-flash + thinking_budget: 0 # disable thinking + + gemini-dynamic: + provider: google + model: gemini-2.5-flash + thinking_budget: -1 # let the model decide (default) + + gemini-fixed: + provider: google + model: gemini-2.5-flash + thinking_budget: 8192 # fixed token budget (max 24576 for Flash, 32768 for Pro) +``` + +### Gemini 3 (level-based) + +```yaml +models: + gemini3-flash: + provider: google + model: gemini-3-flash + thinking_budget: medium # minimal | low | medium | high + + gemini3-pro: + provider: google + model: gemini-3-pro + thinking_budget: high # low | high (Pro supports fewer levels) +``` + +## AWS Bedrock (Claude) + +Bedrock Claude uses a token budget like Anthropic. String effort levels (`minimal`–`max`) are mapped automatically: + +| Effort level | Token budget | +| ------------ | ------------ | +| `minimal` | 1,024 | +| `low` | 2,048 | +| `medium` | 8,192 | +| `high` | 16,384 | +| `xhigh`/`max`| 32,768 | + +```yaml +models: + bedrock-claude-thinker: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + thinking_budget: 8192 # or use an effort level: medium + provider_opts: + region: us-east-1 + + bedrock-claude-interleaved: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + thinking_budget: high + provider_opts: + region: us-east-1 + # interleaved_thinking is auto-enabled when thinking_budget is set +``` + +**Claude Opus 4.6+ on Bedrock requires adaptive thinking** — these models reject `thinking.type=enabled` (token budgets). Configure them with `adaptive` or `adaptive/<effort>`; Docker Agent auto-coerces token budgets and effort levels on these models with a warning: + +```yaml +models: + bedrock-opus-adaptive: + provider: amazon-bedrock + model: global.anthropic.claude-opus-4-8 + thinking_budget: adaptive/high + provider_opts: + region: us-east-1 +``` + +> [!WARNING] +> **Bedrock thinking requirements** +> +> Bedrock Claude requires token-based `thinking_budget` values to be ≥ 1024 and less than `max_tokens`. Docker Agent logs a warning and ignores the budget if either condition is violated. Interleaved thinking requires the `interleaved-thinking-2025-05-14` beta header, which Docker Agent adds automatically; it is auto-enabled whenever a token thinking budget is set on a Bedrock-hosted Claude model (adaptive thinking interleaves on its own). + +## Docker Model Runner (local models) + +For local models, `thinking_budget` is forwarded to the inference engine. Both token counts and effort strings work; effort strings map to the same token scale as Bedrock (`minimal`=1024 … `xhigh`/`max`=32768), and `adaptive` means unlimited: + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + thinking_budget: medium # llama.cpp: reasoning-budget=8192; vLLM: thinking_token_budget=8192 +``` + +- **llama.cpp**: sent as `reasoning-budget` at model-configure time. +- **vLLM**: sent as `thinking_token_budget` on each request. +- **MLX / SGLang**: no reasoning-budget knob; the value is silently ignored. + +See the [Docker Model Runner provider page](../../providers/dmr/index.md) for details. + +## xAI (Grok) and Mistral + +xAI and Mistral run through Docker Agent's OpenAI-compatible client, but the `reasoning_effort` parameter is only sent for OpenAI reasoning model names (o-series, gpt-5). **Setting `thinking_budget` on Grok or Mistral models currently has no effect** — the value is accepted by config validation but never sent to the API. + +Grok and Mistral reasoning models (e.g. `grok-3-mini`, `magistral`) manage reasoning on their own; for non-reasoning models, consider the [think tool](../../tools/think/index.md) instead. + +## Disabling Thinking + +Use `none` or `0` to disable thinking on any provider: + +```yaml +models: + fast-model: + provider: openai + model: gpt-5-mini + thinking_budget: none + + gemini-no-think: + provider: google + model: gemini-2.5-flash + thinking_budget: 0 +``` + +`none` and `0` clear Docker Agent's thinking configuration — no thinking parameter is sent. Models that always reason (OpenAI o-series, gpt-5 through gpt-5.5, Gemini 3) then fall back to the API's default behavior and still reason internally; gpt-5.6+ (Sol/Terra/Luna) sends `none` as a real API value that genuinely disables reasoning. Models with optional thinking (Gemini 2.5, Claude, local models) are also fully disabled. + +## Choosing an Effort Level + +| Task complexity | Recommended level | +| -------------------------------- | ----------------------- | +| Simple factual Q&A | `none` / `minimal` | +| General-purpose chat | `low` / `medium` | +| Coding, debugging, analysis | `medium` / `high` | +| Complex reasoning, planning | `high` / `xhigh` | +| Research, difficult math/logic | `xhigh` / `max` | +| Long agentic tasks (Anthropic) | `adaptive` | + +## Changing Thinking Level at Runtime + +While running in the TUI, press **Shift+Tab** to cycle the thinking effort level for the current model without editing your YAML config, or type `/effort <level>` to jump straight to a specific level (e.g. `/effort high`). Running `/effort` without an argument opens a picker listing the levels the current model supports: + +- The level steps through the model's supported range (model-specific), wrapping around — for example `none → minimal → low → medium → high → none` on OpenAI gpt-5/o-series, `none → minimal → low → medium → high → xhigh → none` on gpt-5.2+, `none → low → medium → high → xhigh → max → none` on gpt-5.6+ (no `minimal`), `none → low → medium → high → max → none` on Anthropic Opus 4.6 and Sonnet 4.6, and `none → low → medium → high → xhigh → max → none` on Anthropic Opus 4.7+, Fable 5, and Mythos 5. For older Anthropic models (e.g. Sonnet 4.5) that only accept token budgets, effort-string cycling has no effect — use an integer `thinking_budget` in your YAML config instead. +- The current level is shown in the sidebar next to the model name (e.g. `openai/gpt-5 • high`). +- This applies as a session override — it is **not** saved to the config file. The next session starts from the level defined in your YAML. +- For models that don't support reasoning, and for remote runtimes, Shift+Tab is a no-op and an informational message is displayed. +- `/effort` only accepts levels the current model supports; requesting an unsupported level shows the model's supported list. Like Shift+Tab, it is unavailable for non-reasoning models and remote runtimes. +- Press <kbd>Tab</kbd> after `/effort` and a space to complete a level from the current model's supported range; it lists the same levels the picker shows (and, like the picker, offers no candidates for non-reasoning models or remote runtimes). + +## Sharing Thinking Config Across Models + +Define a provider with a default `thinking_budget` and all models that reference it inherit it: + +```yaml +providers: + deep-anthropic: + provider: anthropic + thinking_budget: adaptive/high + max_tokens: 32768 + +models: + claude-smart: + provider: deep-anthropic + model: claude-opus-4-6 # inherits thinking_budget: adaptive/high + + claude-faster: + provider: deep-anthropic + model: claude-opus-4-6 + thinking_budget: low # overrides to adaptive/low +``` + +## Full Example + +See [`examples/thinking_budget.yaml`](https://github.com/docker/docker-agent/blob/main/examples/thinking_budget.yaml) for a runnable config covering all providers. diff --git a/_vendor/github.com/docker/docker-agent/docs/guides/tips/index.md b/_vendor/github.com/docker/docker-agent/docs/guides/tips/index.md new file mode 100644 index 000000000000..bde25ee34a7c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/guides/tips/index.md @@ -0,0 +1,477 @@ +--- +title: "Tips & Best Practices" +description: "Expert guidance for building effective, efficient, and secure agents." +keywords: docker agent, ai agents, guides, tips & best practices +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/guides/tips/ +aliases: + - /ai/docker-agent/best-practices/ +--- + +_Expert guidance for building effective, efficient, and secure agents._ + +## Configuration Tips + +### Auto Mode for Quick Start + +Don't have a config file? Docker Agent can automatically detect your available API keys and use an appropriate model: + +```bash +# Automatically uses the best available provider +$ docker agent run + +# Provider priority: Anthropic → OpenAI → Google → Mistral → Amazon Bedrock → DMR +``` + +The special `auto` model value also works in configs: + +```yaml +agents: + root: + model: auto # Uses best available provider + description: Adaptive assistant + instruction: You are a helpful assistant. +``` + +### Environment Variable Interpolation + +Commands support JavaScript template literal syntax for environment variables: + +```yaml +agents: + root: + model: openai/gpt-4o + description: Deployment assistant + instruction: You help with deployments. + commands: + # Simple variable + greet: "Hello ${env.USER}!" + + # With default value + deploy: "Deploy to ${env.ENV || 'staging'}" + + # Multiple variables + release: "Release ${env.PROJECT} v${env.VERSION || '1.0.0'}" +``` + +### Model Aliases Are Auto-Pinned + +Docker Agent automatically resolves model aliases to their latest pinned versions. This ensures reproducible behavior: + +```yaml +# You write: +model: anthropic/claude-sonnet-4-5 + +# docker-agent resolves to: +# anthropic/claude-sonnet-4-5-20250929 (or latest available) +``` + +To use a specific version, specify it explicitly in your config. + +## Performance Tips + +### Defer Tools for Faster Startup + +Large MCP toolsets can slow down agent startup. Use `defer` to load tools on-demand: + +```yaml +agents: + root: + model: openai/gpt-4o + description: Multi-tool assistant + instruction: You have many tools available. + toolsets: + - type: mcp + ref: docker:github-official + defer: true + - type: mcp + ref: docker:slack + defer: true + - type: mcp + ref: docker:linear + defer: true +``` + +Or defer specific tools within a toolset: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + defer: + - "list_issues" + - "search_repos" + - type: mcp + ref: docker:slack + defer: + - "list_channels" +``` + +### Filter MCP Tools + +Many MCP servers expose dozens of tools. Filter to only what you need: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + # Only expose these specific tools + tools: + - list_issues + - create_issue + - get_pull_request + - create_pull_request +``` + +Fewer tools means faster tool selection and less confusion for the model. + +### Set max_iterations + +Always set `max_iterations` for agents with powerful tools to prevent infinite loops: + +```yaml +agents: + developer: + model: anthropic/claude-sonnet-4-5 + description: Development assistant + instruction: You are a developer. + max_iterations: 30 # Reasonable limit for development tasks + toolsets: + - type: filesystem + - type: shell +``` + +Typical values: 20-30 for development agents, 10-15 for simple tasks. + +## Reliability Tips + +### Use Fallback Models + +Configure fallback models for resilience against provider outages or rate limits: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Reliable assistant + instruction: You are a helpful assistant. + fallback: + models: + # Different provider for resilience + - openai/gpt-4o + # Cheaper model as last resort + - openai/gpt-4o-mini + retries: 2 # Retry 5xx errors twice + cooldown: 1m # Stick with fallback for 1 min after rate limit +``` + +**Best practices for fallback chains:** + +- Use different providers for true redundancy +- Order by preference (best first) +- Include a cheaper/faster model as last resort + +### Use Think Tool for Non-Reasoning Models + +The `think` tool provides a reasoning scratchpad for models that lack built-in thinking capabilities: + +```yaml +toolsets: + - type: think # Useful for models without native reasoning +``` + +The agent uses it as a scratchpad for planning and decision-making. If your model already supports a [thinking budget](../../configuration/models/index.md#thinking-budget) (e.g., Claude with extended thinking, OpenAI o-series, Gemini with thinking enabled), you don't need this tool — the model can reason internally. + +## Security Tips + +### Use --yolo Mode Carefully + +The `--yolo` flag auto-approves all tool calls without confirmation: + +```bash +# Auto-approve everything (use with caution!) +$ docker agent run agent.yaml --yolo +``` + +**When it's appropriate:** + +- CI/CD pipelines with controlled inputs +- Automated testing +- Agents with only safe, read-only tools + +**When to avoid:** + +- Interactive sessions with untested prompts +- Agents with shell or filesystem write access +- Any situation where unreviewed actions could cause harm + +### Combine Permissions with Sandbox + +For defense in depth, use both permissions and [sandbox mode](../../configuration/sandbox/index.md): + +```yaml +agents: + secure_dev: + model: anthropic/claude-sonnet-4-5 + description: Secure development assistant + instruction: You are a secure coding assistant. + toolsets: + - type: filesystem + - type: shell + +permissions: + allow: + - "read_*" + - "shell:cmd=go*" + - "shell:cmd=npm*" + deny: + - "shell:cmd=sudo*" + - "shell:cmd=rm*-rf*" +``` + +```bash +# Run with sandbox enabled +docker-agent run --sandbox agent.yaml +``` + +### Set Global Permission Guardrails + +Use [global permissions](../../configuration/permissions/index.md#global-permissions) in your user config to enforce safety rules across every agent: + +```yaml +# ~/.config/cagent/config.yaml +settings: + permissions: + deny: + - "shell:cmd=sudo*" + - "shell:cmd=rm*-rf*" + - "shell:cmd=git push --force*" + allow: + - "read_*" + - "shell:cmd=ls*" + - "shell:cmd=cat*" +``` + +These rules merge with any agent-level permissions. Deny patterns from your global config cannot be overridden by agent configs, so you can trust that dangerous commands stay blocked regardless of which agent you run. + +### Use Hooks for Audit Logging + +Log all tool calls for compliance or debugging: + +```yaml +agents: + audited: + model: openai/gpt-4o + description: Audited assistant + instruction: You are a helpful assistant. + hooks: + post_tool_use: + - matcher: "*" + hooks: + - type: command + command: "./scripts/audit-log.sh" +``` + +## Multi-Agent Tips + +### Handoffs vs Sub-Agents + +Understand the difference between `sub_agents` and `handoffs`: + +- **`sub_agents` (transfer_task)** — delegates a task to a child in a sub-session, waits for the result, then continues. Hierarchical: the parent remains in control. + + ```yaml + sub_agents: [researcher, writer] + ``` + +- **`handoffs` (peer-to-peer)** — hands off the entire conversation to another agent in the same session. The active agent switches and sees the full history. Agents can form cycles. + + ```yaml + handoffs: + - specialist + - summarizer + ``` + +See [Multi-Agent Systems](../../concepts/multi-agent/index.md) for a detailed comparison. + +### Give Sub-Agents Clear Descriptions + +The root agent uses descriptions to decide which sub-agent to delegate to: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Technical lead + instruction: Delegate to specialists based on the task. + sub_agents: [frontend, backend, devops] + + frontend: + model: openai/gpt-4o + # Good: specific and actionable + description: | + Frontend specialist. Handles React, TypeScript, CSS, + UI components, and browser-related issues. + + backend: + model: openai/gpt-4o + # Good: clear domain boundaries + description: | + Backend specialist. Handles APIs, databases, + server logic, and Go/Python code. + + devops: + model: openai/gpt-4o + description: | + DevOps specialist. Handles CI/CD, Docker, Kubernetes, + infrastructure, and deployment pipelines. +``` + +## Debugging Tips + +### Enable Debug Logging + +Use the `--debug` flag to see detailed execution logs: + +```bash +# Default log location: ~/.cagent/cagent.debug.log +$ docker agent run agent.yaml --debug + +# Custom log location +$ docker agent run agent.yaml --debug --log-file ./debug.log +``` + +### Check Token Usage + +Use the `/cost` command during a session to see token consumption: + +```text +/cost + +Token Usage: + Input: 12,456 tokens + Output: 3,789 tokens + Total: 16,245 tokens +``` + +### Compact Long Sessions + +If a session gets too long, use `/compact` to summarize and reduce context: + +```text +/compact + +Session compacted. Summary generated and history trimmed. +``` + +## More Tips + +### User-Defined Default Model + +Set your preferred default model in `~/.config/cagent/config.yaml`: + +```yaml +settings: + default_model: anthropic/claude-sonnet-4-5 +``` + +This model is used by the built-in default agent when you run `docker agent run` without a config argument and no project-level `docker-agent.yaml`, `docker-agent.yml`, or `docker-agent.hcl` exists. + +### Get Desktop Notifications with Hooks + +Long-running agents shouldn't require staring at the terminal. Add [global hooks](../../configuration/hooks/index.md#global-user-level-hooks) to your user config so every agent notifies you when it needs attention or finishes: + +```yaml +# ~/.config/cagent/config.yaml +settings: + hooks: + # Agent is waiting for your input (question, approval prompt, ...) + on_user_input: + - type: command + command: osascript -e 'display notification "Agent needs your input" with title "docker-agent"' + + # Agent finished responding + stop: + - type: command + command: osascript -e 'display notification "Task finished" with title "docker-agent"' +``` + +On Linux, replace `osascript` with `notify-send`: + +```yaml +command: notify-send "docker-agent" "Agent needs your input" +``` + +Hooks inherit Docker Agent's environment, so this works as-is from a desktop terminal. In detached contexts (SSH, tmux started outside your desktop session, containers), `notify-send` needs the session's `DISPLAY` and `DBUS_SESSION_BUS_ADDRESS` to reach the notification daemon, and fails silently without them. Pass them with the per-hook `env` option: + +```yaml +on_user_input: + - type: command + command: notify-send "docker-agent" "Agent needs your input" + env: + DISPLAY: ":0" + DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/1000/bus" +``` + +To also get alerted on errors and warnings, hook the `notification` event and read the message from the JSON payload on stdin: + +```yaml +settings: + hooks: + notification: + - type: command + timeout: 10 + command: | + MESSAGE=$(cat | jq -r '.notification_message // "Agent error"') + osascript -e "display notification \"$MESSAGE\" with title \"docker-agent\"" +``` + +If a sound is enough, set `settings: { sound: true }` instead — Docker Agent plays a failure sound when a task errors, and a success sound when a task that ran longer than `sound_threshold` seconds (default 10) completes. + +See the [Hooks documentation](../../configuration/hooks/index.md) for the full list of events, their payloads, and per-hook options (`env`, `working_dir`, `timeout`). + +### GitHub PR Reviewer Example + +Use Docker Agent as a GitHub Actions PR reviewer: + +```yaml +# .github/workflows/pr-review.yml +name: PR Review +on: + pull_request: + types: [opened, synchronize] + +jobs: + review: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run docker-agent review + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Install docker-agent + curl -fsSL https://get.docker-agent.dev | sh + + # Run the review + docker agent run --exec reviewer.yaml --yolo \ + "Review PR #${{ github.event.pull_request.number }}" +``` + +With a simple reviewer agent: + +```yaml +# reviewer.yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: PR reviewer + instruction: | + Review pull requests for code quality, bugs, and security issues. + Be constructive and specific in your feedback. + toolsets: + - type: mcp + ref: docker:github-official + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/_index.md b/_vendor/github.com/docker/docker-agent/docs/providers/_index.md new file mode 100644 index 000000000000..22c440cfe7a5 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/_index.md @@ -0,0 +1,5 @@ +--- +title: "Model Providers" +description: "Model providers supported by Docker Agent." +weight: 60 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/anthropic/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/anthropic/index.md new file mode 100644 index 000000000000..69c8041f1d35 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/anthropic/index.md @@ -0,0 +1,241 @@ +--- +title: "Anthropic" +description: "Use Claude Sonnet 4, Claude Sonnet 4.5, and other Anthropic models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, anthropic +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/providers/anthropic/ +--- + +_Use Claude Sonnet 4, Claude Sonnet 4.5, and other Anthropic models with Docker Agent._ + +## Setup + +```bash +# Set your API key +export ANTHROPIC_API_KEY="sk-ant-..." +``` + +### Workload Identity Federation (no API key) + +Authenticate with short-lived tokens minted from your own OIDC identity +provider instead of a long-lived API key. See Anthropic's +[Workload Identity Federation guide](https://platform.claude.com/docs/en/build-with-claude/workload-identity-federation) +to provision a Federation Rule, then configure Docker Agent with a typed +`auth:` block: + +```yaml +providers: + anthropic-wif: + provider: anthropic + auth: + type: workload_identity_federation + workload_identity_federation: + federation_rule_id: fdrl_REPLACE_ME + organization_id: 00000000-0000-0000-0000-000000000000 + # Optional: only required for target_type=SERVICE_ACCOUNT rules. + service_account_id: svac_REPLACE_ME + identity_token: + # Pick exactly one of: file, env, command, url + file: /var/run/secrets/anthropic.com/token + +models: + claude: + provider: anthropic-wif + model: claude-sonnet-4-5 +``` + +`identity_token` accepts four mutually exclusive sources: + +| Source | When to use | +| --------- | ------------------------------------------------------------------------------------------------------------------------ | +| `file` | Kubernetes projected service-account tokens, SPIFFE/SPIRE helpers, Vault sidecars — anything that rotates a file on disk | +| `env` | The token is already exported in an environment variable | +| `command` | Shell out to a CLI on every refresh (`gcloud auth print-identity-token`, `az account get-access-token`, ...) | +| `url` | Fetch from an HTTP(S) endpoint (cloud metadata servers, GitHub Actions OIDC token URL, ...) | + +For `url`, both the URL and any header values support `${env.VAR}` expansion +against the runtime environment (the legacy `${VAR}` form is also accepted), +which lets you wire the GitHub Actions OIDC +token endpoint without putting secrets in YAML: + +```yaml +identity_token: + url: ${env.ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://api.anthropic.com + headers: + Authorization: bearer ${env.ACTIONS_ID_TOKEN_REQUEST_TOKEN} + response_field: value +``` + +`auth:` is mutually exclusive with `--gateway`. Token-refresh failures are +surfaced through the normal error path with a clear `anthropic workload +identity federation: failed to refresh identity token from <kind> source +(federation_rule=fdrl_…): ...` message in the TUI. + +A complete walkthrough of all four sources lives in +[`examples/anthropic_wif.yaml`](https://github.com/docker/docker-agent/blob/main/examples/anthropic_wif.yaml). + +## Configuration + +### Inline + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 +``` + +### Named Model + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 64000 +``` + +## Available Models + +| Model ID | Description | +| ------------------- | --------------------------------------------------- | +| `claude-opus-5` | Highest-capability Opus model; full effort ladder (low–max) | +| `claude-opus-4-7` | Previous Opus flagship; supports task budget | +| `claude-sonnet-4-5` | Most capable Sonnet; supports extended thinking | +| `claude-sonnet-4-0` | Previous Sonnet generation, still supported | +| `claude-haiku-4-5` | Fast and inexpensive, good for tight loops | + +## Thinking Budget + +Anthropic accepts either an integer token budget or a string effort value. Thinking is off unless you set `thinking_budget`; when set, interleaved thinking is auto-enabled. + +**Token budget** (1024–32768; works on all extended-thinking Claude models): + +```yaml +models: + claude-deep: + provider: anthropic + model: claude-sonnet-4-5 + thinking_budget: 16384 # must be < max_tokens +``` + +**Adaptive / effort-based** (Claude Opus 4.6+, Sonnet 4.6 — every string value is sent as adaptive thinking via `output_config.effort`): + +```yaml +models: + opus-adaptive: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: adaptive # model decides effort (defaults to high) + + opus-effort: + provider: anthropic + model: claude-opus-4-6 + thinking_budget: high # low | medium | high | xhigh | max (same as adaptive/<effort>) +``` + +On models that reject token-based thinking (Opus 4.6, 4.7, 4.8, Sonnet 4.6), an integer budget is automatically coerced to `adaptive` with a logged warning. See the [Thinking / Reasoning guide](../../guides/thinking/index.md) for the full cross-provider reference. + +## Interleaved Thinking + +Auto-enabled whenever a thinking budget is configured on a Claude model. Allows tool calls during model reasoning for more integrated problem-solving: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + provider_opts: + interleaved_thinking: false # disable if needed +``` + +## Task Budget + +`task_budget` caps the **total** number of tokens the model may spend across a +multi-step agentic task — combined thinking, tool calls, and final output. It +is forwarded as +[`output_config.task_budget`](https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7) +and is ideal for letting long-running agents self-regulate effort without +tightening `max_tokens` on every call. + +Docker Agent automatically attaches the required `task-budgets-2026-03-13` +beta header whenever this field is set. You can configure `task_budget` on +**any** Claude model — Docker Agent never gates it by model name. At the time +of writing, only **Claude Opus 4.7** actually honors the field; other Claude +models (Sonnet 4.5, Opus 4.5 / 4.6, etc.) are expected to reject requests +that include it. Check the Anthropic release notes linked above for the +current list of supported models. + +```yaml +models: + opus: + provider: anthropic + model: claude-opus-4-7 + task_budget: 128000 # integer shorthand → { type: tokens, total: 128000 } + thinking_budget: adaptive +``` + +Object form (forward-compatible with future budget types): + +```yaml + opus: + provider: anthropic + model: claude-opus-4-7 + task_budget: + type: tokens + total: 128000 +``` + +See the full schema on the [Model Configuration](../../configuration/models/index.md#task-budget) page. + +## Server-Side Fallbacks + +When the primary model refuses a request (e.g. Claude Fable 5's safety +classifiers ending the turn with stop reason `refusal`), Anthropic can retry +the request with backup models in a single round trip. Set `fallbacks` in +`provider_opts` to a list of model IDs, in priority order: + +```yaml +models: + fable: + provider: anthropic + model: claude-fable-5 + provider_opts: + fallbacks: + - claude-opus-4-8 + - claude-sonnet-4-6 +``` + +Docker Agent automatically attaches the required +`server-side-fallback-2026-06-01` beta header and forwards the option as +`fallbacks: [{"model": "..."}]`. The response's `model` field reports which +model actually served the request. + +Fallback models receive the exact same request as the primary model +(thinking configuration, task budget, beta features, ...), so list only +models that accept the same request shape. Not available on Bedrock, Vertex +AI, or the Message Batches API. + +## Thinking Display + +Controls whether thinking blocks are returned in responses when thinking is enabled. Newer Claude models (Opus 4.7+, Fable 5) hide thinking content by default (`omitted`); Docker Agent counters this by requesting `summarized` thinking whenever an adaptive/effort-based budget is used without an explicit `thinking_display`, so reasoning stays visible in the UI. Set `thinking_display` in `provider_opts` to override: + +```yaml +models: + claude-opus-4-7: + provider: anthropic + model: claude-opus-4-7 + thinking_budget: adaptive + provider_opts: + thinking_display: omitted # "summarized" or "omitted" ("display" on pre-4.6 models only) +``` + +Valid values: + +- `summarized`: thinking blocks are returned with summarized thinking text (Docker Agent's default for adaptive/effort-based budgets). +- `display`: thinking blocks are returned for display. Only accepted by pre-4.6 token-thinking models (e.g. Sonnet 4.5, Haiku 4.5); models from the adaptive-thinking generation onward (Opus/Sonnet 4.6+, Sonnet 5, Fable 5) reject it, and Docker Agent fails fast with a configuration error instead of sending a request the API would refuse. +- `omitted`: thinking blocks are returned with an empty thinking field; the signature is still returned for multi-turn continuity. Useful to reduce time-to-first-text-token when streaming. + +Note: `thinking_display` applies to both `thinking_budget` with token counts and adaptive/effort-based budgets. For token-count budgets no default is applied (the API already defaults to `summarized`). Full thinking tokens are billed regardless of the `thinking_display` value. + +> [!NOTE] +> Anthropic thinking budget values below 1024 or greater than or equal to `max_tokens` are ignored (a warning is logged). diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/baseten/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/baseten/index.md new file mode 100644 index 000000000000..f36428484838 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/baseten/index.md @@ -0,0 +1,91 @@ +--- +title: "Baseten" +description: "Use Baseten AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, baseten +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/providers/baseten/ +--- + +_Use Baseten AI models with Docker Agent._ + +## Overview + +Baseten provides AI models through an OpenAI-compatible API. Docker Agent includes built-in support for Baseten as an alias provider. + +## Setup + +1. Get an API key from [Baseten](https://www.baseten.co/) +2. Set the environment variable: + + ```bash + export BASETEN_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Baseten: + +```yaml +agents: + root: + model: baseten/deepseek-ai/DeepSeek-V3.1 + description: Assistant using Baseten + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + baseten_model: + provider: baseten + model: deepseek-ai/DeepSeek-V3.1 + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: baseten_model + description: Assistant using Baseten + instruction: You are a helpful assistant. +``` + +## Available Models + +Baseten hosts various open models through its Model APIs. Check the [Baseten documentation](https://docs.baseten.co/) for the current model catalog. + +| Model | Description | +| ------------------------------ | ------------------------------ | +| `deepseek-ai/DeepSeek-V3.1` | DeepSeek V3.1 model | +| `moonshotai/Kimi-K2.5` | Moonshot Kimi K2.5 model | +| `openai/gpt-oss-120b` | GPT-OSS 120B model | +| `zai-org/GLM-5` | GLM-5 model | + +## How It Works + +Baseten is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://inference.baseten.co/v1` +- **Token Variable:** `BASETEN_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: baseten/deepseek-ai/DeepSeek-V3.1 + description: Code assistant using DeepSeek + instruction: | + You are an expert programmer using DeepSeek V3.1. + Write clean, well-documented code. + Follow best practices for the language being used. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/bedrock/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/bedrock/index.md new file mode 100644 index 000000000000..f7e190a08602 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/bedrock/index.md @@ -0,0 +1,175 @@ +--- +title: "AWS Bedrock" +description: "Access Claude, Nova, Llama, and more through AWS infrastructure with enterprise-grade security and compliance." +keywords: docker agent, ai agents, model providers, llm, aws bedrock +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/providers/bedrock/ +--- + +_Access Claude, Nova, Llama, and more through AWS infrastructure with enterprise-grade security and compliance._ + +## Prerequisites + +- AWS account with Bedrock enabled in your region +- Model access granted in the [Bedrock Console](https://console.aws.amazon.com/bedrock/) (some models require approval) +- AWS credentials configured (see authentication below) + +## Configuration + +```yaml +models: + bedrock-claude: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + max_tokens: 64000 + provider_opts: + region: us-east-1 +``` + +## Authentication + +### Option 1: Bedrock API Key (Simplest) + +```bash +export AWS_BEARER_TOKEN_BEDROCK="your-key" +``` + +```yaml +models: + bedrock: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + token_key: AWS_BEARER_TOKEN_BEDROCK # env var name + provider_opts: + region: us-east-1 +``` + +### Option 2: AWS Credentials (Default) + +Uses the standard AWS SDK credential chain: env vars → shared credentials → config → IAM roles. + +```yaml +models: + bedrock: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + provider_opts: + profile: my-aws-profile + region: us-east-1 +``` + +### With IAM Role Assumption + +```yaml +models: + bedrock: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + provider_opts: + role_arn: "arn:aws:iam::123456789012:role/BedrockAccessRole" + external_id: "my-external-id" +``` + +## Provider Options + +| Option | Type | Default | Description | +| ------------------------ | ------ | ---------------------- | ------------------------------------ | +| `region` | string | us-east-1 | AWS region | +| `profile` | string | — | AWS profile name | +| `role_arn` | string | — | IAM role ARN for assume role | +| `role_session_name` | string | docker-agent-bedrock-session | Session name for assumed role | +| `external_id` | string | — | External ID for role assumption | +| `endpoint_url` | string | — | Custom endpoint (VPC/testing) | +| `interleaved_thinking` | bool | auto | Allow reasoning between tool calls (Claude); auto-enabled when a thinking budget is set on a Claude model; adds the required beta header automatically | +| `disable_prompt_caching` | bool | false | Disable automatic prompt caching | + +## Inference Profiles + +Use inference profile prefixes for optimal routing: + +| Prefix | Routes To | +| --------- | ---------------------------------------- | +| `global.` | All commercial AWS regions (recommended) | +| `us.` | US regions only | +| `eu.` | EU regions only (GDPR compliance) | +| `apac.` | Asia Pacific regions only | + +> [!TIP] +> **Inference profiles** +> +> Use `global.` prefix on model IDs for automatic cross-region routing. Use `eu.` prefix for GDPR compliance. + +## Thinking Budget (Claude on Bedrock) + +Bedrock Claude models support extended thinking — an internal reasoning phase before the model produces its response. Set `thinking_budget` to a token count (1024–32768) or an effort level string that maps automatically: + +| Effort level | Token budget | +| ------------ | ------------ | +| `minimal` | 1,024 | +| `low` | 2,048 | +| `medium` | 8,192 | +| `high` | 16,384 | +| `xhigh`/`max`| 32,768 | + +```yaml +models: + bedrock-claude-thinking: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + thinking_budget: 8192 # tokens, or use an effort string like "medium" + max_tokens: 16384 # must be > thinking_budget + provider_opts: + region: us-east-1 +``` + +`thinking_budget` must be ≥ 1024 and less than `max_tokens`. Values outside this range are logged as a warning and ignored. + +### Adaptive thinking (Opus 4.6+) + +Newer Claude Opus models (4.6, 4.7, 4.8) **reject token-based thinking** — Bedrock returns a `ValidationException` asking for `thinking.type=adaptive`. For these models, use adaptive thinking: + +```yaml +models: + bedrock-opus-adaptive: + provider: amazon-bedrock + model: global.anthropic.claude-opus-4-8 + thinking_budget: adaptive/high # adaptive | adaptive/low | adaptive/medium | adaptive/high | adaptive/xhigh | adaptive/max + provider_opts: + region: us-east-1 +``` + +Docker Agent recognizes these models (including Bedrock-style IDs) and transparently coerces a configured token budget or effort level to adaptive thinking, logging a warning — so `thinking_budget: 32768` on Opus 4.8 won't fail, but `adaptive` or `adaptive/<effort>` is the recommended configuration. On older models that still use token-based thinking (e.g. Sonnet 4.5), `adaptive` is forwarded as-is and rejected by Bedrock — use a token count or effort level there instead. + +> [!NOTE] +> **Temperature and top_p** +> +> Bedrock Claude suppresses `temperature` and `top_p` while extended thinking is active — Anthropic requires `temperature=1.0` internally. + +## Interleaved Thinking (Claude on Bedrock) + +Interleaved thinking lets the model reason between tool calls, not just at the start. This is useful for complex agentic tasks. Enable it alongside a thinking budget: + +```yaml +models: + bedrock-claude-interleaved: + provider: amazon-bedrock + model: global.anthropic.claude-sonnet-4-5-20250929-v1:0 + thinking_budget: high + provider_opts: + region: us-east-1 + # interleaved_thinking is auto-enabled when thinking_budget is set +``` + +Docker Agent auto-enables `interleaved_thinking` whenever a thinking budget is configured on a Bedrock-hosted Claude model and automatically adds the `interleaved-thinking-2025-05-14` beta header. If you set `interleaved_thinking: false` while a thinking budget is active, a warning is logged because the budget may be ignored by Bedrock without the beta header. + +See the [Thinking / Reasoning guide](../../guides/thinking/index.md) for a full cross-provider overview. + +## Prompt Caching + +Automatically enabled for supported models to reduce latency and costs. System prompts, tool definitions, and recent messages are cached with a 5-minute TTL. + +```bash +# Disable if needed +provider_opts: + disable_prompt_caching: true +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/cerebras/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/cerebras/index.md new file mode 100644 index 000000000000..bf0dba14c912 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/cerebras/index.md @@ -0,0 +1,103 @@ +--- +title: "Cerebras" +description: "Use Cerebras models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, cerebras +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/providers/cerebras/ +--- + +_Use Cerebras models with Docker Agent._ + +## Overview + +[Cerebras](https://www.cerebras.ai/) serves open-weight models such as GPT-OSS +and GLM through an OpenAI-compatible API on its wafer-scale hardware, delivering +some of the highest tokens/sec available. That speed makes it a strong fit for +latency-sensitive coding workflows. Docker Agent includes built-in support for +Cerebras as an alias provider. + +## Setup + +1. Create an API key from the [Cerebras Cloud console](https://cloud.cerebras.ai/). +2. Set the environment variable: + + ```bash + export CEREBRAS_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Cerebras: + +```yaml +agents: + root: + model: cerebras/gpt-oss-120b + description: Assistant using Cerebras + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + cerebras_model: + provider: cerebras + model: gpt-oss-120b + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: cerebras_model + description: Assistant using Cerebras + instruction: You are a helpful assistant. +``` + +## Available Models + +Cerebras hosts a curated set of open-weight models. Check the +[Cerebras models documentation](https://inference-docs.cerebras.ai/models/overview) +for current model IDs, context limits, and pricing. + +| Model | Description | +| --- | --- | +| `gpt-oss-120b` | Open-weight GPT-OSS reasoning model with tool calling | +| `zai-glm-4.7` | Z.AI GLM-4.7 reasoning model with tool calling | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. Cerebras may serve additional models not in the built-in catalog; those +> still work but resolve to default capability metadata locally. + +## How It Works + +Cerebras is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.cerebras.ai/v1` +- **Token Variable:** `CEREBRAS_API_KEY` + +Because Cerebras fronts open-weight models whose chat templates may only accept +a single leading system message, Docker Agent coalesces its per-source system +messages (agent instruction plus each toolset's instructions) into one before +sending the request. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: cerebras/gpt-oss-120b + description: Fast code assistant using Cerebras + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/chatgpt/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/chatgpt/index.md new file mode 100644 index 000000000000..ed50250056b5 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/chatgpt/index.md @@ -0,0 +1,128 @@ +--- +title: "ChatGPT (OpenAI account)" +description: "Use your ChatGPT Plus/Pro/Business subscription with Docker Agent by signing in with your OpenAI account, no API key needed." +keywords: docker agent, ai agents, model providers, llm, chatgpt, openai, codex, subscription +weight: 55 +canonical: https://docs.docker.com/ai/docker-agent/providers/chatgpt/ +--- + +_Use your ChatGPT subscription with Docker Agent by signing in with your OpenAI account. No API key needed._ + +## Overview + +The `chatgpt` provider authenticates with a ChatGPT account (the same +"Sign in with ChatGPT" flow used by OpenAI's Codex CLI) instead of an +`OPENAI_API_KEY`. Usage is billed against your ChatGPT Plus, Pro, or +Business plan rather than pay-per-token API credits. + +Under the hood, Docker Agent talks to the ChatGPT Codex backend +(`https://chatgpt.com/backend-api/codex`), which serves the `gpt-5` model +family over the OpenAI Responses API. GPT-5.6 (Sol/Terra/Luna) is served +there too; GPT-5.2 and GPT-5.3-Codex are deprecated for ChatGPT sign-in. + +## Prerequisites + +- A paid **ChatGPT** subscription (Plus, Pro, or Business). +- A browser on the machine running the sign-in (the OAuth flow uses a + fixed `localhost:1455` callback). + +## Sign In + +```bash +docker agent setup +``` + +Pick **chatgpt** in the provider list: instead of asking for an API key, the +wizard opens your browser on the ChatGPT sign-in page and stores the +resulting OAuth credential in the Docker Agent config directory +(`~/.config/cagent/chatgpt-auth.json`, owner-only permissions). The access +token is refreshed automatically; you only need to sign in again if the +refresh token is revoked. + +Related commands: + +```bash +docker agent doctor # the chatgpt row shows the credential state +rm ~/.config/cagent/chatgpt-auth.json # sign out (remove the stored sign-in) +``` + +## Configuration + +### Inline + +```yaml +agents: + root: + model: chatgpt/gpt-5.6 + instruction: You are a helpful assistant. +``` + +### Named model + +```yaml +models: + gpt: + provider: chatgpt + model: gpt-5.6 + thinking_budget: medium + +agents: + root: + model: gpt +``` + +## Available Models + +The Codex backend serves the models available to your ChatGPT plan, +typically: + +| Model | Best For | +| -------------------- | -------------------------------------- | +| `gpt-5.6` | Alias for `gpt-5.6-sol`; general purpose, strong reasoning | +| `gpt-5.6-sol` | Frontier model, most capable | +| `gpt-5.6-terra` | Everyday workhorse | +| `gpt-5.6-luna` | High-volume, cost-efficient | +| `gpt-5.2` | Deprecated for ChatGPT sign-in | +| `gpt-5.2-codex` | Deprecated for ChatGPT sign-in | + +The effort picker exposes Low/Medium/High/XHigh/Max on the GPT-5.6 family +(no Minimal). + +## How It Works + +- **Auth:** the `docker agent setup` sign-in runs an OAuth 2.0 + authorization-code + PKCE flow against `auth.openai.com`. The stored login + is exposed to credential checks (doctor, `first_available`, auto model + selection) as the virtual `CHATGPT_OAUTH_TOKEN` variable. +- **API:** requests go to the Responses API only; the backend has no Chat + Completions endpoint, so `api_type` is pinned automatically. +- **Request shape:** the backend requires stateless requests (`store: false`) + and a top-level `instructions` field, so Docker Agent moves system messages + there. Client-side sampling parameters (`temperature`, `top_p`, + `max_tokens`) are not supported by the backend and are dropped. + +## Setting the Token Explicitly + +`CHATGPT_OAUTH_TOKEN` can also be set like any other credential (shell +environment, `--env-from-file`, ...). An explicitly set value takes +precedence over the stored sign-in. This is useful for short-lived CI runs +with a pre-minted access token, but note that such a token expires and is not +refreshed. + +## ChatGPT Subscription vs. OpenAI API Key + +| | `chatgpt` | `openai` | +| --- | --- | --- | +| Credential | ChatGPT account sign-in | `OPENAI_API_KEY` | +| Billing | Included in the ChatGPT plan (rate-limited) | Pay per token | +| Models | `gpt-5` family served by the Codex backend | Full OpenAI API catalog | +| Sampling controls (`temperature`, ...) | Not supported | Supported | +| Embeddings / reranking | Not supported | Supported | + +When both credentials are configured, automatic model selection prefers +`openai`; pin `--model chatgpt/gpt-5.6` (or use a named model) to use the +subscription. + +> [!NOTE] +> Use of the Codex backend is governed by OpenAI's terms for ChatGPT and +> Codex. Sign-in is per user; do not share the stored credential. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-ai-gateway/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-ai-gateway/index.md new file mode 100644 index 000000000000..558d8c6e03b0 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-ai-gateway/index.md @@ -0,0 +1,115 @@ +--- +title: "Cloudflare AI Gateway" +description: "Use Cloudflare AI Gateway models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, cloudflare ai gateway +weight: 60 +canonical: https://docs.docker.com/ai/docker-agent/providers/cloudflare-ai-gateway/ +--- + +_Use Cloudflare AI Gateway models with Docker Agent._ + +## Overview + +[Cloudflare AI Gateway](https://developers.cloudflare.com/ai-gateway/) is a +single OpenAI-compatible endpoint that routes to models from OpenAI, Anthropic, +Workers AI and more, with caching, rate limiting and observability. Docker Agent +includes built-in support for AI Gateway as an alias provider. + +The alias sends your token in the standard `Authorization: Bearer` header, so it +works out of the box with a gateway that has **authentication disabled** (the +default), typically to route to your own Workers AI models through a gateway you +own. See [Authentication](#authentication) below for the unified-billing / +authenticated-gateway caveat. + +## Setup + +The gateway endpoint is account- and gateway-scoped, so its base URL is resolved +from your account ID and gateway ID. Three environment variables are required: + +```bash +export CLOUDFLARE_ACCOUNT_ID=your-account-id +export CLOUDFLARE_GATEWAY_ID=your-gateway-id +export CLOUDFLARE_API_TOKEN=your-api-token +``` + +Create a gateway from the +[AI Gateway dashboard](https://dash.cloudflare.com/?to=/:account/ai/ai-gateway) +and an API token with the appropriate permissions. + +## Usage + +AI Gateway model IDs use the gateway's `provider/model` form (for example +`workers-ai/@cf/meta/llama-3.1-8b-instruct` or `openai/gpt-4o`); the gateway +routes each request to the underlying provider. + +### Inline Syntax + +```yaml +agents: + root: + model: cloudflare-ai-gateway/workers-ai/@cf/meta/llama-3.1-8b-instruct + description: Assistant using Cloudflare AI Gateway + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + cloudflare_model: + provider: cloudflare-ai-gateway + model: "workers-ai/@cf/meta/llama-3.1-8b-instruct" + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: cloudflare_model + description: Assistant using Cloudflare AI Gateway + instruction: You are a helpful assistant. +``` + +## Available Models + +AI Gateway exposes models from many providers behind one endpoint. Check the +[AI Gateway documentation](https://developers.cloudflare.com/ai-gateway/) for +the current provider list, model IDs, and how billing works. + +> Model IDs are case-sensitive and must be passed exactly as the gateway lists +> them, including the `provider/` prefix. + +## How It Works + +Cloudflare AI Gateway is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/compat` +- **Token Variable:** `CLOUDFLARE_API_TOKEN` + +The base URL is templated: `${CLOUDFLARE_ACCOUNT_ID}` and +`${CLOUDFLARE_GATEWAY_ID}` are substituted from the environment when the provider +is built, so both must be set in addition to `CLOUDFLARE_API_TOKEN`. Because the +gateway can route to open-weight models with strict chat templates, Docker Agent +coalesces consecutive system messages into a single leading one for this +provider. + +## Authentication + +Docker Agent authenticates by sending `CLOUDFLARE_API_TOKEN` in the standard +`Authorization: Bearer` header. On the `.../compat` endpoint that header is +treated as the **provider** key, so this alias works when: + +- the gateway has **authentication disabled** (the default), and +- the routed models accept that token as their provider key, which is the case + for **Workers AI** models (`workers-ai/@cf/...`). + +A gateway with **authentication enabled** (required for +[unified billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/)) +instead expects the token in Cloudflare's `cf-aig-authorization` header. The +alias does not send that header, and custom `provider_opts.http_headers` values +are not environment-expanded, so an authenticated gateway is **not supported out +of the box** today. For that setup, use an unauthenticated gateway, or configure +a [custom provider](../custom/index.md) against the +Cloudflare AI Gateway REST API. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-workers-ai/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-workers-ai/index.md new file mode 100644 index 000000000000..68477296aee6 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/cloudflare-workers-ai/index.md @@ -0,0 +1,91 @@ +--- +title: "Cloudflare Workers AI" +description: "Use Cloudflare Workers AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, cloudflare workers ai +weight: 70 +canonical: https://docs.docker.com/ai/docker-agent/providers/cloudflare-workers-ai/ +--- + +_Use Cloudflare Workers AI models with Docker Agent._ + +## Overview + +[Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) runs +open-weight models (Llama, Mistral, Qwen, Gemma, and more) on Cloudflare's +global edge network through an OpenAI-compatible endpoint. No separate provider +accounts are needed for the supported models. Docker Agent includes built-in +support for Workers AI as an alias provider. + +## Setup + +Workers AI is account-scoped, so its base URL is resolved from your account ID. +Two environment variables are required: + +```bash +export CLOUDFLARE_ACCOUNT_ID=your-account-id +export CLOUDFLARE_API_TOKEN=your-api-token +``` + +Create an API token with the `Workers AI` permission from the +[Cloudflare dashboard](https://dash.cloudflare.com/profile/api-tokens). Your +account ID is shown on the Workers AI page. + +## Usage + +Workers AI model IDs use the `@cf/...` form (for example +`@cf/meta/llama-3.1-8b-instruct`). + +### Inline Syntax + +```yaml +agents: + root: + model: cloudflare-workers-ai/@cf/meta/llama-3.1-8b-instruct + description: Assistant using Cloudflare Workers AI + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + cloudflare_model: + provider: cloudflare-workers-ai + model: "@cf/meta/llama-3.1-8b-instruct" + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: cloudflare_model + description: Assistant using Cloudflare Workers AI + instruction: You are a helpful assistant. +``` + +## Available Models + +Check the +[Workers AI models catalog](https://developers.cloudflare.com/workers-ai/models/) +for the current list, IDs, and pricing. + +| Model | Description | +| --- | --- | +| `@cf/meta/llama-3.1-8b-instruct` | Meta Llama 3.1 8B Instruct | +| `@cf/mistralai/mistral-small-3.1-24b-instruct` | Mistral Small 3.1 24B Instruct | +| `@cf/qwen/qwen2.5-coder-32b-instruct` | Qwen 2.5 Coder 32B Instruct | + +## How It Works + +Cloudflare Workers AI is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.cloudflare.com/client/v4/accounts/${CLOUDFLARE_ACCOUNT_ID}/ai/v1` +- **Token Variable:** `CLOUDFLARE_API_TOKEN` + +The base URL is templated: `${CLOUDFLARE_ACCOUNT_ID}` is substituted from the +environment when the provider is built, so `CLOUDFLARE_ACCOUNT_ID` must be set in +addition to `CLOUDFLARE_API_TOKEN`. Because Workers AI serves open-weight models +with strict chat templates, Docker Agent coalesces consecutive system messages +into a single leading one for this provider. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/custom/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/custom/index.md new file mode 100644 index 000000000000..427585502d7b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/custom/index.md @@ -0,0 +1,315 @@ +--- +title: "Provider Definitions" +description: "Define reusable provider configurations with shared defaults for any provider type — OpenAI, Anthropic, Google, Bedrock, and more." +keywords: docker agent, ai agents, model providers, llm, provider definitions +weight: 280 +canonical: https://docs.docker.com/ai/docker-agent/providers/custom/ +--- + +_Define reusable provider configurations with shared defaults for any provider type — OpenAI, Anthropic, Google, Bedrock, and more._ + +## Overview + +The `providers` section in your agent YAML lets you define named provider configurations that models can reference. This is useful for: + +- **Grouping shared defaults** — Set temperature, max_tokens, thinking_budget once and share across models +- **Custom endpoints** — Connect to self-hosted models, API proxies, or gateways +- **Centralizing credentials** — Define token_key once for all models using a provider +- **Any provider type** — Works with OpenAI, Anthropic, Google, Bedrock, and any OpenAI-compatible API + +> [!NOTE] +> **Works with any provider** +> +> The `providers` section supports all provider types: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, and any built-in alias. When the `provider` field is not set, it defaults to `openai` for backward compatibility. + +## Configuration + +### OpenAI-compatible endpoint + +```yaml +providers: + my_gateway: + base_url: https://api.example.com/v1 + token_key: MY_API_KEY + +models: + my_model: + provider: my_gateway + model: gpt-4o + +agents: + root: + model: my_model + instruction: You are a helpful assistant. +``` + +### Anthropic with shared defaults + +```yaml +providers: + my_anthropic: + provider: anthropic + token_key: MY_ANTHROPIC_KEY + max_tokens: 16384 + thinking_budget: 8192 + +models: + claude_smart: + provider: my_anthropic + model: claude-sonnet-4-5 + # Inherits max_tokens: 16384, thinking_budget: 8192 + + claude_fast: + provider: my_anthropic + model: claude-haiku-4-5 + thinking_budget: 1024 # Overrides provider default + +agents: + root: + model: claude_smart + instruction: You are a helpful assistant. +``` + +### Google with shared temperature + +```yaml +providers: + my_google: + provider: google + temperature: 0.3 + +models: + gemini: + provider: my_google + model: gemini-2.5-flash + # Inherits temperature: 0.3 + +agents: + root: + model: gemini + instruction: You are a helpful assistant. +``` + +## Provider Properties + +| Property | Type | Description | Default | +| --------------------- | ---------- | ------------------------------------------------------------------------------------- | ------------------------ | +| `provider` | string | Underlying provider type: `openai`, `anthropic`, `google`, `amazon-bedrock`, `dmr`, etc. | `openai` | +| `api_type` | string | API schema: `openai_chatcompletions` or `openai_responses`. Only for OpenAI-compatible providers. When omitted, the API type is selected automatically based on the model name: newer models (gpt-4.1, o-series, gpt-5, Codex) default to `openai_responses`; all others default to `openai_chatcompletions`. | `auto (model-dependent)` | +| `base_url` | string | Base URL for the API endpoint. Required for OpenAI-compatible providers, optional for native providers. | — | +| `token_key` | string | Environment variable name containing the API token. | — | +| `unload_api` | string | Optional path (or absolute URL) to the provider's model-unload endpoint. Used by the [`unload`](../../configuration/hooks/index.md#available-built-ins) built-in hook to release model resources between agent switches. Relative paths resolve against `base_url`'s scheme + host; absolute URLs are used verbatim. Today only Docker Model Runner ships a provider that calls this endpoint; cloud providers don't implement the underlying interface and the hook silently skips them. | — | +| `temperature` | float | Default sampling temperature (0.0–2.0). | — | +| `max_tokens` | int | Default maximum response tokens. | — | +| `top_p` | float | Default nucleus sampling threshold (0.0–1.0). | — | +| `frequency_penalty` | float | Default frequency penalty (-2.0–2.0). | — | +| `presence_penalty` | float | Default presence penalty (-2.0–2.0). | — | +| `parallel_tool_calls` | boolean | Whether to enable parallel tool calls by default. | — | +| `track_usage` | boolean | Whether to track token usage by default. | — | +| `thinking_budget` | string/int | Default reasoning effort/budget. | — | +| `task_budget` | int/object | Default total token budget for an agentic task (forwarded to Anthropic; honored by Claude Opus 4.7 today). Integer shorthand or `{type: tokens, total: N}`. | — | +| `compaction_model` | string | Default model used for session compaction (summary generation) by agents whose model uses this provider. Named model or inline `provider/model` string. Agent-level and model-level `compaction_model` take precedence. | — | +| `provider_opts` | object | Provider-specific options passed through to the client. | — | + +## Default Inheritance + +Models referencing a provider inherit all its defaults. Model-level settings always take precedence: + +```yaml +providers: + my_anthropic: + provider: anthropic + token_key: MY_ANTHROPIC_KEY + max_tokens: 16384 + temperature: 0.7 + thinking_budget: high + +models: + # Inherits everything from provider + claude_default: + provider: my_anthropic + model: claude-sonnet-4-5 + + # Overrides temperature and thinking_budget, inherits the rest + claude_custom: + provider: my_anthropic + model: claude-sonnet-4-5 + temperature: 0.2 + thinking_budget: low +``` + +`compaction_model` works slightly differently: it is not merged into the model +but resolved per agent, with the agent-level `compaction_model` winning over +the model-level one, which wins over the provider-level default. + +## Shorthand Syntax + +Once a provider is defined, you can use the shorthand `provider_name/model` syntax: + +```yaml +agents: + root: + model: my_gateway/gpt-4o-mini # uses the provider's defaults + researcher: + model: my_anthropic/claude-sonnet-4-5 # uses anthropic provider defaults +``` + +## API Types + +Only applicable for OpenAI-compatible providers (when `provider` is `openai` or unset): + +- **`openai_chatcompletions`** — Standard OpenAI Chat Completions API. Works with most OpenAI-compatible endpoints. +- **`openai_responses`** — OpenAI Responses API. For newer models that require the Responses API format. + +> If `api_type` is not set, Docker Agent automatically selects the API type based on the model name. You only need to set `api_type` explicitly to override the detected default. + +## Examples + +### vLLM / Ollama + +```yaml +providers: + local_llm: + base_url: http://localhost:8000/v1 + +agents: + root: + model: local_llm/llama-3.1-8b +``` + +> [!NOTE] +> **Reasoning tokens from OpenAI-compatible providers** +> +> Models that stream reasoning under `delta.reasoning` (e.g. Qwen3 served via OVHcloud AI Endpoints, OpenRouter, or a self-hosted vLLM / SGLang deployment) are fully supported. Docker Agent reads both the `delta.reasoning_content` and `delta.reasoning` fields from the stream, so thinking blocks are captured and shown in the TUI regardless of which field the server uses. + +### API Router (Requesty, LiteLLM) + +```yaml +providers: + router: + base_url: https://router.requesty.ai/v1 + token_key: REQUESTY_API_KEY + +agents: + root: + model: router/anthropic/claude-sonnet-4-5 +``` + +### Azure OpenAI + +```yaml +models: + azure_model: + provider: azure + model: gpt-4o + base_url: https://your-llm.openai.azure.com + provider_opts: + api_version: 2024-12-01-preview +``` + +### Anthropic Team Setup + +```yaml +providers: + team_anthropic: + provider: anthropic + token_key: TEAM_ANTHROPIC_KEY + max_tokens: 32768 + thinking_budget: high + temperature: 0.5 + +models: + architect: + provider: team_anthropic + model: claude-sonnet-4-5 + + reviewer: + provider: team_anthropic + model: claude-haiku-4-5 + thinking_budget: low # faster reviews + +agents: + root: + model: architect + sub_agents: [code_reviewer] + code_reviewer: + model: reviewer +``` + +### Multi-Provider with Shared Defaults + +```yaml +providers: + fast_openai: + base_url: https://api.openai.com/v1 + token_key: OPENAI_API_KEY + temperature: 0.3 + max_tokens: 8192 + + smart_anthropic: + provider: anthropic + token_key: ANTHROPIC_API_KEY + max_tokens: 64000 + thinking_budget: high + +agents: + root: + model: smart_anthropic/claude-sonnet-4-5 + sub_agents: [helper] + helper: + model: fast_openai/gpt-4o-mini +``` + +## Global Providers (User Configuration) + +Providers defined in an agent file only apply to that file. To make a custom +provider available to every command (`docker agent run`, `new`, `models`, ...), +define it once in your user configuration (`~/.config/cagent/config.yaml`) +under the same `providers` key: + +```yaml +# ~/.config/cagent/config.yaml +providers: + myprovider: + base_url: https://llm.corp.example.com/v1 + api_type: openai_chatcompletions + token_key: MYPROVIDER_API_KEY +``` + +The easiest way to register one is the interactive wizard: + +```bash +docker agent setup +# pick "3. Custom OpenAI-compatible endpoint", then enter the base URL, +# API format, and the environment variable holding the API key +``` + +Once registered, the provider works everywhere: + +```bash +docker agent models --provider myprovider # list the endpoint's models +docker agent new --model myprovider/mymodel # build agents with it +docker agent run --model myprovider/mymodel # chat with it +``` + +Global providers are merged into every loaded agent configuration; when an +agent file defines a provider with the same name, the agent file wins. Note +that automatic model selection (`model: auto`) never picks a custom provider, +so reference its models explicitly with `--model <name>/<model>` or +`default_model`. + +## How It Works + +When you reference a provider: + +1. The provider's `provider` field determines which API client to use (defaults to `openai`) +2. The provider's `base_url` and `token_key` are applied to the model (if not already set on the model) +3. All model-level defaults (temperature, max_tokens, thinking_budget, etc.) are inherited (model settings take precedence) +4. For OpenAI-compatible providers, the `api_type` is stored in `provider_opts.api_type` +5. The model is used with the appropriate API client + +A provider with a `base_url` implies `bypass_models_gateway: true` for every +model that references it: user-chosen endpoints are never routed through a +configured models gateway, and such models authenticate with the provider's +own credentials (`token_key`). See +[Gateway Bypass](../../configuration/models/index.md#gateway-bypass). diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/deepseek/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/deepseek/index.md new file mode 100644 index 000000000000..e62710a4f413 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/deepseek/index.md @@ -0,0 +1,96 @@ +--- +title: "DeepSeek" +description: "Use DeepSeek models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, deepseek +weight: 80 +canonical: https://docs.docker.com/ai/docker-agent/providers/deepseek/ +--- + +_Use DeepSeek models with Docker Agent._ + +## Overview + +[DeepSeek](https://www.deepseek.com/) serves its frontier chat and reasoning +models through an OpenAI-compatible API, with strong price/performance on coding +and reasoning tasks. Docker Agent includes built-in support for DeepSeek as an +alias provider. + +## Setup + +1. Create an API key from the [DeepSeek Platform](https://platform.deepseek.com/api_keys). +2. Set the environment variable: + + ```bash + export DEEPSEEK_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use DeepSeek: + +```yaml +agents: + root: + model: deepseek/deepseek-chat + description: Assistant using DeepSeek + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + deepseek_model: + provider: deepseek + model: deepseek-chat + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: deepseek_model + description: Assistant using DeepSeek + instruction: You are a helpful assistant. +``` + +## Available Models + +DeepSeek exposes a small, vendor-controlled model lineup. Check the +[DeepSeek models documentation](https://api-docs.deepseek.com/quick_start/pricing) +for current model IDs, context limits, and pricing. + +| Model | Description | +| --- | --- | +| `deepseek-chat` | DeepSeek-V3, general-purpose chat and tool calling | +| `deepseek-reasoner` | DeepSeek-R1, extended-reasoning model | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +DeepSeek is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.deepseek.com/v1` +- **Token Variable:** `DEEPSEEK_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: deepseek/deepseek-chat + description: Code assistant using DeepSeek-V3 + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/dmr/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/dmr/index.md new file mode 100644 index 000000000000..65b0528bec80 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/dmr/index.md @@ -0,0 +1,253 @@ +--- +title: "Docker Model Runner" +description: "Run AI models locally with Docker — no API keys, no costs, full data privacy." +keywords: docker agent, ai agents, model providers, llm, docker model runner +weight: 90 +canonical: https://docs.docker.com/ai/docker-agent/providers/dmr/ +--- + +_Run AI models locally with Docker — no API keys, no costs, full data privacy._ + +## Overview + +Docker Model Runner (DMR) lets you run open-source AI models directly on your machine. Models run in Docker, so there's no API key needed and no data leaves your computer. + +Docker Agent automatically discovers models you have already pulled from DMR. When no model is explicitly configured, auto-selection prefers a locally-installed model (choosing the model specified via the `model:` key in the agent YAML if it is already pulled locally, or otherwise the first available non-embedding model) rather than always defaulting to `ai/qwen3:latest` and triggering a pull prompt. + +> [!TIP] +> **No API key needed** +> +> DMR runs models locally — your data never leaves your machine. Great for development, sensitive data, or offline use. + +## Prerequisites + +- [Docker Desktop](https://www.docker.com/products/docker-desktop/) with the Model Runner feature enabled +- Verify with: `docker model status --json` + +## Configuration + +### Inline + +```yaml +agents: + root: + model: dmr/ai/qwen3 +``` + +### Named Model + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + max_tokens: 8192 +``` + +## Available Models + +Any model available through Docker Model Runner can be used. Common options: + +| Model | Description | +| ------------- | ----------------------------------------------------- | +| `ai/qwen3` | Qwen 3 — versatile, good for coding and general tasks | +| `ai/llama3.2` | Llama 3.2 — Meta's open-source model | + +## Runtime Flags + +Pass flags to the underlying inference runtime (e.g., llama.cpp) using `provider_opts.runtime_flags`: + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + max_tokens: 8192 + provider_opts: + runtime_flags: ["--threads", "8"] +``` + +Runtime flags also accept a single string: + +```yaml +provider_opts: + runtime_flags: "--threads 8" +``` + +Use only flags your Model Runner backend allows (see `docker model configure --help` and backend docs). **Do not** put sampling parameters (`temperature`, `top_p`, penalties) in `runtime_flags` — set them on the model (`temperature`, `top_p`, etc.); they are sent **per request** via the OpenAI-compatible chat API. + +## Context size + +`max_tokens` controls the **maximum output tokens** per chat completion request. To set the engine's **total context window**, use `provider_opts.context_size`: + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + max_tokens: 4096 # max output tokens (per-request) + provider_opts: + context_size: 32768 # total context window (sent via _configure) +``` + +If `context_size` is omitted, Model Runner uses its default. `max_tokens` is **not** used as the context window. + +Docker Agent's auto-compaction scales its summary and keep-tail token budgets proportionally to `context_size`. This ensures compaction works correctly even for small context windows — for example, an 8k-token local model will not have its session history wiped during compaction. + +## Thinking / reasoning budget + +When using the **llama.cpp** backend, `thinking_budget` is sent as structured `llamacpp.reasoning-budget` on `_configure` (maps to `--reasoning-budget`). String efforts use the same token mapping as other providers; `adaptive` maps to unlimited (`-1`). + +When using the **vLLM** backend, `thinking_budget` is sent as `thinking_token_budget` in each chat completion request. Effort levels map to token counts using the same scale as other providers; `adaptive` maps to unlimited (`-1`). + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + thinking_budget: medium # llama.cpp: reasoning-budget=8192; vLLM: thinking_token_budget=8192 +``` + +On **MLX** and **SGLang** backends, `thinking_budget` is silently ignored — those engines do not currently expose a per-request reasoning token budget knob. + +## vLLM-specific configuration + +When running a model on the **vLLM** backend, additional engine-level settings can be passed via `provider_opts` and are forwarded to model-runner's `_configure` endpoint: + +- `gpu_memory_utilization` — fraction of GPU memory (0.0–1.0) vLLM may use. Values outside this range are rejected. +- `hf_overrides` — map of Hugging Face config overrides applied when vLLM loads the model. + +```yaml +models: + vllm-local: + provider: dmr + model: ai/some-model-safetensors + provider_opts: + gpu_memory_utilization: 0.9 + hf_overrides: + max_model_len: 8192 + dtype: bfloat16 +``` + +`hf_overrides` keys (including nested ones) must match `^[a-zA-Z_][a-zA-Z0-9_]*$` — the same rule model-runner enforces server-side to block injection via flags. Invalid keys are rejected at client creation time so you fail fast instead of after a round-trip. + +These options are ignored on non-vLLM backends. + +## Keeping models resident in memory (`keep_alive`) + +By default model-runner unloads idle models after a few minutes. Override the idle timeout via `provider_opts.keep_alive`: + +```yaml +models: + sticky: + provider: dmr + model: ai/qwen3 + provider_opts: + keep_alive: "30m" # duration string + # keep_alive: "0" # unload immediately after each request + # keep_alive: "-1" # keep loaded forever +``` + +Accepted values: any Go duration string (`"30s"`, `"5m"`, `"1h"`, `"2h30m"`), `"0"` (immediate unload), or `"-1"` (never unload). Invalid values are rejected before the configure request is sent. + +## Unloading models on agent switch + +In multi-agent setups where two DMR models can't fit in GPU memory simultaneously, wire the [`unload`](../../configuration/hooks/index.md#available-built-ins) built-in hook into each agent's `on_agent_switch` chain. Every time the active agent transfers control, the runtime POSTs to the engine's `_unload` endpoint to free the previous model's resources before the next one is loaded: + +```yaml +agents: + coder: + model: qwen3-large + handoffs: [reviewer] + hooks: + on_agent_switch: + - type: builtin + command: unload + reviewer: + model: qwen3-coder + handoffs: [coder] + hooks: + on_agent_switch: + - type: builtin + command: unload +``` + +The unload URL is derived from `base_url` by replacing the trailing `/v1` segment (e.g. `http://127.0.0.1:12434/engines/llama.cpp/v1/` → `http://127.0.0.1:12434/engines/llama.cpp/_unload`). Override it explicitly via the provider-level `unload_api` field when running against a non-standard model-runner deployment: + +```yaml +providers: + my_dmr: + provider: dmr + base_url: http://model-runner.docker.internal/engines/v1 + unload_api: /engines/_unload # default; absolute URLs also work + +models: + big: + provider: my_dmr + model: ai/qwen3 +``` + +Unload errors are logged and swallowed — a stuck or unreachable engine never blocks an agent transfer (each call is bounded to 10 s). Pair this with [`keep_alive`](#keeping-models-resident-in-memory-keep_alive) only when you want the model to *also* survive idle periods within a single agent's run; the hook controls **between-agent** unloads independently. + +> [!WARNING] +> **Single-tenant assumption** +> +> The `_unload` endpoint is engine-level: it evicts the model from DMR's memory regardless of who is using it. If two concurrent sessions on the same runtime (e.g. an API server serving multiple users) hit the same agent, switching away in session A will yank the model out from under session B's in-flight request, which then has to wait for a reload. Wire `unload` only when the agents using these models are not run concurrently — typically a single TUI/CLI session. + +See [`examples/unload_on_switch.yaml`](https://github.com/docker/docker-agent/blob/main/examples/unload_on_switch.yaml) for the full example. + +## Operating mode (`mode`) + +Model-runner normally infers the backend mode from the request path. You can pin it explicitly via `provider_opts.mode`: + +```yaml +provider_opts: + mode: embedding # one of: completion, embedding, reranking, image-generation +``` + +Most agents don't need this — leave it unset unless you know you need it. + +## Raw runtime flags (`raw_runtime_flags`) + +`runtime_flags` (a list) is the preferred way to pass flags. If you have a pre-built command-line string you'd rather ship verbatim, use `raw_runtime_flags` instead: + +```yaml +provider_opts: + raw_runtime_flags: "--threads 8 --batch-size 512" +``` + +Model-runner parses the string with shell-style word splitting. `runtime_flags` and `raw_runtime_flags` are mutually exclusive — setting both is an error. + +## Speculative Decoding + +Use a smaller draft model to predict tokens ahead for faster inference: + +```yaml +models: + fast-local: + provider: dmr + model: ai/qwen3:14B + max_tokens: 8192 + provider_opts: + speculative_draft_model: ai/qwen3:0.6B-F16 + speculative_num_tokens: 16 + speculative_acceptance_rate: 0.8 +``` + +## Custom Endpoint + +If `base_url` is omitted, Docker Agent auto-discovers the DMR endpoint. To set manually: + +```yaml +models: + local: + provider: dmr + model: ai/qwen3 + base_url: http://127.0.0.1:12434/engines/llama.cpp/v1 +``` + +## Troubleshooting + +- **Plugin not found:** Ensure Docker Model Runner is enabled in Docker Desktop. Docker Agent will fall back to the default URL. +- **Endpoint empty:** Verify the Model Runner is running with `docker model status --json`. +- **Performance:** Use `runtime_flags` to tune GPU layers (`--ngl`) and thread count (`--threads`). diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/fireworks/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/fireworks/index.md new file mode 100644 index 000000000000..9644653071f8 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/fireworks/index.md @@ -0,0 +1,102 @@ +--- +title: "Fireworks AI" +description: "Use Fireworks AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, fireworks ai +weight: 100 +canonical: https://docs.docker.com/ai/docker-agent/providers/fireworks/ +--- + +_Use Fireworks AI models with Docker Agent._ + +## Overview + +[Fireworks AI](https://fireworks.ai/) is a fast inference host for open-weight +models, serving Kimi K2, Llama, Qwen, DeepSeek, GLM and others through an +OpenAI-compatible API. Docker Agent includes built-in support for Fireworks AI +as an alias provider. + +## Setup + +1. Create an API key from the [Fireworks dashboard](https://fireworks.ai/account/api-keys). +2. Set the environment variable: + + ```bash + export FIREWORKS_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Fireworks AI: + +```yaml +agents: + root: + model: fireworks/accounts/fireworks/models/kimi-k2-instruct + description: Assistant using Fireworks AI + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + fireworks_model: + provider: fireworks + model: accounts/fireworks/models/kimi-k2-instruct + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: fireworks_model + description: Assistant using Fireworks AI + instruction: You are a helpful assistant. +``` + +## Available Models + +Fireworks serves a broad, changing catalog of open-weight models. Model IDs use +the `accounts/fireworks/models/<name>` form. Check the +[Fireworks model library](https://fireworks.ai/models) for current IDs, context +limits, and pricing. + +| Model | Description | +| --- | --- | +| `accounts/fireworks/models/kimi-k2-instruct` | Kimi K2, large open MoE chat and tool-calling model | +| `accounts/fireworks/models/llama-v3p3-70b-instruct` | Llama 3.3 70B instruct | +| `accounts/fireworks/models/qwen3-235b-a22b` | Qwen 3 235B MoE | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +Fireworks AI is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.fireworks.ai/inference/v1` +- **Token Variable:** `FIREWORKS_API_KEY` + +Because Fireworks fronts open-weight models whose chat templates may reject more +than one leading system message, Docker Agent coalesces its per-source system +messages into a single one for this provider. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: fireworks/accounts/fireworks/models/kimi-k2-instruct + description: Code assistant using Kimi K2 on Fireworks AI + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/github-copilot/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/github-copilot/index.md new file mode 100644 index 000000000000..3e4e7c3cd3e5 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/github-copilot/index.md @@ -0,0 +1,161 @@ +--- +title: "GitHub Copilot" +description: "Use GitHub Copilot's hosted models (GPT-4o, Claude, Gemini, and more) with Docker Agent through your GitHub subscription." +keywords: docker agent, ai agents, model providers, llm, github copilot +weight: 110 +canonical: https://docs.docker.com/ai/docker-agent/providers/github-copilot/ +--- + +_Use GitHub Copilot's hosted models with Docker Agent through your existing GitHub subscription._ + +## Overview + +GitHub Copilot exposes an OpenAI-compatible Chat Completions API at +`https://api.githubcopilot.com`. Docker Agent ships with built-in support for +it as the `github-copilot` provider, so any user with a paid GitHub Copilot +subscription can reuse their entitlement from Docker Agent. + +## Prerequisites + +- An active **GitHub Copilot** subscription (Individual, Business, or Enterprise). +- A **personal access token** with the `copilot` scope, exported as `GITHUB_TOKEN`. + +```bash +export GITHUB_TOKEN="ghp_..." +``` + +## Running Evals + +Eval cases (`docker agent eval`) run in isolated containers. Unlike dedicated +provider API keys, `GITHUB_TOKEN` and `GH_TOKEN` are **not** forwarded into +eval containers automatically, because a GitHub token grants far broader +access than a model API key. Pass the token explicitly: + +```bash +docker agent eval agent.yaml ./evals -e GITHUB_TOKEN +``` + +See [Evaluation](../../features/evaluation/index.md#provider-credentials) +for details, including behavior with `--env-from-file`. + +## Configuration + +### Inline + +```yaml +agents: + root: + model: github-copilot/gpt-4o + instruction: You are a helpful assistant. +``` + +### Named model + +```yaml +models: + copilot: + provider: github-copilot + model: gpt-4o + temperature: 0.7 + max_tokens: 4000 + +agents: + root: + model: copilot +``` + +## Available Models + +The exact set of models you can call depends on your Copilot plan. The most +commonly available ones today are: + +| Model | Best For | +| ------------------------ | ----------------------------------- | +| `gpt-4o` | Multimodal, balanced performance | +| `gpt-4o-mini` | Fast and cheap | +| `claude-sonnet-4` | Strong coding and analysis | +| `gemini-2.5-pro` | Google's flagship, large context | +| `o3-mini` | Reasoning-focused | + +Check the +[GitHub Copilot documentation](https://docs.github.com/en/copilot) +for the current model list. + +## `Copilot-Integration-Id` Header + +GitHub's Copilot API rejects requests that don't carry a +`Copilot-Integration-Id` header with a `Bad Request` error. Docker Agent +automatically sends `copilot-developer-cli` for the `github-copilot` +provider, so PAT-based usage works out of the box. + +We specifically chose `copilot-developer-cli` (instead of, say, +`vscode-chat`) because it is the integration id accepted by the Copilot +API for **both** OAuth tokens and Personal Access Tokens. Most +Docker Agent users authenticate with a PAT exported as `GITHUB_TOKEN`, +and `vscode-chat` is rejected for those tokens. + +If you need to send a different integration id — for example if your +organization allows-lists a specific value — you can override it via +`provider_opts.http_headers`: + +```yaml +models: + copilot: + provider: github-copilot + model: gpt-4o + provider_opts: + http_headers: + Copilot-Integration-Id: my-custom-integration +``` + +Header names are matched case-insensitively, so `copilot-integration-id` +works too. + +## Chat Completions vs. Responses API + +GitHub Copilot proxies OpenAI models behind two endpoints: the legacy +`/chat/completions` and the newer `/responses`. Newer models (the `gpt-5` +family, Codex variants, etc.) are only served via `/responses` and reject +`/chat/completions` with a `400 Bad Request`. Docker Agent auto-selects the +right endpoint per model, so no configuration is needed in the common case. + +If you ever need to force one or the other, set `api_type` explicitly: + +```yaml +models: + copilot: + provider: github-copilot + model: gpt-5 + provider_opts: + api_type: openai_responses # or openai_chatcompletions +``` + +## Custom HTTP Headers + +`provider_opts.http_headers` is a generic escape hatch that works for any +OpenAI-compatible provider, not just GitHub Copilot. Every key/value pair +is added to every outgoing request: + +```yaml +models: + my_model: + provider: openai + model: gpt-4o + provider_opts: + http_headers: + X-Request-Source: docker-agent + X-Tenant-Id: my-team +``` + +## How It Works + +GitHub Copilot is implemented as a built-in alias in Docker Agent: + +- **API type:** OpenAI-compatible (Chat Completions) +- **Base URL:** `https://api.githubcopilot.com` +- **Token variable:** `GITHUB_TOKEN` +- **Default headers:** `Copilot-Integration-Id: copilot-developer-cli` + +This means the same client as OpenAI is used, so every OpenAI feature +supported by Docker Agent (tool calling, structured output, multimodal +inputs, etc.) is available when the underlying model supports it. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/google/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/google/index.md new file mode 100644 index 000000000000..efbb27817169 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/google/index.md @@ -0,0 +1,174 @@ +--- +title: "Google Gemini" +description: "Use Gemini 2.5 Flash, Gemini 3 Pro, and other Google models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, google gemini +weight: 120 +canonical: https://docs.docker.com/ai/docker-agent/providers/google/ +--- + +_Use Gemini 2.5 Flash, Gemini 3 Pro, and other Google models with Docker Agent._ + +## Setup + +Docker Agent reads the first credential it finds from these environment variables (see `pkg/model/provider/gemini/client.go`): + +| Variable | Purpose | +| --------------------------- | ----------------------------------------------------------------------------------- | +| `GOOGLE_API_KEY` | Primary Gemini API key. | +| `GEMINI_API_KEY` | Alternative name for the Gemini API key (also used by the official Google SDK). | +| `GOOGLE_GENAI_USE_VERTEXAI` | When set (any value), routes through Vertex AI instead of the Gemini Developer API. | +| `GOOGLE_CLOUD_PROJECT` | GCP project used when `GOOGLE_GENAI_USE_VERTEXAI` is set or for Vertex AI Model Garden. | +| `GOOGLE_CLOUD_LOCATION` | GCP region for Vertex AI (defaults to the SDK default). | + +```bash +# Gemini Developer API +export GOOGLE_API_KEY="AI..." # or GEMINI_API_KEY + +# Vertex AI (no API key; uses Application Default Credentials) +gcloud auth application-default login +export GOOGLE_GENAI_USE_VERTEXAI=1 +export GOOGLE_CLOUD_PROJECT="my-gcp-project" +export GOOGLE_CLOUD_LOCATION="us-central1" +``` + +## Configuration + +### Inline + +```yaml +agents: + root: + model: google/gemini-3.5-flash +``` + +### Named Model + +```yaml +models: + gemini: + provider: google + model: gemini-3.5-flash + temperature: 0.5 +``` + +## Available Models + +| Model | Best For | +| ------------------ | ------------------------------- | +| `gemini-3-pro` | Most capable Gemini model | +| `gemini-3-flash` | Fast, efficient, good balance | +| `gemini-2.5-flash` | Fast inference, cost-effective | +| `gemini-2.5-pro` | Strong reasoning, large context | + +## Thinking Budget + +Gemini supports two approaches depending on the model version: + +> [!WARNING] +> **Different thinking formats** +> +> Gemini 2.5 uses **token-based** budgets (integers). Gemini 3 uses **level-based** budgets (strings like `low`, `high`). Make sure you use the right format for your model version. + +### Gemini 2.5 (Token-based) + +```yaml +models: + gemini-no-thinking: + provider: google + model: gemini-2.5-flash + thinking_budget: 0 # disable thinking + + gemini-dynamic: + provider: google + model: gemini-2.5-flash + thinking_budget: -1 # dynamic (model decides) — default + + gemini-fixed: + provider: google + model: gemini-2.5-flash + thinking_budget: 8192 # fixed token budget +``` + +### Gemini 3 (Level-based) + +```yaml +models: + gemini-3-pro: + provider: google + model: gemini-3-pro + thinking_budget: high # default for Pro: low | high + + gemini-3-flash: + provider: google + model: gemini-3-flash + thinking_budget: medium # default for Flash: minimal | low | medium | high +``` + +## Built-in Tools (Grounding) + +Gemini models support built-in tools that let the model access Google Search and Google Maps +directly during generation. Enable them via `provider_opts`: + +```yaml +models: + gemini-grounded: + provider: google + model: gemini-2.5-flash + provider_opts: + google_search: true + google_maps: true + code_execution: true +``` + +| Option | Description | +| ---------------- | ---------------------------------------------------- | +| `google_search` | Enables Google Search grounding for up-to-date info | +| `google_maps` | Enables Google Maps grounding for location queries | +| `code_execution` | Enables server-side code execution for computations | + +## Vertex AI Model Garden + +You can use non-Gemini models (e.g. Claude, Llama) hosted on Google Cloud's +[Vertex AI Model Garden](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models) +through the `google` provider. When a `publisher` is specified in `provider_opts`, +requests are routed through the appropriate Vertex AI endpoint instead of the +Gemini SDK: + +- **Anthropic Claude** (`publisher: anthropic`) uses the Anthropic-native + `:rawPredict` / `:streamRawPredict` endpoints. Claude models on Vertex AI do + not support the OpenAI `/chat/completions` path. +- **Other publishers** (e.g. `meta`, `mistral`) use Vertex AI's + OpenAI-compatible `/chat/completions` endpoint. + +### Authentication + +Vertex AI uses Google Cloud Application Default Credentials (ADC). Make sure you +are authenticated: + +```bash +gcloud auth application-default login +``` + +### Configuration + +```yaml +models: + claude-on-vertex: + provider: google + model: claude-sonnet-4-20250514 + provider_opts: + project: my-gcp-project # GCP project ID (or set GOOGLE_CLOUD_PROJECT) + location: us-east5 # GCP region (or set GOOGLE_CLOUD_LOCATION) + publisher: anthropic # Model publisher (anthropic, meta, etc.) +``` + +| Option | Description | +| ----------- | ------------------------------------------------------------------------------------ | +| `project` | GCP project ID. Falls back to `GOOGLE_CLOUD_PROJECT` env var | +| `location` | GCP region (e.g. `us-east5`, `us-central1`). Falls back to `GOOGLE_CLOUD_LOCATION` | +| `publisher` | Model publisher (e.g. `anthropic`, `meta`, `mistral`). Must not be `google` | + +> [!NOTE] +> **Gemini models on Vertex AI** +> +> Setting `publisher: google` (or omitting `publisher`) uses the native Gemini SDK path. The Model Garden endpoint is only used for non-Google publishers. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/groq/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/groq/index.md new file mode 100644 index 000000000000..4c7d3945581c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/groq/index.md @@ -0,0 +1,99 @@ +--- +title: "Groq" +description: "Use Groq fast-inference models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, groq +weight: 130 +canonical: https://docs.docker.com/ai/docker-agent/providers/groq/ +--- + +_Use Groq models with Docker Agent._ + +## Overview + +[Groq](https://groq.com/) serves open-weight models on its LPU inference engine +through an OpenAI-compatible API, with a focus on very low latency. Docker Agent +includes built-in support for Groq as an alias provider. + +## Setup + +1. Create an API key from the [Groq Console](https://console.groq.com/keys). +2. Set the environment variable: + + ```bash + export GROQ_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Groq: + +```yaml +agents: + root: + model: groq/llama-3.3-70b-versatile + description: Assistant using Groq + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + groq_model: + provider: groq + model: llama-3.3-70b-versatile + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: groq_model + description: Assistant using Groq + instruction: You are a helpful assistant. +``` + +## Available Models + +Groq hosts a rotating catalogue of open-weight models. Check the +[Groq models documentation](https://console.groq.com/docs/models) for current +model IDs, context limits, and rate limits. + +| Model | Description | +| --- | --- | +| `llama-3.3-70b-versatile` | Llama 3.3 70B, reliable general-purpose chat and tool calling | +| `llama-3.1-8b-instant` | Llama 3.1 8B, fastest and cheapest | +| `openai/gpt-oss-120b` | GPT-OSS 120B, strong reasoning and tool calling | +| `openai/gpt-oss-20b` | GPT-OSS 20B, compact reasoning model | +| `qwen/qwen3-32b` | Qwen3 32B, reasoning and tool calling | +| `meta-llama/llama-4-scout-17b-16e-instruct` | Llama 4 Scout MoE | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +Groq is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.groq.com/openai/v1` +- **Token Variable:** `GROQ_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: groq/llama-3.3-70b-versatile + description: Code assistant using Llama 3.3 + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/huggingface/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/huggingface/index.md new file mode 100644 index 000000000000..8b5860100a71 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/huggingface/index.md @@ -0,0 +1,101 @@ +--- +title: "Hugging Face" +description: "Use Hugging Face Inference Providers with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, hugging face +weight: 140 +canonical: https://docs.docker.com/ai/docker-agent/providers/huggingface/ +--- + +_Use Hugging Face Inference Providers with Docker Agent._ + +## Overview + +[Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers/index) +routes requests to open models (Llama, Qwen, DeepSeek, Kimi, GLM and others) +across many backends through a single OpenAI-compatible endpoint. Docker Agent +includes built-in support for Hugging Face as an alias provider. + +## Setup + +1. Create a token from the [Hugging Face token settings](https://huggingface.co/settings/tokens). +2. Set the environment variable: + + ```bash + export HF_TOKEN=your-token + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Hugging Face: + +```yaml +agents: + root: + model: huggingface/meta-llama/Llama-3.3-70B-Instruct + description: Assistant using Hugging Face Inference Providers + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + huggingface_model: + provider: huggingface + model: meta-llama/Llama-3.3-70B-Instruct + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: huggingface_model + description: Assistant using Hugging Face Inference Providers + instruction: You are a helpful assistant. +``` + +## Available Models + +Hugging Face routes to a broad, changing catalog of open-weight models. Check the +[Hugging Face models page](https://huggingface.co/models?inference_provider=all) +for current model IDs, context limits, and pricing. + +| Model | Description | +| --- | --- | +| `meta-llama/Llama-3.3-70B-Instruct` | Llama 3.3 70B, general-purpose chat and tool calling | +| `Qwen/Qwen3-235B-A22B` | Qwen3 235B mixture-of-experts instruct model | +| `deepseek-ai/DeepSeek-V3.2` | DeepSeek, strong coding and reasoning | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +Hugging Face is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://router.huggingface.co/v1` +- **Token Variable:** `HF_TOKEN` + +Because Hugging Face fronts open-weight models whose chat templates may reject +more than one leading system message, Docker Agent coalesces its per-source +system messages into a single one for this provider. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: huggingface/Qwen/Qwen3-Coder-480B-A35B-Instruct + description: Code assistant using Qwen3 Coder on Hugging Face + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/local/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/local/index.md new file mode 100644 index 000000000000..c4122a108cdd --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/local/index.md @@ -0,0 +1,223 @@ +--- +title: "Local Models (Ollama, vLLM, LocalAI)" +description: "Run Docker Agent with locally hosted models for privacy, offline use, or cost savings." +keywords: docker agent, ai agents, model providers, llm, local models, ollama, vllm, localai, offline models +linkTitle: "Local Models" +weight: 150 +canonical: https://docs.docker.com/ai/docker-agent/providers/local/ +aliases: + - /ai/docker-agent/local-models/ + - /ai/docker-agent/providers/ollama/ +--- + +_Run Docker Agent with locally hosted models for privacy, offline use, or cost savings._ + +## Overview + +Docker Agent can connect to any OpenAI-compatible local model server. This guide covers the most popular options: + +- **Ollama** — Easy-to-use local model runner +- **vLLM** — High-performance inference server +- **LocalAI** — OpenAI-compatible API for various backends + +> [!TIP] +> **Docker Model Runner** +> +> For the easiest local model experience, consider [Docker Model Runner](../dmr/index.md) which is built into Docker Desktop and requires no additional setup. + +## Ollama + +Ollama is a popular tool for running LLMs locally. Docker Agent includes a built-in `ollama` alias for easy configuration. + +### Setup + +1. Install Ollama from [ollama.ai](https://ollama.ai/) +2. Pull a model: + + ```bash + ollama pull llama3.2 + ollama pull qwen2.5-coder + ``` + +3. Start the Ollama server (usually runs automatically): + + ```bash + ollama serve + ``` + +### Configuration + +Use the built-in `ollama` alias: + +```yaml +agents: + root: + model: ollama/llama3.2 + description: Local assistant + instruction: You are a helpful assistant. +``` + +The `ollama` alias automatically uses: + +- **Base URL:** `http://localhost:11434/v1` +- **API Type:** OpenAI-compatible +- **No API key required** + +### Custom Port or Host + +If Ollama runs on a different host or port: + +```yaml +models: + my_ollama: + provider: ollama + model: llama3.2 + base_url: http://192.168.1.100:11434/v1 + +agents: + root: + model: my_ollama + description: Remote Ollama assistant + instruction: You are a helpful assistant. +``` + +### Popular Ollama Models + +| Model | Size | Best For | +| ---------------- | ---- | --------------------- | +| `llama3.2` | 3B | General purpose, fast | +| `llama3.1` | 8B | Better reasoning | +| `qwen2.5-coder` | 7B | Code generation | +| `mistral` | 7B | General purpose | +| `codellama` | 7B | Code tasks | +| `deepseek-coder` | 6.7B | Code generation | + +## vLLM + +vLLM is a high-performance inference server optimized for throughput. + +### Setup + +```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 +``` + +### Configuration + +```yaml +providers: + vllm: + api_type: openai_chatcompletions + base_url: http://localhost:8000/v1 + +agents: + root: + model: vllm/meta-llama/Llama-3.2-3B-Instruct + description: vLLM-powered assistant + instruction: You are a helpful assistant. +``` + +## LocalAI + +LocalAI provides an OpenAI-compatible API that works with various backends. + +### Setup + +```bash +# Run with Docker +docker run -p 8080:8080 --name local-ai \ + -v ./models:/models \ + localai/localai:latest-cpu +``` + +### Configuration + +```yaml +providers: + localai: + api_type: openai_chatcompletions + base_url: http://localhost:8080/v1 + +agents: + root: + model: localai/gpt4all-j + description: LocalAI assistant + instruction: You are a helpful assistant. +``` + +## Generic Custom Provider + +For any OpenAI-compatible server: + +```yaml +providers: + my_server: + api_type: openai_chatcompletions + base_url: http://localhost:8000/v1 + # token_key: MY_API_KEY # if auth required + +agents: + root: + model: my_server/model-name + description: Custom server assistant + instruction: You are a helpful assistant. +``` + +## Performance Tips + +> [!NOTE] +> **Local Model Considerations** +> +> - **Memory:** Larger models need more RAM/VRAM. A 7B model typically needs 8-16GB RAM. +> - **GPU:** GPU acceleration dramatically improves speed. Check your server's GPU support. +> - **Context length:** Local models often have smaller context windows than cloud models. +> - **Tool calling:** Not all local models support function/tool calling. Test your model's capabilities. + +## Example: Offline Development Agent + +```yaml +agents: + developer: + model: ollama/qwen2.5-coder + description: Offline code assistant + instruction: | + You are a software developer working offline. + Focus on code quality and clear explanations. + max_iterations: 20 + toolsets: + - type: filesystem + - type: shell + - type: think + - type: todo +``` + +## Troubleshooting + +### Connection Refused + +Ensure your model server is running and accessible: + +```bash +curl http://localhost:11434/v1/models # Ollama +curl http://localhost:8000/v1/models # vLLM +``` + +### Model Not Found + +Verify the model is downloaded/available: + +```bash +ollama list # List available Ollama models +``` + +### Slow Responses + +- Check if GPU acceleration is enabled +- Try a smaller model +- Reduce `max_tokens` in your config diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/minimax/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/minimax/index.md new file mode 100644 index 000000000000..e6eeac606e38 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/minimax/index.md @@ -0,0 +1,92 @@ +--- +title: "MiniMax" +description: "Use MiniMax AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, minimax +weight: 160 +canonical: https://docs.docker.com/ai/docker-agent/providers/minimax/ +--- + +_Use MiniMax AI models with Docker Agent._ + +## Overview + +MiniMax provides AI models through an OpenAI-compatible API. Docker Agent includes built-in support for MiniMax as an alias provider. + +## Setup + +1. Get an API key from [MiniMax](https://www.minimaxi.com/) +2. Set the environment variable: + + ```bash + export MINIMAX_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use MiniMax: + +```yaml +agents: + root: + model: minimax/MiniMax-M2.5 + description: Assistant using MiniMax + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + minimax_model: + provider: minimax + model: MiniMax-M2.5 + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: minimax_model + description: Assistant using MiniMax + instruction: You are a helpful assistant. +``` + +## Available Models + +Check the [MiniMax documentation](https://www.minimaxi.com/document/introduction) for the current model catalog. + +| Model | Description | +| ------------------------ | ----------------------------------------------- | +| `MiniMax-M2.5` | Peak performance, 204K context | +| `MiniMax-M2.5-highspeed` | Same as M2.5 but faster (~100 tps) | +| `MiniMax-M2.1` | Multi-language programming capabilities | +| `MiniMax-M2.1-highspeed` | Faster variant of M2.1 (~100 tps) | +| `MiniMax-M2` | Agentic capabilities, advanced reasoning | + +## How It Works + +MiniMax is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai`) +- **Base URL:** `https://api.minimax.io/v1` +- **Token Variable:** `MINIMAX_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: minimax/MiniMax-M2.5 + description: Code assistant using MiniMax + instruction: | + You are an expert programmer using MiniMax M2.5. + Write clean, well-documented code. + Follow best practices for the language being used. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/mistral/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/mistral/index.md new file mode 100644 index 000000000000..7e40916d53c6 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/mistral/index.md @@ -0,0 +1,106 @@ +--- +title: "Mistral" +description: "Use Mistral AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, mistral +weight: 170 +canonical: https://docs.docker.com/ai/docker-agent/providers/mistral/ +--- + +_Use Mistral AI models with Docker Agent._ + +## Overview + +Mistral AI provides powerful language models through an OpenAI-compatible API. Docker Agent includes built-in support for Mistral as an alias provider. + +## Setup + +1. Get an API key from [Mistral Console](https://console.mistral.ai/) +2. Set the environment variable: + + ```bash + export MISTRAL_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Mistral: + +```yaml +agents: + root: + model: mistral/mistral-large-latest + description: Assistant using Mistral + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + mistral: + provider: mistral + model: mistral-large-latest + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: mistral + description: Assistant using Mistral + instruction: You are a helpful assistant. +``` + +## Available Models + +| Model | Description | Context | +| ----------------------- | --------------------------------- | ------- | +| `mistral-large-latest` | Most capable Mistral model | 128K | +| `mistral-medium-latest` | Balanced performance and cost | 128K | +| `mistral-small-latest` | Fast and cost-effective (default) | 128K | +| `codestral-latest` | Optimized for code generation | 32K | +| `open-mistral-nemo` | Open-weight model | 128K | +| `ministral-8b-latest` | Compact 8B parameter model | 128K | +| `ministral-3b-latest` | Smallest Mistral model | 128K | + +Check the [Mistral Models documentation](https://docs.mistral.ai/getting-started/models/) for the latest available models. + +## Auto-Detection + +When you run `docker agent run` without specifying a config and no project-level `docker-agent.yaml`, `docker-agent.yml`, or `docker-agent.hcl` exists, Docker Agent automatically detects available providers. If `MISTRAL_API_KEY` is set and higher-priority providers (OpenAI, Anthropic, Google) are not available, Mistral will be used with `mistral-small-latest` as the default model. + +## Extended Thinking + +Docker Agent's `thinking_budget` field is **not applied** to Mistral models: the underlying OpenAI-compatible client only sends `reasoning_effort` for OpenAI reasoning model names (o-series, gpt-5). Setting `thinking_budget` on a Mistral model passes config validation but has no effect on the request. + +Mistral reasoning models (e.g. `magistral`) reason on their own without configuration. For non-reasoning models, use the [think tool](../../tools/think/index.md) instead. + +## How It Works + +Mistral is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.mistral.ai/v1` +- **Token Variable:** `MISTRAL_API_KEY` + +This means Mistral uses the same client as OpenAI, making it fully compatible with all OpenAI features supported by Docker Agent. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: mistral/codestral-latest + description: Expert code assistant + instruction: | + You are an expert programmer using Codestral. + Write clean, efficient, well-documented code. + Explain your reasoning when helpful. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/moonshot/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/moonshot/index.md new file mode 100644 index 000000000000..f370592b492d --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/moonshot/index.md @@ -0,0 +1,97 @@ +--- +title: "Moonshot AI" +description: "Use Moonshot AI (Kimi) models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, moonshot ai +weight: 180 +canonical: https://docs.docker.com/ai/docker-agent/providers/moonshot/ +--- + +_Use Moonshot AI (Kimi) models with Docker Agent._ + +## Overview + +[Moonshot AI](https://www.moonshot.ai/) serves its Kimi model family through an +OpenAI-compatible API. The Kimi K2 models have strong momentum for coding and +agentic tasks. Docker Agent includes built-in support for Moonshot AI as an +alias provider. + +## Setup + +1. Create an API key from the [Moonshot AI console](https://platform.moonshot.ai/console/api-keys). +2. Set the environment variable: + + ```bash + export MOONSHOT_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Moonshot AI: + +```yaml +agents: + root: + model: moonshot/kimi-k2-0905-preview + description: Assistant using Moonshot AI + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + moonshot_model: + provider: moonshot + model: kimi-k2-0905-preview + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: moonshot_model + description: Assistant using Moonshot AI + instruction: You are a helpful assistant. +``` + +## Available Models + +Moonshot AI exposes a vendor-controlled Kimi model lineup. Check the +[Moonshot API documentation](https://platform.moonshot.ai/docs/api) for current +model IDs, context limits, and pricing. + +| Model | Description | +| --- | --- | +| `kimi-k2-0905-preview` | Kimi K2, general-purpose chat, coding, and tool calling | +| `kimi-k2-turbo-preview` | Kimi K2 optimized for higher throughput | +| `kimi-k2-thinking` | Kimi K2 extended-reasoning model | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +Moonshot AI is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.moonshot.ai/v1` +- **Token Variable:** `MOONSHOT_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: moonshot/kimi-k2-0905-preview + description: Code assistant using Kimi K2 + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/nebius/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/nebius/index.md new file mode 100644 index 000000000000..deadbaaea4b3 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/nebius/index.md @@ -0,0 +1,90 @@ +--- +title: "Nebius" +description: "Use Nebius AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, nebius +weight: 190 +canonical: https://docs.docker.com/ai/docker-agent/providers/nebius/ +--- + +_Use Nebius AI models with Docker Agent._ + +## Overview + +Nebius provides AI models through an OpenAI-compatible API. Docker Agent includes built-in support for Nebius as an alias provider. + +## Setup + +1. Get an API key from [Nebius AI](https://nebius.ai/) +2. Set the environment variable: + + ```bash + export NEBIUS_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Nebius: + +```yaml +agents: + root: + model: nebius/deepseek-ai/DeepSeek-V3 + description: Assistant using Nebius + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + nebius_model: + provider: nebius + model: deepseek-ai/DeepSeek-V3 + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: nebius_model + description: Assistant using Nebius + instruction: You are a helpful assistant. +``` + +## Available Models + +Nebius hosts various open models. Check the [Nebius documentation](https://nebius.ai/docs) for the current model catalog. + +| Model | Description | +| ----------------------------------- | ------------------------------- | +| `deepseek-ai/DeepSeek-V3` | DeepSeek V3 model | +| `Qwen/Qwen2.5-72B-Instruct` | Qwen 2.5 72B instruction-tuned | +| `meta-llama/Llama-3.3-70B-Instruct` | Llama 3.3 70B instruction-tuned | + +## How It Works + +Nebius is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.studio.nebius.com/v1` +- **Token Variable:** `NEBIUS_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: nebius/deepseek-ai/DeepSeek-V3 + description: Code assistant using DeepSeek + instruction: | + You are an expert programmer using DeepSeek V3. + Write clean, well-documented code. + Follow best practices for the language being used. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/nvidia/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/nvidia/index.md new file mode 100644 index 000000000000..330dad99f0bd --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/nvidia/index.md @@ -0,0 +1,115 @@ +--- +title: "NVIDIA NIM" +description: "Use NVIDIA NIM models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, nvidia, nim, nemotron +weight: 290 +canonical: https://docs.docker.com/ai/docker-agent/providers/nvidia/ +--- + +_Use NVIDIA NIM models with Docker Agent._ + +## Overview + +NVIDIA provides access to Nemotron and many other open-weight models through +[build.nvidia.com](https://build.nvidia.com/) (with a free tier) via an +OpenAI-compatible API. Docker Agent includes built-in support for NVIDIA as an +alias provider. The same alias also works against a self-hosted +[NVIDIA NIM](https://docs.nvidia.com/nim/) deployment by overriding `base_url`. + +## Setup + +1. Get an API key from [build.nvidia.com](https://build.nvidia.com/) +2. Set the environment variable: + + ```bash + export NVIDIA_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use NVIDIA NIM: + +```yaml +agents: + root: + model: nvidia/nvidia/nemotron-3-super-120b-a12b + description: Assistant using NVIDIA NIM + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + nemotron: + provider: nvidia + model: nvidia/nemotron-3-super-120b-a12b + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: nemotron + description: Assistant using NVIDIA NIM + instruction: You are a helpful assistant. +``` + +## Available Models + +NVIDIA NIM hosts Nemotron alongside many other open models (Llama, Qwen, +DeepSeek, Mistral, ...). Check the [NVIDIA API catalog](https://build.nvidia.com/) +for the current model list. + +| Model | Description | +| -------------------------------------------- | ---------------------------------- | +| `nvidia/nemotron-3-super-120b-a12b` | Nemotron 3 Super, reasoning + tool calling | +| `nvidia/nemotron-3-nano-30b-a3b` | Nemotron 3 Nano, smaller/faster | +| `meta/llama-3.3-70b-instruct` | Llama 3.3 70B instruction-tuned | +| `qwen/qwen3-coder-480b-a35b-instruct` | Qwen3 Coder, code-focused | + +## On-Prem / Self-Hosted NIM + +For self-hosted NIM deployments, point `base_url` at your own endpoint instead +of the hosted `integrate.api.nvidia.com` API: + +```yaml +models: + local_nim: + provider: nvidia + model: meta/llama-3.3-70b-instruct + base_url: http://localhost:8000/v1 +``` + +## How It Works + +NVIDIA is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://integrate.api.nvidia.com/v1` +- **Token Variable:** `NVIDIA_API_KEY` + +Because NIM fronts open-weight models whose chat templates often only accept +a single system message, Docker Agent coalesces the agent instruction and any +toolset instructions into one leading system message before sending the +request. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: nvidia/nvidia/nemotron-3-super-120b-a12b + description: Code assistant using Nemotron + instruction: | + You are an expert programmer using NVIDIA Nemotron. + Write clean, well-documented code. + Follow best practices for the language being used. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/openai/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/openai/index.md new file mode 100644 index 000000000000..abd11c54fbe8 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/openai/index.md @@ -0,0 +1,138 @@ +--- +title: "OpenAI" +description: "Use GPT-5.6, GPT-4o, GPT-5, GPT-5-mini, and other OpenAI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, openai +weight: 200 +canonical: https://docs.docker.com/ai/docker-agent/providers/openai/ +--- + +_Use GPT-5.6, GPT-4o, GPT-5, GPT-5-mini, and other OpenAI models with Docker Agent._ + +## Setup + +```bash +# Set your API key +export OPENAI_API_KEY="sk-..." +``` + +> [!TIP] +> No API key? A ChatGPT Plus/Pro/Business subscription can be used instead +> through the [`chatgpt` provider](../chatgpt/index.md): sign in once with +> `docker agent setup` (pick chatgpt). + +## Configuration + +### Inline + +```yaml +agents: + root: + model: openai/gpt-5.6 +``` + +### Named Model + +```yaml +models: + gpt: + provider: openai + model: gpt-5.6 + max_tokens: 4000 +``` + +## Available Models + +| Model | Best For | +| ---------------- | ----------------------------------------------------- | +| `gpt-5.6` | Alias for `gpt-5.6-sol`; tracks the flagship model | +| `gpt-5.6-sol` | Frontier model, most capable, complex reasoning | +| `gpt-5.6-terra` | Everyday workhorse; successor to the `-mini` tier | +| `gpt-5.6-luna` | High-volume, cost-efficient; successor to `-nano` tier | +| `gpt-5` | Previous-generation flagship | +| `gpt-5-mini` | Previous-generation fast, cost-effective model | +| `gpt-4o` | Multimodal, balanced performance | +| `gpt-4o-mini` | Cheapest, fast for simple tasks | + +Starting with GPT-5.6, OpenAI renamed the `-mini`/`-nano` size tiers to `-terra`/`-luna` (with `-sol` denoting the frontier tier previously left unsuffixed). + +Find more model names at [modelnames.ai](https://modelnames.ai/) or in the [official OpenAI docs](https://platform.openai.com/docs/models). + +## Thinking Budget + +OpenAI reasoning models (o-series, gpt-5, gpt-5-mini, gpt-5.6 family) support extended thinking through the `reasoning_effort` API parameter. Set `thinking_budget` to control the effort level: + +```yaml +models: + gpt-thinker: + provider: openai + model: gpt-5.6 + thinking_budget: high # none | minimal | low | medium | high | xhigh | max +``` + +**Effort levels:** + +| Level | Description | +| --------- | -------------------------------------------------------- | +| `none` | No reasoning. On `gpt-5.6`+ this is a real API value that is sent as-is; on older models it just disables the local `thinking_budget` (the API's own default still applies). | +| `minimal` | Fastest; lightest reasoning pass. Not accepted on `gpt-5.6`+ (dropped from the API). | +| `low` | Quick reasoning for straightforward tasks. | +| `medium` | Balanced default. | +| `high` | More thorough; recommended for complex tasks. | +| `xhigh` | Near-maximum effort; slower but most accurate. Requires `gpt-5.2`+. | +| `max` | Maximum effort. Requires `gpt-5.6`+ (Sol/Terra/Luna). | + +Token counts, `adaptive`, and `adaptive/<effort>` are rejected with a configuration error at request time. Older models (o1, o3-mini) only accept `low`/`medium`/`high`; `xhigh` requires `gpt-5.2`+; `none` and `max` require `gpt-5.6`+; `minimal` is not accepted on `gpt-5.6`+. + +> [!WARNING] +> **Hidden reasoning tokens** +> +> OpenAI reasoning models always produce hidden reasoning tokens that count against `max_tokens` — even with `thinking_budget: none` on older models. Docker Agent automatically raises the output-token floor for its internal low-effort calls so reasoning cannot starve visible text output. + +See the [Thinking / Reasoning guide](../../guides/thinking/index.md) for a cross-provider overview. + +> [!TIP] +> **Custom endpoints** +> +> Use `base_url` for proxies and OpenAI-compatible services. See [Custom Providers](../custom/index.md) for full setup. + +## Custom Endpoint + +Use `base_url` to connect to OpenAI-compatible APIs: + +```yaml +models: + custom: + provider: openai + model: gpt-5-mini + base_url: https://your-proxy.example.com/v1 +``` + +## WebSocket Transport + +For OpenAI Responses API models (gpt-4.1+, o-series, gpt-5), you can use WebSocket streaming instead of the default SSE (Server-Sent Events): + +```yaml +models: + fast-gpt: + provider: openai + model: gpt-4.1 + provider_opts: + transport: websocket # Use WebSocket instead of SSE +``` + +### Benefits + +- **~40% faster** for workflows with 20+ tool calls +- **Persistent connection** reduces per-turn overhead +- **Server-side caching** of connection state +- **Automatic fallback** to SSE if WebSocket fails + +### Requirements + +- Only works with Responses API models: `gpt-4.1+`, `o1`, `o3`, `o4`, `gpt-5` +- NOT compatible with the `--models-gateway` flag (automatically falls back to SSE when a gateway is configured) +- Requires `OPENAI_API_KEY` environment variable + +### Example + +See [`examples/websocket_transport.yaml`](https://github.com/docker/docker-agent/blob/main/examples/websocket_transport.yaml) for a complete example. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/opencode-go/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/opencode-go/index.md new file mode 100644 index 000000000000..69199c31f557 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/opencode-go/index.md @@ -0,0 +1,160 @@ +--- +title: "OpenCode Go" +description: "Use OpenCode Go models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, opencode go +weight: 210 +canonical: https://docs.docker.com/ai/docker-agent/providers/opencode-go/ +--- + +_Use OpenCode Go models with Docker Agent._ + +## Overview + +[OpenCode Go](https://opencode.ai/docs/go) is a low-cost subscription service ($5 first month, then $10/month) that provides reliable access to popular open-source coding models. It serves models through both OpenAI-compatible and Anthropic-compatible APIs from globally distributed endpoints. + +Docker Agent includes built-in support for OpenCode Go as an alias provider. + +## Setup + +1. Subscribe to OpenCode Go at [opencode.ai/auth](https://opencode.ai/auth) +2. Copy your API key from the console +3. Set the environment variable: + + ```bash + export OPENCODE_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use OpenCode Go: + +```yaml +agents: + root: + model: opencode-go/deepseek-v4-flash + description: Assistant using OpenCode Go + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + my_model: + provider: opencode-go + model: deepseek-v4-pro + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: my_model + description: Assistant using OpenCode Go + instruction: You are a helpful assistant. +``` + +## Available Models + +You can retrieve the full, up-to-date model list at any time: + +```bash +curl https://opencode.ai/zen/go/v1/models +``` + +### OpenAI-Compatible + +These models use the `/v1/chat/completions` endpoint and work directly with the `opencode-go` alias: + +| Model | Description | +| ------------------- | ------------------------------------- | +| `deepseek-v4-flash` | Fast and cost-effective DeepSeek model | +| `deepseek-v4-pro` | Most capable DeepSeek model | +| `kimi-k2.7-code` | Kimi K2.7 optimized for code | +| `kimi-k2.6` | Kimi K2.6 model | +| `kimi-k2.5` | Kimi K2.5 model | +| `glm-5.2` | GLM 5.2 flagship model | +| `glm-5.1` | GLM 5.1 model | +| `glm-5` | GLM 5 model | +| `mimo-v2.5` | MiMo V2.5 efficient model | +| `mimo-v2.5-pro` | MiMo V2.5 Pro model | +| `mimo-v2-pro` | MiMo V2 Pro model | +| `mimo-v2-omni` | MiMo V2 Omni model | +| `hy3-preview` | HY3 preview model | + +### Anthropic-Compatible + +These models use the `/v1/messages` endpoint and require a [custom provider definition](../custom/index.md): + +| Model | Description | +| ----------------- | ------------------------ | +| `minimax-m3` | MiniMax M3 model | +| `minimax-m2.7` | MiniMax M2.7 model | +| `minimax-m2.5` | MiniMax M2.5 model | +| `qwen3.7-max` | Qwen 3.7 Max model | +| `qwen3.7-plus` | Qwen 3.7 Plus model | +| `qwen3.6-plus` | Qwen 3.6 Plus model | +| `qwen3.5-plus` | Qwen 3.5 Plus model | + +To use an Anthropic-compatible model, define a custom provider: + +```yaml +providers: + opengo-ant: + provider: anthropic + base_url: https://opencode.ai/zen/go + token_key: OPENCODE_API_KEY + +models: + qwen: + provider: opengo-ant + model: qwen3.7-max + +agents: + root: + model: qwen + description: Assistant using Qwen through OpenCode Go + instruction: You are a helpful assistant. +``` + +## How It Works + +OpenCode Go is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://opencode.ai/zen/go/v1` +- **Token Variable:** `OPENCODE_API_KEY` + +This means OpenCode Go uses the same client as OpenAI, making it fully compatible with all OpenAI features supported by Docker Agent. + +For Anthropic-compatible models (MiniMax, Qwen), Docker Agent uses a custom provider pointing to the Anthropic client at `https://opencode.ai/zen/go` with the same token. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: opencode-go/deepseek-v4-flash + description: Expert code assistant + instruction: | + You are an expert programmer using DeepSeek V4 Flash. + Write clean, efficient, well-documented code. + Explain your reasoning when helpful. + toolsets: + - type: filesystem + - type: shell + - type: think +``` + +## Usage Limits + +OpenCode Go subscriptions include the following limits: + +- **5-hour rolling limit** — $12 of usage +- **Weekly limit** — $30 of usage +- **Monthly limit** — $60 of usage + +Limits are defined as dollar values. More expensive models allow fewer requests per limit period. You can also [add Zen balance](https://opencode.ai/auth) to continue usage beyond the limits. diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/opencode-zen/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/opencode-zen/index.md new file mode 100644 index 000000000000..dc765cfd43f1 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/opencode-zen/index.md @@ -0,0 +1,224 @@ +--- +title: "OpenCode Zen" +description: "Use OpenCode Zen models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, opencode zen +weight: 220 +canonical: https://docs.docker.com/ai/docker-agent/providers/opencode-zen/ +--- + +_Use OpenCode Zen models with Docker Agent._ + +## Overview + +[OpenCode Zen](https://opencode.ai/docs/zen) is a curated gateway of tested and verified AI models provided by the OpenCode team. It offers pay-per-use access to a wide range of models — from GPT and Claude to open-source models — all through a single API key. Several free models are also available. + +Docker Agent includes built-in support for OpenCode Zen as an alias provider for OpenAI-compatible models. Anthropic and Google models are supported via custom provider definitions. + +## Setup + +1. Sign in to [OpenCode Zen](https://opencode.ai/auth), add billing information, and copy your API key +2. Set the environment variable: + + ```bash + export OPENCODE_API_KEY=your-api-key + ``` + +3. Verify available models: + + ```bash + curl https://opencode.ai/zen/v1/models + ``` + +## Usage + +### Inline Syntax + +The simplest way to use OpenCode Zen with a free model: + +```yaml +agents: + root: + model: opencode-zen/deepseek-v4-flash-free + description: Assistant using OpenCode Zen (free) + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + zen_model: + provider: opencode-zen + model: gpt-5.5 + temperature: 0.7 + max_tokens: 16384 + +agents: + root: + model: zen_model + description: Assistant using OpenCode Zen + instruction: You are a helpful assistant. +``` + +## Available Models + +### Free Models + +These models are available at no cost: + +| Model | Description | +| ------------------------- | ---------------------------------- | +| `deepseek-v4-flash-free` | Free DeepSeek V4 Flash | +| `mimo-v2.5-free` | Free MiMo V2.5 model | +| `qwen3.6-plus-free` | Free Qwen 3.6 Plus model | +| `minimax-m3-free` | Free MiniMax M3 model | +| `nemotron-3-ultra-free` | Free Nemotron 3 Ultra model | +| `north-mini-code-free` | Free North Mini Code model | +| `big-pickle` | Free stealth model | + +### OpenAI-Compatible (Chat Completions) + +These models use the `/v1/chat/completions` endpoint and work directly with the `opencode-zen` alias: + +| Model | Description | +| --------------------- | ---------------------------------- | +| `deepseek-v4-pro` | DeepSeek V4 Pro model | +| `deepseek-v4-flash` | Fast DeepSeek V4 model | +| `glm-5.2` | GLM 5.2 model | +| `glm-5.1` | GLM 5.1 model | +| `glm-5` | GLM 5 model | +| `kimi-k2.6` | Kimi K2.6 model | +| `kimi-k2.5` | Kimi K2.5 model | +| `minimax-m2.7` | MiniMax M2.7 model | +| `minimax-m2.5` | MiniMax M2.5 model | +| `grok-build-0.1` | Grok Build 0.1 model | + +### OpenAI-Compatible (Responses API) + +These models use the `/v1/responses` endpoint and are auto-detected by Docker Agent based on the model name: + +| Model | Description | +| ---------------------- | --------------------------------- | +| `gpt-5.5` | Latest GPT model | +| `gpt-5.5-pro` | GPT 5.5 Pro, highest capability | +| `gpt-5.4` | GPT 5.4 model | +| `gpt-5.4-pro` | GPT 5.4 Pro model | +| `gpt-5.4-mini` | GPT 5.4 Mini model | +| `gpt-5.4-nano` | GPT 5.4 Nano, fastest | +| `gpt-5.3-codex` | GPT 5.3 Codex for coding | +| `gpt-5.3-codex-spark` | GPT 5.3 Codex Spark | +| `gpt-5.2` | GPT 5.2 model | +| `gpt-5.2-codex` | GPT 5.2 Codex | +| `gpt-5.1` | GPT 5.1 model | +| `gpt-5.1-codex` | GPT 5.1 Codex | +| `gpt-5.1-codex-max` | GPT 5.1 Codex Max | +| `gpt-5.1-codex-mini` | GPT 5.1 Codex Mini | +| `gpt-5` | GPT 5 model | +| `gpt-5-codex` | GPT 5 Codex | +| `gpt-5-nano` | GPT 5 Nano | + +### Anthropic-Compatible (Messages API) + +These models use the `/v1/messages` endpoint and require a [custom provider definition](../custom/index.md): + +| Model | Description | +| ----------------------- | ----------------------------- | +| `claude-fable-5` | Claude Fable 5 model | +| `claude-opus-4-8` | Claude Opus 4.8 model | +| `claude-opus-4-7` | Claude Opus 4.7 model | +| `claude-opus-4-6` | Claude Opus 4.6 model | +| `claude-opus-4-5` | Claude Opus 4.5 model | +| `claude-opus-4-1` | Claude Opus 4.1 model | +| `claude-sonnet-4-6` | Claude Sonnet 4.6 model | +| `claude-sonnet-4-5` | Claude Sonnet 4.5 model | +| `claude-sonnet-4` | Claude Sonnet 4 model | +| `claude-haiku-4-5` | Claude Haiku 4.5 model | +| `qwen3.7-max` | Qwen 3.7 Max model | +| `qwen3.7-plus` | Qwen 3.7 Plus model | +| `qwen3.6-plus` | Qwen 3.6 Plus model | +| `qwen3.5-plus` | Qwen 3.5 Plus model | + +To use an Anthropic-compatible model: + +```yaml +providers: + opencode-zen-claude: + provider: anthropic + base_url: https://opencode.ai/zen + token_key: OPENCODE_API_KEY + +models: + claude: + provider: opencode-zen-claude + model: claude-sonnet-4-5 + +agents: + root: + model: claude + description: Assistant using Claude through OpenCode Zen + instruction: You are a helpful assistant. +``` + +### Google-Compatible + +These models require a [custom provider definition](../custom/index.md) with a Google-compatible client: + +| Model | Description | +| ------------------- | ------------------------ | +| `gemini-3.5-flash` | Gemini 3.5 Flash model | +| `gemini-3.1-pro` | Gemini 3.1 Pro model | +| `gemini-3-flash` | Gemini 3 Flash model | + +To use a Google model: + +```yaml +providers: + opencode-zen-gemini: + provider: google + base_url: https://opencode.ai/zen + token_key: OPENCODE_API_KEY + +models: + gemini: + provider: opencode-zen-gemini + model: gemini-3.5-flash + +agents: + root: + model: gemini + description: Assistant using Gemini through OpenCode Zen + instruction: You are a helpful assistant. +``` + +## How It Works + +OpenCode Zen is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (auto-detects Responses API for GPT models, Chat Completions for others) +- **Base URL:** `https://opencode.ai/zen/v1` +- **Token Variable:** `OPENCODE_API_KEY` + +The same API key works for both OpenCode Go and OpenCode Zen — they are part of the same platform. Zen uses a pay-per-use billing model, while Go uses a fixed subscription. + +For Anthropic-compatible models, Docker Agent uses a custom provider pointing to the Anthropic client at `https://opencode.ai/zen` with the same token. For Google models, a custom provider points to the Google client at `https://opencode.ai/zen` (the Google SDK appends its own `/v1beta/models/...` path segment). + +### Differences from OpenCode Go + +| Aspect | OpenCode Zen | OpenCode Go | +|--------|-------------|-------------| +| Billing | Pay-per-use | $10/month subscription | +| Models | GPT-5.x, Claude, Gemini, open-source | Open-source only | +| Free models | Yes (7 models) | No | +| Base URL | `https://opencode.ai/zen/v1` | `https://opencode.ai/zen/go/v1` | + +## Usage Limits and Pricing + +OpenCode Zen uses a pay-per-use model. See the [OpenCode Zen documentation](https://opencode.ai/docs/zen) for current pricing. Automatic top-up and monthly usage limits are available from the console. + +You can retrieve the full model catalog at any time: + +```bash +curl https://opencode.ai/zen/v1/models +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/openrouter/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/openrouter/index.md new file mode 100644 index 000000000000..b01d40211ef8 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/openrouter/index.md @@ -0,0 +1,88 @@ +--- +title: "OpenRouter" +description: "Use OpenRouter models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, openrouter +weight: 230 +canonical: https://docs.docker.com/ai/docker-agent/providers/openrouter/ +--- + +_Use OpenRouter models with Docker Agent._ + +## Overview + +OpenRouter provides access to models from many providers through an OpenAI-compatible API. Docker Agent includes built-in support for OpenRouter as an alias provider. + +## Setup + +1. Get an API key from [OpenRouter](https://openrouter.ai/settings/keys) +2. Set the environment variable: + + ```bash + export OPENROUTER_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use OpenRouter: + +```yaml +agents: + root: + model: openrouter/meta-llama/llama-3.3-70b-instruct + description: Assistant using OpenRouter + instruction: You are a helpful assistant. +``` + +OpenRouter model IDs usually include the upstream provider name, such as `anthropic/claude-sonnet-4-5` or `meta-llama/llama-3.3-70b-instruct`. Docker Agent splits only the first slash, so the full upstream model ID is preserved. + +### Named Model + +For more control over parameters: + +```yaml +models: + openrouter_llama: + provider: openrouter + model: meta-llama/llama-3.3-70b-instruct + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: openrouter_llama + description: Assistant using OpenRouter + instruction: You are a helpful assistant. +``` + +## Pricing and Model Metadata + +Docker Agent fetches OpenRouter model metadata from [models.dev](https://models.dev/), including pricing per 1M input/output tokens, cache pricing when available, context limits, output limits, and modalities. This powers cost tracking and the model picker in the same way as other first-class providers. + +If models.dev is unavailable, Docker Agent falls back to its embedded catalog snapshot. + +## How It Works + +OpenRouter is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai`) +- **Base URL:** `https://openrouter.ai/api/v1` +- **Token Variable:** `OPENROUTER_API_KEY` + +## Example: Code Assistant + +```yaml +agents: + coder: + model: openrouter/meta-llama/llama-3.3-70b-instruct + description: Code assistant using OpenRouter + instruction: | + You are an expert programmer. + Write clean, maintainable code. + Explain trade-offs when helpful. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/overview/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/overview/index.md new file mode 100644 index 000000000000..662ca2a43043 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/overview/index.md @@ -0,0 +1,104 @@ +--- +title: "Model Providers" +description: "Docker Agent supports multiple AI model providers. Choose the right one for your use case, or use multiple providers in the same configuration." +keywords: docker agent, ai agents, model providers, llm +linkTitle: "Overview" +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/providers/overview/ +aliases: + - /ai/docker-agent/model-providers/ +--- + +_Docker Agent supports multiple AI model providers. Choose the right one for your use case, or use multiple providers in the same configuration._ + +## Supported Providers + +- [**OpenAI**](../openai/index.md) — GPT-5, GPT-5-mini, GPT-4o. The most widely used AI models. +- [**Anthropic**](../anthropic/index.md) — Claude Sonnet 4.5, Claude Opus 4.7. Excellent for coding and analysis. +- [**Google Gemini**](../google/index.md) — Gemini 2.5 Flash, Gemini 3 Pro. Fast and cost-effective. +- [**AWS Bedrock**](../bedrock/index.md) — access Claude, Nova, Llama, and more through AWS infrastructure. +- [**Docker Model Runner**](../dmr/index.md) — run models locally with Docker. No API keys, no costs. +- [**Local Models**](../local/index.md) — run Ollama, vLLM, or LocalAI locally. No API key required. +- [**Provider Definitions**](../custom/index.md) — define reusable provider configurations with shared defaults for any provider type. + +## Quick Comparison + +| Provider | Key | Local? | Strengths | +| ------------------- | ---------------- | ------ | ----------------------------------------------------- | +| OpenAI | `openai` | No | Broad model selection, tool calling, multimodal | +| Anthropic | `anthropic` | No | Strong coding, extended thinking, large context | +| Google | `google` | No | Fast inference, competitive pricing, multimodal | +| AWS Bedrock | `amazon-bedrock` | No | Enterprise features, multiple models, AWS integration | +| Docker Model Runner | `dmr` | Yes | No API costs, data privacy, offline capable | +| Local Models (Ollama / vLLM) | `ollama` / custom | Yes | No API costs, full data privacy, any OpenAI-compatible server | + +## Additional Built-in Providers + +Docker Agent also includes built-in aliases for these providers: + +| Provider | Alias | API Key / Env Variable | +| -------------- | ---------------- | ----------------------------------- | +| ChatGPT (OpenAI account) | [`chatgpt`](../chatgpt/index.md) | None (sign in via `docker agent setup`) | +| OpenCode Zen | `opencode-zen` | `OPENCODE_API_KEY` | +| OpenCode Go | `opencode-go` | `OPENCODE_API_KEY` | +| Mistral | `mistral` | `MISTRAL_API_KEY` | +| xAI (Grok) | `xai` | `XAI_API_KEY` | +| Nebius | `nebius` | `NEBIUS_API_KEY` | +| NVIDIA NIM | `nvidia` | `NVIDIA_API_KEY` | +| MiniMax | `minimax` | `MINIMAX_API_KEY` | +| Baseten | `baseten` | `BASETEN_API_KEY` | +| OVHcloud | `ovhcloud` | `OVH_AI_ENDPOINTS_ACCESS_TOKEN` | +| Groq | `groq` | `GROQ_API_KEY` | +| Fireworks AI | `fireworks` | `FIREWORKS_API_KEY` | +| DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` | +| Cerebras | `cerebras` | `CEREBRAS_API_KEY` | +| Together AI | `together` | `TOGETHER_API_KEY` | +| Hugging Face | `huggingface` | `HF_TOKEN` | +| Cloudflare Workers AI | `cloudflare-workers-ai` | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` | +| Moonshot AI | `moonshot` | `MOONSHOT_API_KEY` | +| Vercel AI Gateway | `vercel` | `AI_GATEWAY_API_KEY` | +| Cloudflare AI Gateway | `cloudflare-ai-gateway` | `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_GATEWAY_ID` | +| Requesty | `requesty` | `REQUESTY_API_KEY` | +| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` | +| Azure OpenAI | `azure` | `AZURE_API_KEY` + `base_url` | +| [Ollama](../local/index.md) | `ollama` | None (local; optional `base_url`) | +| GitHub Copilot | `github-copilot` | `GITHUB_TOKEN` (PAT with `copilot` scope) | + +```bash +# Use built-in providers inline +agents: + root: + model: mistral/mistral-large-latest +``` + +> [!TIP] +> **Multi-provider teams** +> +> Use expensive models for complex reasoning and cheaper/local models for routine tasks. See the example below. + +## Using Multiple Providers + +Different agents can use different providers in the same configuration: + +```yaml +models: + claude: + provider: anthropic + model: claude-sonnet-4-5 + max_tokens: 64000 + gpt: + provider: openai + model: gpt-5 + local: + provider: dmr + model: ai/qwen3 + +agents: + root: + model: claude # coordinator uses Claude + sub_agents: [coder, helper] + coder: + model: gpt # coder uses GPT-5 + helper: + model: local # helper runs locally for free +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/ovhcloud/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/ovhcloud/index.md new file mode 100644 index 000000000000..53298c8d57ac --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/ovhcloud/index.md @@ -0,0 +1,108 @@ +--- +title: "OVHcloud" +description: "Use OVHcloud AI Endpoints models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, ovhcloud +weight: 240 +canonical: https://docs.docker.com/ai/docker-agent/providers/ovhcloud/ +--- + +_Use OVHcloud AI Endpoints models with Docker Agent._ + +## Overview + +[OVHcloud AI Endpoints](https://endpoints.ai.cloud.ovh.net/) serves open-weight +models through an OpenAI-compatible API, hosted in the EU. Docker Agent includes +built-in support for OVHcloud as an alias provider. + +## Setup + +1. Create an access token from the + [OVHcloud AI Endpoints portal](https://endpoints.ai.cloud.ovh.net/). +2. Set the environment variable: + + ```bash + export OVH_AI_ENDPOINTS_ACCESS_TOKEN=your-access-token + ``` + +## Usage + +### Inline Syntax + +```yaml +agents: + root: + model: ovhcloud/Qwen3.5-397B-A17B + description: Assistant using OVHcloud + instruction: You are a helpful assistant. +``` + +### Named Model + +```yaml +models: + ovhcloud_model: + provider: ovhcloud + model: Qwen3.5-397B-A17B + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: ovhcloud_model + description: Assistant using OVHcloud + instruction: You are a helpful assistant. +``` + +## Available Models + +OVHcloud hosts a rotating catalogue of open-weight models. Check the +[AI Endpoints catalogue](https://endpoints.ai.cloud.ovh.net/) for current model +IDs, context limits, and free-tier availability. + +| Model | Description | +| --- | --- | +| `Qwen3.5-397B-A17B` | Large Qwen3.5 MoE — strong general, coding, and reasoning | +| `Qwen3-32B` | Mid-size Qwen3 — fast, tool-calling, reasoning | +| `Qwen3.6-27B` | Compact Qwen3.6 — fast and efficient | +| `Qwen3.5-9B` | Small Qwen3.5 — lightweight, free-tier friendly | +| `Qwen3-Coder-30B-A3B-Instruct` | Qwen3 Coder MoE — optimised for code generation | +| `Meta-Llama-3_3-70B-Instruct` | Llama 3.3 70B — reliable general-purpose chat | +| `Mistral-Small-3.2-24B-Instruct-2506` | Compact, fast, tool-calling | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +OVHcloud is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://oai.endpoints.kepler.ai.cloud.ovh.net/v1` +- **Token Variable:** `OVH_AI_ENDPOINTS_ACCESS_TOKEN` + +Docker Agent automatically coalesces consecutive system messages into one for +OVHcloud, because some OVHcloud models return an empty stream when a request +carries more than one system message. + +## Free tier + +OVHcloud offers rate-limited free access to several models. Under heavy +rate-limiting the endpoint may return an empty response; Docker Agent surfaces +this as a warning rather than failing. For sustained use, an access token with a +paid plan avoids the free-tier request-rate cap. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: ovhcloud/Qwen3.5-397B-A17B + description: Code assistant using Qwen3.5 + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/together/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/together/index.md new file mode 100644 index 000000000000..8dda71006171 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/together/index.md @@ -0,0 +1,101 @@ +--- +title: "Together AI" +description: "Use Together AI models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, together ai +weight: 250 +canonical: https://docs.docker.com/ai/docker-agent/providers/together/ +--- + +_Use Together AI models with Docker Agent._ + +## Overview + +[Together AI](https://www.together.ai/) is one of the largest hosts of open +models, serving Llama, Qwen, DeepSeek, Kimi, GLM and others through an +OpenAI-compatible API. Docker Agent includes built-in support for Together AI as +an alias provider. + +## Setup + +1. Create an API key from the [Together AI settings](https://api.together.ai/settings/api-keys). +2. Set the environment variable: + + ```bash + export TOGETHER_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use Together AI: + +```yaml +agents: + root: + model: together/meta-llama/Llama-3.3-70B-Instruct-Turbo + description: Assistant using Together AI + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + together_model: + provider: together + model: meta-llama/Llama-3.3-70B-Instruct-Turbo + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: together_model + description: Assistant using Together AI + instruction: You are a helpful assistant. +``` + +## Available Models + +Together AI serves a broad, changing catalog of open-weight models. Check the +[Together AI model library](https://docs.together.ai/docs/serverless-models) for +current model IDs, context limits, and pricing. + +| Model | Description | +| --- | --- | +| `meta-llama/Llama-3.3-70B-Instruct-Turbo` | Llama 3.3 70B, general-purpose chat and tool calling | +| `Qwen/Qwen3-235B-A22B-Instruct-2507-tput` | Qwen3 235B mixture-of-experts instruct model | +| `deepseek-ai/DeepSeek-V3` | DeepSeek-V3, strong coding and reasoning | + +> Model IDs are case-sensitive and must be passed exactly as the catalogue lists +> them. + +## How It Works + +Together AI is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.together.xyz/v1` +- **Token Variable:** `TOGETHER_API_KEY` + +Because Together AI fronts open-weight models whose chat templates may reject +more than one leading system message, Docker Agent coalesces its per-source +system messages into a single one for this provider. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: together/Qwen/Qwen3-235B-A22B-Instruct-2507-tput + description: Code assistant using Qwen3 on Together AI + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/vercel/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/vercel/index.md new file mode 100644 index 000000000000..f2278690bb23 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/vercel/index.md @@ -0,0 +1,109 @@ +--- +title: "Vercel AI Gateway" +description: "Use Vercel AI Gateway models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, vercel ai gateway +weight: 260 +canonical: https://docs.docker.com/ai/docker-agent/providers/vercel/ +--- + +_Use Vercel AI Gateway models with Docker Agent._ + +## Overview + +[Vercel AI Gateway](https://vercel.com/docs/ai-gateway) is a single, unified +OpenAI-compatible endpoint that routes to models from OpenAI, Anthropic, Google, +xAI and more at list price with no markup, plus provider routing and failover. +It lets you reach many providers with one API key. Docker Agent includes +built-in support for Vercel AI Gateway as an alias provider. + +## Setup + +1. Create an API key from the [Vercel AI Gateway dashboard](https://vercel.com/docs/ai-gateway). +2. Set the environment variable: + + ```bash + export AI_GATEWAY_API_KEY=your-api-key + ``` + +## Usage + +Vercel AI Gateway model IDs use a `creator/model` form (for example +`openai/gpt-5.6-sol` or `anthropic/claude-sonnet-4.5`); the gateway routes each +request to the underlying provider. The gateway lists explicit variant slugs +only (`openai/gpt-5.6-sol`, `-terra`, `-luna`) — there is no unsuffixed +`openai/gpt-5.6` alias on the gateway. + +### Inline Syntax + +The simplest way to use Vercel AI Gateway: + +```yaml +agents: + root: + model: vercel/openai/gpt-5.6-sol + description: Assistant using Vercel AI Gateway + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + vercel_model: + provider: vercel + model: openai/gpt-5.6-sol + max_tokens: 8192 + +agents: + root: + model: vercel_model + description: Assistant using Vercel AI Gateway + instruction: You are a helpful assistant. +``` + +## Available Models + +Vercel AI Gateway exposes models from many providers behind one endpoint. Check +the [Vercel AI Gateway documentation](https://vercel.com/docs/ai-gateway) for +the current model list, IDs, and pricing. + +| Model | Description | +| --- | --- | +| `openai/gpt-5.6-sol` | OpenAI GPT-5.6 Sol (frontier) routed through the gateway | +| `openai/gpt-5.6-terra` | OpenAI GPT-5.6 Terra (workhorse) routed through the gateway | +| `openai/gpt-5.6-luna` | OpenAI GPT-5.6 Luna (high-volume) routed through the gateway | +| `anthropic/claude-sonnet-4.5` | Anthropic Claude Sonnet routed through the gateway | +| `google/gemini-2.5-flash` | Google Gemini routed through the gateway | + +> Model IDs are case-sensitive and must be passed exactly as the gateway lists +> them, including the `creator/` prefix. + +## How It Works + +Vercel AI Gateway is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://ai-gateway.vercel.sh/v1` +- **Token Variable:** `AI_GATEWAY_API_KEY` + +Because the gateway can route to open-weight models with strict chat templates, +Docker Agent coalesces consecutive system messages into a single leading one for +this provider. + +## Example: Code Assistant + +```yaml +agents: + coder: + model: vercel/anthropic/claude-sonnet-4.5 + description: Code assistant via Vercel AI Gateway + instruction: | + You are an expert programmer. + Write clean, well-documented code and follow language best practices. + toolsets: + - type: filesystem + - type: shell + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/providers/xai/index.md b/_vendor/github.com/docker/docker-agent/docs/providers/xai/index.md new file mode 100644 index 000000000000..638e5018826b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/providers/xai/index.md @@ -0,0 +1,99 @@ +--- +title: "xAI (Grok)" +description: "Use xAI's Grok models with Docker Agent." +keywords: docker agent, ai agents, model providers, llm, xai (grok) +weight: 270 +canonical: https://docs.docker.com/ai/docker-agent/providers/xai/ +--- + +_Use xAI's Grok models with Docker Agent._ + +## Overview + +xAI provides the Grok family of models through an OpenAI-compatible API. Docker Agent includes built-in support for xAI as an alias provider. + +## Setup + +1. Get an API key from [xAI Console](https://console.x.ai/) +2. Set the environment variable: + + ```bash + export XAI_API_KEY=your-api-key + ``` + +## Usage + +### Inline Syntax + +The simplest way to use xAI: + +```yaml +agents: + root: + model: xai/grok-3 + description: Assistant using Grok + instruction: You are a helpful assistant. +``` + +### Named Model + +For more control over parameters: + +```yaml +models: + grok: + provider: xai + model: grok-3 + temperature: 0.7 + max_tokens: 8192 + +agents: + root: + model: grok + description: Assistant using Grok + instruction: You are a helpful assistant. +``` + +## Available Models + +| Model | Description | Context | +| ------------------ | ---------------------------------- | ------- | +| `grok-3` | Latest and most capable Grok model | 131K | +| `grok-3-fast` | Faster variant with lower latency | 131K | +| `grok-3-mini` | Compact model for simpler tasks | 131K | +| `grok-3-mini-fast` | Fast variant of the mini model | 131K | +| `grok-2` | Previous generation model | 128K | +| `grok-vision` | Vision-capable model | 32K | + +Check the [xAI documentation](https://docs.x.ai/docs) for the latest available models. + +## Extended Thinking + +Docker Agent's `thinking_budget` field is **not applied** to xAI models: the underlying OpenAI-compatible client only sends `reasoning_effort` for OpenAI reasoning model names (o-series, gpt-5). Setting `thinking_budget` on a Grok model passes config validation but has no effect on the request. + +Grok reasoning models (e.g. `grok-3-mini`) reason on their own without configuration. For non-reasoning models, use the [think tool](../../tools/think/index.md) instead. + +## How It Works + +xAI is implemented as a built-in alias in Docker Agent: + +- **API Type:** OpenAI-compatible (`openai_chatcompletions`) +- **Base URL:** `https://api.x.ai/v1` +- **Token Variable:** `XAI_API_KEY` + +## Example: Research Assistant + +```yaml +agents: + researcher: + model: xai/grok-3 + description: Research assistant with real-time knowledge + instruction: | + You are a research assistant using Grok. + Provide well-researched, factual responses. + Cite sources when available. + toolsets: + - type: mcp + ref: docker:duckduckgo + - type: think +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/_index.md b/_vendor/github.com/docker/docker-agent/docs/tools/_index.md new file mode 100644 index 000000000000..ca9847f9a25d --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/_index.md @@ -0,0 +1,5 @@ +--- +title: "Built-in Tools" +description: "Built-in toolsets agents can use out of the box." +weight: 40 +--- diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/a2a/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/a2a/index.md new file mode 100644 index 000000000000..f07a9fe62435 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/a2a/index.md @@ -0,0 +1,43 @@ +--- +title: "A2A Tool" +description: "Connect to remote agents via the Agent-to-Agent protocol." +keywords: docker agent, ai agents, tools, toolsets, a2a tool +linkTitle: "A2A" +weight: 60 +canonical: https://docs.docker.com/ai/docker-agent/tools/a2a/ +--- + +_Connect to remote agents via the Agent-to-Agent protocol._ + +## Overview + +The A2A tool connects to a remote agent exposed over the A2A (Agent-to-Agent) protocol. Unlike [`handoff`](../handoff/index.md), which only targets local agents declared in the same config, `a2a` reaches out to an agent running on the network. + +## Configuration + +```yaml +toolsets: + - type: a2a + url: "http://localhost:8080/a2a" + # Optional: custom tool name (defaults to a sanitized form of the URL / agent card name) + name: research_agent + # Optional: custom HTTP headers (typically for auth) + headers: + Authorization: "Bearer ${env.A2A_TOKEN}" + X-Tenant: "acme" +``` + +The `Authorization` header shown above authenticates to endpoints served with `docker agent serve a2a --auth-token`. + +## Properties + +| Property | Type | Required | Description | +| ---------- | ---------------- | -------- | -------------------------------------------------------------------------------------------------------- | +| `url` | string | ✓ | A2A server endpoint URL (must include scheme). | +| `name` | string | ✗ | Tool name registered for the remote agent. Defaults to a name derived from the server's agent card. | +| `headers` | map\[string\]string | ✗ | Extra HTTP headers sent with every request (useful for `Authorization`, tenant selection, tracing, \u2026). | + +> [!TIP] +> **See also** +> +> For full details on the A2A protocol and serving agents as A2A endpoints, see [A2A Protocol](../../features/a2a/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/api/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/api/index.md new file mode 100644 index 000000000000..73e802bd5b89 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/api/index.md @@ -0,0 +1,252 @@ +--- +title: "API Tool" +description: "Create custom tools that call HTTP APIs." +keywords: docker agent, ai agents, tools, toolsets, api tool +linkTitle: "API" +weight: 240 +canonical: https://docs.docker.com/ai/docker-agent/tools/api/ +--- + +_Create custom tools that call HTTP APIs._ + +## Overview + +The API tool type lets you define custom tools that make HTTP requests to external APIs. This is useful for integrating agents with REST APIs, webhooks, or any HTTP-based service without writing code. + +> [!NOTE] +> **When to Use** +> +> - Integrating with REST APIs that don't have an MCP server +> - Simple HTTP operations (GET, POST) +> - Quick prototyping before building a full MCP server + +## Configuration + +```yaml +agents: + assistant: + model: openai/gpt-4o + description: Assistant with API access + instruction: You can look up weather information. + toolsets: + - type: api + api_config: + name: get_weather + method: GET + endpoint: "https://api.weather.example/v1/current?city=${city}" + instruction: Get current weather for a city + args: + city: + type: string + description: City name to get weather for + required: ["city"] + headers: + Authorization: "Bearer ${env.WEATHER_API_KEY}" +``` + +## Properties + +The `api` toolset accepts the following toolset-level fields in addition to the `api_config` block: + +| Property | Type | Required | Description | +| ------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `api_config` | object | ✓ | The HTTP tool definition. See the table below. | +| `timeout` | int | ✗ | HTTP client timeout in seconds (default: `30`). Applies to every call the generated tool makes. | +| `allow_private_ips` | boolean | ✗ | Opt in to dialling **non-public** IP addresses (loopback, RFC1918, link-local — including the cloud-metadata endpoint at `169.254.169.254` — multicast and the unspecified address). Set to `true` only when the configured endpoint legitimately targets internal services. See [Reaching internal services](#reaching-internal-services). | + +### `api_config` + +| Property | Type | Required | Description | +| --------------- | ------ | -------- | ------------------------------------------------ | +| `name` | string | ✓ | Tool name (how the agent references it) | +| `method` | string | ✓ | HTTP method: `GET` or `POST` | +| `endpoint` | string | ✓ | URL endpoint (supports `${param}` interpolation) | +| `instruction` | string | ✗ | Description shown to the agent | +| `args` | object | ✗ | Parameter definitions (JSON Schema properties) | +| `required` | array | ✗ | List of required parameter names | +| `headers` | object | ✗ | HTTP headers to include. Values support `${env.VAR}` and `${headers.NAME}` placeholders (the latter forwards a header from the caller's incoming request, useful when docker agent is itself exposed as an HTTP server). | +| `output_schema` | object | ✗ | JSON Schema for the response. Used by MCP / Code Mode consumers; tool responses are still returned to the model as raw strings. | + +## HTTP Methods + +### GET Requests + +For GET requests, parameters are interpolated into the URL: + +```yaml +toolsets: + - type: api + api_config: + name: search_users + method: GET + endpoint: "https://api.example.com/users?q=${query}&limit=${limit}" + instruction: Search for users by name + args: + query: + type: string + description: Search query + limit: + type: integer + description: Maximum results (default 10) + required: ["query"] +``` + +### POST Requests + +For POST requests, parameters are sent as JSON in the request body: + +```yaml +toolsets: + - type: api + api_config: + name: create_task + method: POST + endpoint: "https://api.example.com/tasks" + instruction: Create a new task + args: + title: + type: string + description: Task title + description: + type: string + description: Task description + priority: + type: string + enum: ["low", "medium", "high"] + description: Task priority + required: ["title"] + headers: + Content-Type: "application/json" + Authorization: "Bearer ${env.API_TOKEN}" +``` + +## URL Interpolation + +Use `${param}` syntax to insert parameter values into URLs: + +```yaml +endpoint: "https://api.example.com/users/${user_id}/posts/${post_id}" +``` + +Parameter values are inserted as strings by the template expansion. Add URL encoding in the template when needed (for example, `${encodeURIComponent(city)}`). + +## Headers + +Headers can include environment variables: + +```yaml +headers: + Authorization: "Bearer ${env.API_KEY}" + X-Custom-Header: "static-value" + Content-Type: "application/json" +``` + +## Output Schema + +Optionally document the expected response format: + +```yaml +toolsets: + - type: api + api_config: + name: get_user + method: GET + endpoint: "https://api.example.com/users/${id}" + instruction: Get user details by ID + args: + id: + type: string + description: User ID + required: ["id"] + output_schema: + type: object + properties: + id: + type: string + name: + type: string + email: + type: string + created_at: + type: string +``` + +## Example: GitHub API + +```yaml +agents: + github_assistant: + model: openai/gpt-4o + description: Assistant that can query GitHub + instruction: You can look up GitHub repositories and users. + toolsets: + - type: api + api_config: + name: get_repo + method: GET + endpoint: "https://api.github.com/repos/${owner}/${repo}" + instruction: Get information about a GitHub repository + args: + owner: + type: string + description: Repository owner (user or org) + repo: + type: string + description: Repository name + required: ["owner", "repo"] + headers: + Accept: "application/vnd.github.v3+json" + Authorization: "Bearer ${env.GITHUB_TOKEN}" + + - type: api + api_config: + name: get_user + method: GET + endpoint: "https://api.github.com/users/${username}" + instruction: Get information about a GitHub user + args: + username: + type: string + description: GitHub username + required: ["username"] + headers: + Accept: "application/vnd.github.v3+json" +``` + +## Limitations + +- Only supports GET and POST methods +- Response body is limited to 1MB +- Default 30-second timeout per request (override with the `timeout` field) +- Only HTTP and HTTPS URLs are supported +- No support for file uploads or multipart forms +- By default, requests to non-public IP ranges (loopback, RFC1918, link-local, the cloud-metadata endpoint, multicast, the unspecified address) are refused at dial time — even when DNS for an otherwise-public host resolves there. Set `allow_private_ips: true` to disable that check. + +## Reaching internal services + +```yaml +toolsets: + - type: api + timeout: 60 + allow_private_ips: true + api_config: + name: get_local_status + method: GET + endpoint: "http://localhost:8080/health" + instruction: Check the local service health +``` + +> [!WARNING] +> **SSRF** +> +> Setting `allow_private_ips: true` re-exposes the SSRF surface for this tool. Only enable it when the configured `endpoint` is a trusted internal service — a prompt-injected agent cannot redirect the call elsewhere because the endpoint is fixed in config, but redirects from the configured host can still reach unexpected places. + +> [!TIP] +> **For Complex APIs** +> +> For APIs that need authentication flows, pagination, or complex request/response handling, consider using an MCP server instead. The API tool is best for simple, stateless HTTP operations. + +> [!WARNING] +> **Security** +> +> API keys and tokens in headers are visible in debug logs. Use environment variables (`${env.VAR}`) rather than hardcoding secrets in configuration files. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/background-agents/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/background-agents/index.md new file mode 100644 index 000000000000..0c6afbfaaed9 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/background-agents/index.md @@ -0,0 +1,120 @@ +--- +title: "Background Agents Tool" +description: "Dispatch work to sub-agents concurrently and collect results asynchronously." +keywords: docker agent, ai agents, tools, toolsets, background agents tool +linkTitle: "Background Agents" +weight: 90 +canonical: https://docs.docker.com/ai/docker-agent/tools/background-agents/ +--- + +_Dispatch work to sub-agents concurrently and collect results asynchronously._ + +## Overview + +The background agents tool lets an orchestrator dispatch work to sub-agents concurrently and collect results asynchronously. Unlike [transfer_task](../transfer-task/index.md) (which blocks until the sub-agent finishes), background agent tasks run in parallel — the orchestrator can start several tasks, do other work, and check on them later. + +## Available Tools + +| Tool | Description | +| ------------------------ | --------------------------------------------------------------- | +| `run_background_agent` | Start a sub-agent task in the background; returns a task ID | +| `list_background_agents` | List all background tasks with their status and runtime | +| `view_background_agent` | View live output or final result of a task by ID | +| `stop_background_agent` | Cancel a running task by ID | + +### `run_background_agent` parameters + +| Parameter | Type | Required | Description | +| ----------------- | ------ | -------- | --------------------------------------------------------------------------- | +| `agent` | string | ✓ | Name of the sub-agent to run. Must be listed under the caller's `sub_agents`. | +| `task` | string | ✓ | Clear, concise description of the task the sub-agent should achieve. | +| `expected_output` | string | ✗ | Optional description of the result format the caller expects. | + +`run_background_agent` returns a **task ID** string. Tools run by the sub-agent inherit the parent session's permissions. Because background tasks run non-interactively, any tool call that would normally prompt the user for approval will be automatically denied. To allow background agents to run mutating tools, you must explicitly approve them in the parent session (e.g. via YOLO mode or explicit allow rules). + +Background delegation shares the same runtime guards as `transfer_task`: delegation cycles are rejected and chains are capped at 10 nested delegations. See [Delegation Limits](../transfer-task/index.md#delegation-limits). + +### `view_background_agent` and `stop_background_agent` parameters + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------------------------------------------------- | +| `task_id` | string | ✓ | Task ID returned by `run_background_agent` or `list_background_agents`. | + +`list_background_agents` takes no parameters. + +## Configuration + +```yaml +toolsets: + - type: background_agents +``` + +No configuration options. Requires the agent to have `sub_agents` configured so the background tasks have agents to dispatch to. + +## Example + +```yaml +agents: + coordinator: + model: openai/gpt-4o + description: Orchestrates parallel research + instruction: Fan out research tasks and synthesize results. + sub_agents: [researcher] + toolsets: + - type: background_agents + - type: think + + researcher: + model: openai/gpt-4o + description: Web researcher + instruction: Research topics thoroughly. + toolsets: + - type: mcp + ref: docker:duckduckgo +``` + +> [!TIP] +> **When to Use** +> +> Use `background_agents` when your orchestrator needs to fan out work to multiple specialists in parallel — for example, researching several topics simultaneously or running independent code analyses side by side. + +In the TUI, each background task's token usage is accounted for live: the sidebar's Agents panel shows the sub-agent's context usage percentage on its roster row, the Agent Inspector shows its exact token counts, and the task's cost joins the session total. + +## Using Harness Sub-Agents + +Background agents work equally well with [harness-backed sub-agents](../../features/harnesses/index.md) — sub-agents driven by external coding CLIs such as Claude Code or Codex. This lets you dispatch multiple independent coding tasks in parallel: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Orchestrator that fans out coding tasks + instruction: | + Dispatch the frontend and backend tasks in parallel, + then collect results and produce a summary. + sub_agents: + - claude-coder + - codex-coder + toolsets: + - type: background_agents + + claude-coder: + description: Frontend specialist (Claude Code) + harness: + type: claude-code + effort: medium + + codex-coder: + description: Backend specialist (Codex) + harness: + type: codex +``` + +The orchestrator calls `run_background_agent` for each coding task, then uses `list_background_agents` and `view_background_agent` to collect results when they finish. + +> [!NOTE] +> **Harness toolsets are ignored** +> +> Harness agents use the external CLI's own tools — any `toolsets:` configured on the harness agent are silently ignored. See [Coding Harnesses](../../features/harnesses/index.md) for details and caveats. + +See [`examples/coding_harness_background_agents.yaml`](https://github.com/docker/docker-agent/blob/main/examples/coding_harness_background_agents.yaml) for a complete configuration. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/background-jobs/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/background-jobs/index.md new file mode 100644 index 000000000000..8a7a3915e678 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/background-jobs/index.md @@ -0,0 +1,89 @@ +--- +title: "Background Jobs Tool" +description: "Run and manage long-running shell commands." +keywords: docker agent, ai agents, tools, toolsets, background jobs, shell +linkTitle: "Background Jobs" +weight: 21 +canonical: https://docs.docker.com/ai/docker-agent/tools/background-jobs/ +--- + +_Run and manage long-running shell commands._ + +## Overview + +The `background_jobs` toolset starts shell commands that should keep running while the agent continues with other work, such as local servers, file watchers, long builds, or test suites. It returns a job ID immediately, captures combined stdout/stderr up to 10 MB per job, and terminates all running jobs when the agent session ends. + +Use the [`shell`](../shell/index.md) toolset for short synchronous commands. Add both toolsets when an agent needs both synchronous commands and long-running processes. + +## Configuration + +```yaml +toolsets: + - type: shell + - type: background_jobs +``` + +### Options + +| Property | Type | Description | +| -------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `env` | object | Environment variables to set for all background job commands. | +| `recall` | boolean | Let `run_background_job` expose a `recall` parameter so jobs can steer the agent when they finish (see [Background job recall](#background-job-recall)). Default `false`. | + +### Custom Environment Variables + +```yaml +toolsets: + - type: background_jobs + env: + MY_VAR: "value" + PATH: "${env.PATH}:/custom/bin" +``` + +### Background job recall + +Set `recall: true` to let the `run_background_job` tool expose a `recall` boolean parameter: + +```yaml +toolsets: + - type: background_jobs + recall: true +``` + +When the agent starts a background job with `recall: true`, Docker Agent sends a steering message back into the running agent loop after the job finishes. The message contains a short completion sentence and the job output, so the agent can react without polling `view_background_job`. + +Use recall for finite background work where completion matters (for example, a long build or test suite). Avoid it for servers and watchers that are expected to run until stopped. See [`examples/shell_recall.yaml`](https://github.com/docker/docker-agent/blob/main/examples/shell_recall.yaml) for a complete configuration. + +## Available Tools + +The background jobs toolset exposes five tools: + +| Tool Name | Description | +| ---------------------- | ---------------------------------------------------------------------------------------------- | +| `run_background_job` | Start a command asynchronously and return a job ID immediately. Use for servers/watchers/etc. | +| `list_background_jobs` | List all background jobs with their status, runtime, and metadata. | +| `view_background_job` | View the buffered output and status of a specific background job by ID. | +| `stop_background_job` | Stop a running background job. Child processes are terminated too. | +| `wait_background_job` | Block until a job finishes and return its exit code and output. Safe on already-finished jobs. | + +### `run_background_job` parameters + +| Parameter | Type | Required | Description | +| --------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `cmd` | string | ✓ | The shell command to execute in the background. | +| `cwd` | string | ✗ | Working directory to run the command in (default: `.`). | +| `recall` | boolean | ✗ | Only available when the `background_jobs` toolset has `recall: true`. When true, send a steering message with the job output when it finishes. | + +`view_background_job` and `stop_background_job` each take a single required `job_id` string returned by `run_background_job` or `list_background_jobs`. + +### `wait_background_job` parameters + +| Parameter | Type | Required | Description | +| --------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------- | +| `job_id` | string | ✓ | Job ID returned by `run_background_job` or `list_background_jobs`. | +| `timeout` | integer | ✗ | Maximum seconds to wait (default: `60`). If the job is still running when the limit fires, the tool returns the current output with a notice and the job continues in the background. | + +> [!WARNING] +> **Safety** +> +> Background jobs run shell commands with the same access as the agent process. Stop servers and watchers when they are no longer needed, and use [Sandbox Mode](../../configuration/sandbox/index.md) for additional isolation. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/fetch/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/fetch/index.md new file mode 100644 index 000000000000..fa793a54ac07 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/fetch/index.md @@ -0,0 +1,173 @@ +--- +title: "Fetch Tool" +description: "Read content from HTTP/HTTPS URLs." +keywords: docker agent, ai agents, tools, toolsets, fetch tool +linkTitle: "Fetch" +weight: 50 +canonical: https://docs.docker.com/ai/docker-agent/tools/fetch/ +--- + +_Read content from HTTP/HTTPS URLs._ + +## Overview + +The fetch tool lets agents retrieve content from one or more HTTP/HTTPS URLs. It is **read-only** — only `GET` requests are supported. The tool respects `robots.txt`, limits response size (1 MB per URL), and can return content as plain text, Markdown (converted from HTML), or raw HTML. + +> [!NOTE] +> **GET only** +> +> The fetch tool does **not** support `POST`, `PUT`, `DELETE` or other methods, and does not expose request bodies or per-call custom headers (the toolset can still attach static [credential headers](#custom-headers) to every request). To call REST endpoints with other verbs, use the [API tool](../api/index.md) or an [OpenAPI toolset](../openapi/index.md). + +## Configuration + +```yaml +toolsets: + - type: fetch +``` + +### Options + +| Property | Type | Default | Description | +| ------------------- | ------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `timeout` | int | `30` | Default request timeout in seconds (overridable per tool call). | +| `allowed_domains` | array[string] | _none_ | Allow-list of hosts the tool may fetch. When set, every URL whose host is **not** in the list is rejected before any network call is made. Mutually exclusive with `blocked_domains`. | +| `blocked_domains` | array[string] | _none_ | Deny-list of hosts the tool must not fetch. URLs whose host matches one of these patterns are rejected before any network call (including `robots.txt`) is made. Mutually exclusive with `allowed_domains`. | +| `allow_private_ips` | boolean | `false` | Opt in to dialling **non-public** IP addresses (loopback, RFC1918, link-local — including the cloud-metadata endpoint at `169.254.169.254` — multicast, and the unspecified address). Required to reach `localhost` / internal services. See [SSRF protection](#ssrf-protection-and-reaching-localhost) below. | +| `headers` | map[string]string | _none_ | Static HTTP headers attached to **every** request the toolset issues (including `robots.txt`). Values support `${env.VAR}` for secrets. Caller-supplied entries override the default `User-Agent` and the format-driven `Accept` header. Headers are stripped on cross-host redirects so credentials never leak to a third-party host. See [Custom headers](#custom-headers) below. | + +### Domain matching + +Domain patterns in `allowed_domains` and `blocked_domains` use the following rules (case-insensitive): + +- **Bare domain** — `example.com` matches the host `example.com` _and_ any subdomain such as `docs.example.com`. It does **not** match unrelated hosts that share a suffix (e.g. `badexample.com`). +- **Leading dot** — `.example.com` matches **only** strict subdomains (`docs.example.com`, `a.b.example.com`), not the apex `example.com`. +- **Wildcard glob** — `*.example.com` is an alias for the leading-dot form; the apex is excluded. The `*` is only valid as a leading `*.` token (entries like `foo.*`, `*.*.example.com`, or a bare `*` are rejected at config-load time). +- **IP literal** — IP addresses are matched exactly (`169.254.169.254`). +- **CIDR range** — `169.254.0.0/16`, `10.0.0.0/8`, `::1/128`, `fc00::/7`. Matches when the URL's host parses as an IP inside the network. Hostname hosts never match a CIDR pattern. Malformed CIDRs are rejected at config-load time. +- **Trailing dots** in FQDN-form URLs (`http://example.com./`) are stripped before matching, so they cannot bypass a deny-list entry. + +The lists are mutually exclusive: a single fetch toolset may set either `allowed_domains` or `blocked_domains`, but not both. + +When a list is configured, every redirect target is re-checked against the same list. A request to an allowed origin that redirects to a forbidden host is rejected before any data is read from the redirect. + +> [!WARNING] +> **Limitations** +> +> Matching is purely string-based on the URL host. It does **not** perform DNS resolution and does **not** normalise alternative IP encodings (decimal `2852039166`, hex `0xa9.0xfe.0xa9.0xfe`, octal, etc. IPv4-mapped IPv6 addresses ARE normalized to their IPv4 form). If you need to deny access to a specific IP, also list its alternative encodings, or block at the network layer. + +### Custom Timeout + +```yaml +toolsets: + - type: fetch + timeout: 60 +``` + +### Custom headers + +Attach static headers — typically credentials — to every request. Values support `${env.VAR}` interpolation so secrets stay out of YAML, and headers are dropped on cross-host redirects so a redirect chain cannot leak them to a third-party host: + +```yaml +toolsets: + - type: fetch + allowed_domains: + - docs.internal.example.com + headers: + Authorization: "Bearer ${env.INTERNAL_DOCS_TOKEN}" + X-Internal-Client: "docker-agent" +``` + +> [!WARNING] +> **Pair credential headers with an allow-list** +> +> When `headers` carries credentials (e.g. `Authorization`), set `allowed_domains` to the specific hosts that should receive them. Stdlib already strips a small allow-list (`Authorization`, `Cookie`, `WWW-Authenticate`) on cross-domain redirects, and the fetch tool additionally strips every operator-supplied header on cross-host redirects — but an allow-list is the strongest guarantee against accidental exfiltration. + +### Restrict to specific domains + +```yaml +toolsets: + - type: fetch + allowed_domains: + - docker.com # docker.com and *.docker.com + - github.com # github.com and *.github.com + - .githubusercontent.com # only subdomains, e.g. raw.githubusercontent.com +``` + +### Block sensitive hosts + +```yaml +toolsets: + - type: fetch + blocked_domains: + - 169.254.169.254 # cloud metadata endpoint (literal IP) + - 169.254.0.0/16 # entire link-local range (CIDR) + - 10.0.0.0/8 # RFC1918 private range + - "*.internal.example.com" # any subdomain (wildcard) + - internal.example.com # internal corporate hostname +``` + +> [!NOTE] +> **Already blocked by default** +> +> You do **not** need to add loopback, RFC1918, link-local (incl. `169.254.169.254`), multicast or the unspecified address to `blocked_domains` to be safe — the fetch tool already refuses connections to those ranges at dial time, after DNS resolution. The example above is only useful if you also want to reject those hosts _before_ any network call (and to surface a clearer error message to the agent), or if you have set `allow_private_ips: true` and want to deny a specific subset. + +### SSRF protection and reaching localhost + +By default, the fetch tool refuses connections to **non-public IP addresses** — even when DNS for an otherwise-public host resolves to one of them (so DNS rebinding is also blocked). The check happens at dial time, after DNS resolution, and rejects: + +- **Loopback** — `127.0.0.0/8`, `::1` (this is what blocks `http://localhost/...` and `http://127.0.0.1/...`) +- **RFC1918 private ranges** — `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` +- **Link-local** — `169.254.0.0/16` (IPv4, including the cloud-metadata endpoint `169.254.169.254`) and `fe80::/10` (IPv6) +- **Multicast** and the **unspecified** address (`0.0.0.0`, `::`) +- **IPv4-mapped IPv6** — addresses like `::ffff:127.0.0.1` or `::ffff:169.254.169.254` are normalized to their IPv4 form and blocked accordingly + +This is the default because LLM-driven fetches are a classic Server-Side Request Forgery (SSRF) vector: a prompt-injected URL can otherwise reach internal services, cloud metadata, or admin interfaces on the host running the agent. + +If an agent legitimately needs to call **localhost** or an **internal service**, opt in with `allow_private_ips: true`: + +```yaml +toolsets: + - type: fetch + allow_private_ips: true + allowed_domains: + - localhost + - 127.0.0.1 + - 10.0.0.0/8 # internal corporate range +``` + +> [!WARNING] +> **Pair with an allow-list** +> +> Setting `allow_private_ips: true` alone re-exposes the SSRF surface. We strongly recommend combining it with an `allowed_domains` entry that restricts the tool to the specific internal hosts or CIDRs the agent actually needs (e.g. `localhost`, `127.0.0.1`, or your internal CIDR). +> +> **Note:** `allowed_domains` is checked _before_ DNS resolution (string-based on hostname), while the SSRF check happens _after_ DNS resolution (on the resolved IP). This means `allowed_domains` and `blocked_domains` are evaluated independently of `allow_private_ips` and continue to apply. A public hostname in `allowed_domains` that resolves to a private IP will still be blocked unless `allow_private_ips: true` is set. + +## Tool Interface + +The toolset exposes a single tool, `fetch`, with the following parameters: + +| Parameter | Type | Required | Description | +| --------- | -------------- | -------- | ----------------------------------------------------------------------------------------------------------- | +| `urls` | array[string] | ✓ | One or more HTTP/HTTPS URLs to fetch (all via `GET`). | +| `format` | string | ✓ | Output format: `text`, `markdown`, or `html`. HTML responses are converted to text/markdown when requested. | +| `timeout` | integer | ✗ | Per-call request timeout in seconds. Overrides the toolset default. Valid range: `1`–`300`. | + +Responses are capped at **1 MB** per URL. Hosts that disallow the agent's user-agent via `robots.txt` are skipped with a clear error. + +> [!TIP] +> **Fetch vs. API Tool** +> +> Use `fetch` when the agent needs to read arbitrary public URLs at runtime. Use the [API tool](../api/index.md) to expose specific, structured HTTP endpoints (including non-`GET` verbs) as named tools. + +## Domain Filtering + +The `allowed_domains`, `blocked_domains`, and `allow_private_ips` options let you control which hosts the fetch tool may reach. The complete reference is in the [Options](#options) table and [Domain matching](#domain-matching) section above. + +**Key points:** + +- `allowed_domains` — allow-list; only listed hosts (and their subdomains for bare-domain entries) are reachable +- `blocked_domains` — deny-list; mutually exclusive with `allowed_domains` (a config error is thrown if both are set) +- `allow_private_ips` — defaults to `false`; set to `true` to reach loopback / RFC-1918 / link-local addresses +- The same `allow_private_ips` flag is also supported on `api`, `openapi`, `a2a`, and remote `mcp` toolsets + +See [`examples/fetch_domain_filtering.yaml`](https://github.com/docker/docker-agent/blob/main/examples/fetch_domain_filtering.yaml) for a complete filtering example, and [`examples/remote_mcp_allow_private_ips.yaml`](https://github.com/docker/docker-agent/blob/main/examples/remote_mcp_allow_private_ips.yaml) for the equivalent pattern on remote MCP toolsets. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/filesystem/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/filesystem/index.md new file mode 100644 index 000000000000..19b0be53e1c2 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/filesystem/index.md @@ -0,0 +1,145 @@ +--- +title: "Filesystem Tool" +description: "Read, write, list, search, and navigate files and directories." +keywords: docker agent, ai agents, tools, toolsets, filesystem tool +linkTitle: "Filesystem" +weight: 10 +canonical: https://docs.docker.com/ai/docker-agent/tools/filesystem/ +--- + +_Read, write, list, search, and navigate files and directories._ + +## Overview + +The filesystem tool gives agents the ability to explore codebases, read and edit files, create new files, search across files, and navigate directory structures. + +### Path resolution + +Paths are resolved relative to the **working directory** (the directory where the agent session started, or the directory specified with `--workdir`): + +- **Relative paths** (e.g., `src/main.go`, `../README.md`) are joined with the working directory. +- **Absolute paths** must match the host operating system: + - Unix/Linux/macOS: `/home/user/project/file.txt` + - Windows: `C:\Users\user\project\file.txt` or `C:/Users/user/project/file.txt` +- **Home directory expansion**: paths starting with `~` or `~/` expand to the user's home directory. + +When a file is not found, error messages include the resolved absolute path to help diagnose incorrect base directories or path formats. + +> [!IMPORTANT] +> Agents must use paths appropriate for the host OS. A Windows absolute path like `C:\file.txt` on a Unix system (or vice versa) is rejected with a clear error message. + +### Empty directory detection + +When `list_directory` encounters an empty directory or a directory where all entries are hidden by ignore patterns (e.g., only a `.git` folder when `ignore_vcs: true`), it explicitly reports the state: + +- **Empty directory**: "Directory is empty: /path/to/dir" +- **All entries ignored**: "Directory has no visible entries (N hidden by ignore patterns): /path/to/dir" + +This helps agents distinguish between an empty directory and a tool failure, avoiding unnecessary retries with shell commands. + +## Available Tools + +| Tool | Description | +| ---------------------- | ------------------------------------------------------------------------- | +| `read_file` | Read the contents of a file (whole file, or a line range of a text file) | +| `read_multiple_files` | Read several files in one call (more efficient than multiple `read_file`) | +| `write_file` | Create or overwrite a file with new content | +| `edit_file` | Make line-based edits (find-and-replace) in an existing file. Each edit must specify a non-empty `oldText` to match and replace; empty `oldText` values are rejected with an error. | +| `list_directory` | List files and directories at a given path (explicitly reports empty directories) | +| `directory_tree` | Recursive tree view of a directory | +| `create_directory` | Create a new directory (creates parent directories as needed) | +| `remove_directory` | Remove an empty directory | +| `search_files_content` | Search for text or regex patterns across files | + +## edit_file Validation + +The `edit_file` tool applies a sequence of find-and-replace edits to a file in memory, then writes the result back atomically. Each edit must provide a non-empty `oldText` value: + +- **Valid**: `{"oldText": "line one", "newText": "LINE ONE"}` +- **Invalid**: `{"oldText": "", "newText": "INJECTED"}` — rejected with error + +An empty `oldText` is never a meaningful edit: Go's `strings.Contains(s, "")` is always `true`, and `strings.Replace(s, "", new, 1)` silently inserts at offset 0. Without validation, this would prepend content to the file while still reporting success. The tool now returns an explicit error ("oldText must not be empty") when an edit has an empty `oldText`, and no changes are written to disk. + +When a sequence contains multiple edits and a later one is rejected, the entire operation fails and the file is left untouched — edits are applied in memory and only written once at the end, so partial application is not possible. + +## Configuration + +```yaml +toolsets: + - type: filesystem +``` + +### Options + +| Property | Type | Default | Description | +| --- | --- | --- | --- | +| `ignore_vcs` | boolean | `true` | When `true` (default), `.git` directories and `.gitignore` patterns are excluded from listings and searches. Set to `false` to include them. | +| `post_edit` | array | `[]` | Commands to run after editing files matching a path pattern | +| `post_edit[].path` | string | — | Glob pattern for files (e.g., `*.go`, `src/*/*.ts`) | +| `post_edit[].cmd` | string | — | Command to run (use `${file}` for the edited file path) | +| `allow_list` | array | `[]` | Directories the tools may access. Empty = unrestricted (default). | +| `deny_list` | array | `[]` | Directories the tools must not access. Takes precedence over `allow_list`. | + +### Path access control + +By default the filesystem tools are unrestricted: relative paths resolve +from the working directory, but absolute paths and `..` traversals can +reach anywhere the agent process can. Configure `allow_list` and/or +`deny_list` to sandbox the toolset. + +Entries in either list are expanded as follows: + +- `"."` — the agent's working directory +- `"~"` or `"~/..."` — the user's home directory +- `"$VAR"` / `"${VAR}"` / `"${env.VAR}"` — environment variable expansion +- absolute paths — used as-is +- relative paths — anchored at the working directory + +Symlinks are resolved before the containment check, so a symlink inside an +allowed root cannot be used to escape it. When an `allow_list` is set, +each entry is opened as a Go [`*os.Root`](https://pkg.go.dev/os#Root) so +that the kernel's rooted-lookup semantics also reject `..` and symlink +escapes at I/O time, not just at resolve time. + +```yaml +toolsets: + - type: filesystem + # Restrict every operation to the working directory and the user's + # home folder, then carve credentials out of the home folder. + allow_list: + - "." + - "~" + deny_list: + - "~/.ssh" + - "~/.aws" +``` + +When the path supplied by the agent is rejected, the tool returns a +structured error rather than performing any filesystem I/O. This makes the +restriction visible to the model so it can adjust its plan. + +### Post-Edit Hooks + +Automatically run formatting, linting, or other commands after the agent edits a file. The command fires once per file after each edit operation (`write_file` and `edit_file`). Use `${file}` as a placeholder for the absolute path of the edited file. + +```yaml +toolsets: + - type: filesystem + ignore_vcs: false + post_edit: + - path: "*.go" + cmd: "gofmt -w ${file}" + - path: "*.ts" + cmd: "prettier --write ${file}" + - path: "src/*/*.py" + cmd: "black ${file}" +``` + +| Property | Type | Description | +| --- | --- | --- | +| `path` | string | Glob pattern matched against the file path. `*.go` matches any `.go` file; `src/*/*.ts` matches `.ts` files inside `src/`. | +| `cmd` | string | Shell command to run. `${file}` expands to the absolute path of the just-edited file. | + +Post-edit commands run with the same working directory as the agent. If a command exits non-zero, the error is logged and surfaced to the model as a warning, but the edit is not rolled back. + +See [`examples/post_edit.yaml`](https://github.com/docker/docker-agent/blob/main/examples/post_edit.yaml) for a complete example. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/git/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/git/index.md new file mode 100644 index 000000000000..9568b7508dfa --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/git/index.md @@ -0,0 +1,100 @@ +--- +title: "Git Tool" +description: "Read-only inspection of the working git repository." +keywords: docker agent, ai agents, tools, toolsets, git tool +linkTitle: "Git" +weight: 125 +canonical: https://docs.docker.com/ai/docker-agent/tools/git/ +--- + +_Read-only inspection of the working git repository._ + +## Overview + +The git toolset gives an agent structured, **read-only** access to the working repository — status, history, branches, a commit's changes, and line-level authorship. It is implemented with go-git, so it needs **no `git` binary**. + +Compared with running `git` through the `shell` tool, the git toolset returns clean, structured output the model can read reliably, is **safe by construction** (no command can modify the repository), and works even when `shell` is disabled or no `git` binary is installed. + +> [!NOTE] +> The git toolset is read-only. To stage, commit, or check out, use the [`shell`](../shell/index.md) tool. + +## Configuration + +```yaml +toolsets: + - type: git +``` + +No configuration options. The repository is opened at the agent's working directory; a subdirectory still resolves to the repository root. + +> [!WARNING] +> **The repository is discovered by walking up parent directories.** If the working +> directory is not itself a repository but an ancestor is (for example a +> home directory tracked as dotfiles), the toolset resolves to that ancestor and +> `git_show` / `git_blame` can expose its full history and file contents. The +> filesystem toolset's allow/deny lists do **not** apply here. Only enable this +> toolset where the surrounding repository is safe to read. + +> [!NOTE] +> **Performance.** go-git is pure Go, which costs speed on large repositories: +> `git_status` rehashes the whole worktree, and `git_blame` scales with history +> depth times file size — its 400-line output cap is applied *after* the full +> computation, so it does not make blaming a large file cheaper. + +## Tools + +| Tool | Description | +| --- | --- | +| `git_status` | Current branch and changed files (staged / unstaged / untracked). | +| `git_log` | Recent commits (hash, date, author, subject). | +| `git_branches` | Local branches, current one marked with `*`. | +| `git_show` | A commit's metadata, message, and changed files with +/- counts. | +| `git_blame` | Line-by-line authorship for a file. | + +### `git_log` + +| Parameter | Required | Description | +| --- | --- | --- | +| `limit` | No | Maximum number of commits to return (default 20). | +| `path` | No | Only show commits that touch this path. | + +### `git_show` + +| Parameter | Required | Description | +| --- | --- | --- | +| `ref` | No | Commit hash or revision to show (default HEAD). | + +### `git_blame` + +| Parameter | Required | Description | +| --- | --- | --- | +| `path` | Yes | File path to blame, relative to the repository root. | +| `rev` | No | Commit or revision to blame at (default HEAD). | + +## Example + +```yaml +agents: + root: + model: openai/gpt-5-mini + description: A code review assistant + instruction: | + Review the working changes: check git_status, then git_show the latest + commit, and summarize what changed. + toolsets: + - type: git + - type: filesystem +``` + +Example `git_status` output: + +```text +On branch master +1 changed file(s) [XY = staged/worktree; M=modified A=added D=deleted R=renamed ?=untracked]: + M main.go +``` + +> [!TIP] +> **When to use** +> +> Use the git toolset whenever the agent needs repository context — before editing, to review recent history, or to find who last touched a line — without exposing the writable `shell` surface. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/handoff/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/handoff/index.md new file mode 100644 index 000000000000..4375be03daac --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/handoff/index.md @@ -0,0 +1,63 @@ +--- +title: "Handoff Tool" +description: "Hand off the active conversation to another local agent defined in the same config." +keywords: docker agent, ai agents, tools, toolsets, handoff tool +linkTitle: "Handoff" +weight: 70 +canonical: https://docs.docker.com/ai/docker-agent/tools/handoff/ +--- + +_Hand off the active conversation to another local agent defined in the same config._ + +## Overview + +The `handoff` tool lets an agent transfer control of the **current conversation** to another agent in the **same config file**. Unlike [`transfer_task`](../transfer-task/index.md), which delegates a sub-task and collects the result, `handoff` rewires the session so the receiving agent continues the conversation directly with the user. + +This is the core mechanism for **handoffs routing** — a pattern where a router agent classifies the user's request and hands it off to a specialist, which then owns the rest of the session. + +> [!NOTE] +> **Local only** +> +> The `handoff` tool only targets agents declared in the **same** config file by their local name. It does **not** open network connections. To delegate to a remote agent over the network, use the [A2A toolset](../a2a/index.md) instead. + +## Configuration + +The tool is enabled implicitly when an agent declares a non-empty `handoffs:` list. You do **not** add `- type: handoff` under `toolsets:` — it is not a toolset type. + +```yaml +agents: + router: + model: openai/gpt-4o + description: Routes questions to the right specialist + instruction: | + Classify the user's question and hand off to the most appropriate + specialist. If unsure, ask a clarifying question first. + handoffs: [billing, support] + + billing: + model: openai/gpt-4o + description: Billing specialist + instruction: Answer billing questions. + + support: + model: openai/gpt-4o + description: Technical support specialist + instruction: Help with technical issues. +``` + +The router agent automatically gets a `handoff` tool it can call to switch the conversation to `billing` or `support`. + +## Tool Interface + +The `handoff` tool takes a single parameter: + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------------------------------------------------------- | +| `agent` | string | ✓ | The local name of the agent to hand off the conversation to. | + +Only names listed in the current agent's `handoffs:` field are valid targets. + +> [!TIP] +> **See also** +> +> For sub-task delegation (caller stays in control, waits for the result), see [Transfer Task](../transfer-task/index.md). For remote agent connections over the network, see the [A2A toolset](../a2a/index.md). For the broader pattern, see [Handoffs Routing](../../concepts/multi-agent/index.md#handoffs-routing). diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/lsp/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/lsp/index.md new file mode 100644 index 000000000000..b2d97b7227b6 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/lsp/index.md @@ -0,0 +1,227 @@ +--- +title: "LSP Tool" +description: "Connect to Language Server Protocol servers for code intelligence." +keywords: docker agent, ai agents, tools, toolsets, lsp tool +linkTitle: "LSP" +weight: 220 +canonical: https://docs.docker.com/ai/docker-agent/tools/lsp/ +--- + +_Connect to Language Server Protocol servers for code intelligence._ + +## Overview + +The LSP tool connects your agent to any Language Server Protocol (LSP) server, providing comprehensive code intelligence capabilities like go-to-definition, find references, diagnostics, and more. + +> [!NOTE] +> **What is LSP?** +> +> The [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) is a standard for providing language features like autocomplete, go-to-definition, and diagnostics. Most programming languages have LSP servers available. + +## Available Tools + +The LSP toolset provides these tools to the agent: + +| Tool | Description | Read-Only | +| ----------------------- | --------------------------------------------- | --------- | +| `lsp_workspace` | Get workspace info and available capabilities | ✓ | +| `lsp_hover` | Get type info and documentation for a symbol | ✓ | +| `lsp_definition` | Find where a symbol is defined | ✓ | +| `lsp_references` | Find all references to a symbol | ✓ | +| `lsp_document_symbols` | List all symbols in a file | ✓ | +| `lsp_workspace_symbols` | Search symbols across the workspace | ✓ | +| `lsp_diagnostics` | Get errors and warnings for a file | ✓ | +| `lsp_code_actions` | Get available quick fixes and refactorings | ✓ | +| `lsp_rename` | Rename a symbol across the workspace | ✗ | +| `lsp_format` | Format a file | ✗ | +| `lsp_call_hierarchy` | Find incoming/outgoing calls | ✓ | +| `lsp_type_hierarchy` | Find supertypes/subtypes | ✓ | +| `lsp_implementations` | Find interface implementations | ✓ | +| `lsp_signature_help` | Get function signature at call site | ✓ | +| `lsp_inlay_hints` | Get type annotations and parameter names | ✓ | + +## Configuration + +```yaml +agents: + developer: + model: anthropic/claude-sonnet-4-5 + description: Code developer with LSP support + instruction: You are a software developer. + toolsets: + - type: lsp + command: gopls + args: [] + file_types: [".go"] + - type: filesystem + - type: shell +``` + +## Properties + +| Property | Type | Required | Description | +| ------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `command` | string | ✓ | LSP server executable command | +| `args` | array | ✗ | Command-line arguments for the LSP server | +| `env` | object | ✗ | Environment variables for the LSP process | +| `file_types` | array | ✗ | File extensions this LSP handles (e.g., `[".go", ".mod"]`) | +| `working_dir` | string | ✗ | Working directory for the LSP server process. Relative paths are resolved against the agent's working directory. Defaults to the agent's working directory when omitted. | +| `version` | string | ✗ | Package reference for [auto-installing](../../configuration/tools/index.md#auto-installing-tools) the command binary | + +## Common LSP Servers + +Here are configurations for popular languages: + +### Go (gopls) + +```yaml +toolsets: + - type: lsp + command: gopls + version: "golang/tools@v0.21.0" # optional: auto-install if not in PATH + file_types: [".go"] +``` + +If your Go module lives in a subdirectory (e.g. a monorepo where `go.mod` is under `./backend`), set `working_dir` so `gopls` is started from the module root: + +```yaml +toolsets: + - type: lsp + command: gopls + file_types: [".go"] + working_dir: ./backend # gopls must be started from the module root +``` + +### TypeScript/JavaScript (typescript-language-server) + +```yaml +toolsets: + - type: lsp + command: typescript-language-server + args: ["--stdio"] + file_types: [".ts", ".tsx", ".js", ".jsx"] +``` + +### Python (pylsp) + +```yaml +toolsets: + - type: lsp + command: pylsp + file_types: [".py"] +``` + +### Rust (rust-analyzer) + +```yaml +toolsets: + - type: lsp + command: rust-analyzer + file_types: [".rs"] +``` + +### C/C++ (clangd) + +```yaml +toolsets: + - type: lsp + command: clangd + file_types: [".c", ".cpp", ".h", ".hpp"] +``` + +## Multiple LSP Servers + +You can configure multiple LSP servers for different file types: + +```yaml +agents: + polyglot: + model: anthropic/claude-sonnet-4-5 + description: Multi-language developer + instruction: You are a full-stack developer. + toolsets: + - type: lsp + command: gopls + file_types: [".go"] + - type: lsp + command: typescript-language-server + args: ["--stdio"] + file_types: [".ts", ".tsx", ".js", ".jsx"] + - type: lsp + command: pylsp + file_types: [".py"] + - type: filesystem + - type: shell +``` + +## Workflow Instructions + +The LSP tool includes built-in instructions that guide the agent on how to use it effectively. The agent learns to: + +1. Start with `lsp_workspace` to understand available capabilities +2. Use `lsp_workspace_symbols` to find relevant code +3. Use `lsp_references` before modifying any symbol +4. Check `lsp_diagnostics` after every code change +5. Apply `lsp_format` after edits are complete + +> [!TIP] +> **Best Practice** +> +> Always include the `filesystem` tool alongside LSP. The agent needs filesystem access to read and write code files, while LSP provides intelligence about the code. + +## Capability Detection + +Not all LSP servers support all features. During the `initialize` handshake, Docker Agent reads the server's `ServerCapabilities` and **filters out the `lsp_*` tools the server does not advertise**. The model never sees, for example, `lsp_inlay_hints` against a server that doesn't support it, so it can't waste a turn calling a tool that would only fail. + +The agent uses `lsp_workspace` to discover what's available: + +```text +Workspace Information: +- Root: /path/to/project +- Server: gopls v0.14.0 +- File types: .go + +Available Capabilities: +- Hover: Yes +- Go to Definition: Yes +- Find References: Yes +- Rename: Yes +- Code Actions: Yes +- Formatting: Yes +- Call Hierarchy: Yes +- Type Hierarchy: Yes +... +``` + +## Auto-Restart and Lifecycle + +LSP toolsets are managed by the same supervisor as MCP toolsets, so a crashed `gopls` (or any other language server) is reconnected automatically with exponential backoff. Use the [`lifecycle`](../../configuration/tools/index.md#toolset-lifecycle) block to tune the policy per toolset — for example, mark `gopls` as `strict` if your CI flow requires it to be available, or use `/toolset-restart gopls` from the TUI to force a reconnect when the server gets stuck. + +```yaml +toolsets: + - type: lsp + command: gopls + file_types: [".go"] + lifecycle: + profile: resilient # default: auto-restart on crash with exponential backoff +``` + +## Position Format + +All LSP tools use **1-based** line and character positions: + +- Line 1 is the first line of the file +- Character 1 is the first character on a line + +```json +{ + "file": "/path/to/file.go", + "line": 42, + "character": 15 +} +``` + +> [!TIP] +> **Auto-Installation** +> +> Docker Agent can automatically download and install LSP servers if they are not found in your PATH. Use the `version` property to specify a package, or let Docker Agent auto-detect it from the command name. See [Auto-Installing Tools](../../configuration/tools/index.md#auto-installing-tools) for details. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/mcp-catalog/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/mcp-catalog/index.md new file mode 100644 index 000000000000..d395a3ef6de7 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/mcp-catalog/index.md @@ -0,0 +1,113 @@ +--- +title: "MCP Catalog Tool" +description: "Let the agent discover and activate remote MCP servers from the Docker MCP Catalog on demand." +keywords: docker agent, ai agents, tools, toolsets, mcp catalog tool +linkTitle: "MCP Catalog" +weight: 120 +canonical: https://docs.docker.com/ai/docker-agent/tools/mcp-catalog/ +--- + +_Let the agent discover and activate remote MCP servers from the Docker MCP Catalog on demand._ + +## Overview + +The `mcp_catalog` toolset gives an agent access to a curated subset of the [Docker MCP Catalog](https://hub.docker.com/search?q=&type=mcp) — every server in this subset is reachable over the **streamable-http** transport, so Docker Agent can talk to it directly without the MCP gateway or a local subprocess. + +Servers are **not** active by default. Instead, the toolset exposes a small set of meta-tools the agent uses to search, enable, and disable servers as a turn unfolds. Tools from un-enabled servers stay hidden, so the prompt is not flooded with hundreds of tool definitions the agent will never use. + +> [!NOTE] +> **When to use it** +> +> Use `mcp_catalog` when you want the agent to _decide at runtime_ which third-party services it needs (Notion, Stripe, Brave Search, …) instead of pinning that decision in YAML up front. For a fixed set of servers, declare each one with [`type: mcp`](../../configuration/tools/index.md#mcp-tools) directly — the catalog adds an extra layer of meta-tools that pure `type: mcp` entries do not need. + +## Configuration + +```yaml +toolsets: + - type: mcp_catalog +``` + +The catalog is embedded in the `docker-agent` binary and refreshed with each release. By default every server in the embedded subset is offered. + +### Restricting the offered servers + +Two optional lists narrow what the toolset offers, so an agent sees a focused, predictable menu instead of the full catalog: + +- **`allowed_servers`** — when non-empty, **only** these catalog server ids are searchable and enableable; every other entry is hidden. +- **`blocked_servers`** — removes individual ids from the offered set. It is applied **after** `allowed_servers`, so a server listed in both is blocked (block wins over allow). + +Both take server ids (the `id` field returned by `search_remote_mcp_servers`). An empty or omitted list disables that filter. + +```yaml +toolsets: + - type: mcp_catalog + allowed_servers: + - docker-docs + - microsoft-learn + - hugging-face + blocked_servers: + - gitmcp +``` + +## Meta-Tools + +Up to five tools are exposed to the model. The disable / reset-auth pair only appears once at least one server is enabled, so the meta-tool surface stays minimal until the agent activates something. + +| Tool | When visible | Description | +| ------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `search_remote_mcp_servers` | Always | Case-insensitive fuzzy search over id, title, description, category and tags. Returns id, auth requirements (`oauth` / `none`) and URL. | +| `enable_remote_mcp_server` | Always | Activate a server by id. **Blocks** until the connection (and any required OAuth handshake) completes; on success the server's tools are immediately live and the model continues with the user's original request in the same turn. | +| `list_remote_mcp_servers` | Always | Show currently enabled servers and their connection state. | +| `disable_remote_mcp_server` | After first enable | Stop a server and remove its tools from the active set. | +| `reset_remote_mcp_server_auth` | After first enable | Drop persisted OAuth credentials so the next enable triggers a fresh authorization flow. No-op for `none` servers. | + +### Workflow + +1. The agent calls `search_remote_mcp_servers` with a keyword matching the user's intent (`"notion"`, `"stripe"`, `"docs"`, `"browser"`, `"grafana"`, …). +2. It picks a matching server id and calls `enable_remote_mcp_server`. **`enable` blocks** until the MCP handshake (and any required OAuth flow) completes: + - on success the server's tools are available **in the same turn** — the agent goes straight to the user's original request, no re-ask required; + - on failure (user dismissed the authorization dialog, server refused) the tool returns an error result naming the specific reason so the agent can recover instead of pretending the server is connected. +3. It uses the newly activated tools as it would any other. +4. When done, it calls `disable_remote_mcp_server` to remove the server from the active set. + +## Authentication + +The catalog only includes servers Docker Agent can authenticate itself, so there are two auth flavours: + +- **`oauth`** — `enable_remote_mcp_server` surfaces an authorization URL through the elicitation pipeline (the same one used by YAML-declared remote MCP toolsets) and blocks until the user either authorizes or cancels. Once the user authorizes, tokens are persisted in the OS keyring and re-used on subsequent runs. Use `reset_remote_mcp_server_auth` to wipe them. If the user dismisses the dialog, `enable` returns an error result naming the decline so the agent can ask whether to retry. +- **`none`** — No authentication. The server is reachable as soon as it is enabled. + +Servers that require a caller-provided API key are intentionally excluded from the catalog. To use one, declare it explicitly with [`type: mcp`](../../configuration/tools/index.md#mcp-tools) and supply the key via an environment variable. + +## Example + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Agent that can on-demand connect to remote MCP servers from the Docker MCP Catalog. + instruction: | + You can discover and activate remote MCP servers on demand. + Use search_remote_mcp_servers to find a server matching the + user's intent, then enable_remote_mcp_server to activate it. + Be conservative: enable only the servers you actually need for + the task at hand. Disable a server with disable_remote_mcp_server + once you are done with it. + toolsets: + - type: mcp_catalog +``` + +A complete, runnable configuration lives in [`examples/mcp_catalog.yaml`](https://github.com/docker/docker-agent/blob/main/examples/mcp_catalog.yaml). A curated, allow/block-listed variant lives in [`examples/mcp_catalog_filtered.yaml`](https://github.com/docker/docker-agent/blob/main/examples/mcp_catalog_filtered.yaml). + +## Notes and Limitations + +- **Streamable-http only.** The catalog deliberately excludes servers that require a local subprocess or the MCP gateway — declare those with [`type: mcp`](../../configuration/tools/index.md#mcp-tools) instead. +- **Catalog membership changes between releases.** The set of available servers is updated with each Docker Agent release as integrations are added or removed. Servers present in one release may not appear in the next. +- **Blocking enable.** DNS, TCP, MCP handshake and any OAuth flow happen synchronously inside `enable_remote_mcp_server` so the agent gets a deterministic result in the same turn. On startup, however, the runtime probes tools non-interactively (`mcp.WithoutInteractivePrompts`); OAuth-pending servers fail fast there and are silently deferred to the next interactive turn — including the sidebar-only tool-count pass, where a dialog would be impossible. +- **No prompt discovery.** MCP prompt lookups (`/prompts`) walk YAML-declared `mcp` toolsets directly; prompts exposed by servers activated through the catalog are not surfaced. Tools — the primary interface — work fine. +- **Frozen at build time.** The list of servers is embedded in the binary. New entries land with each Docker Agent release. + +> [!TIP] +> **Pair with permissions** +> +> Because the agent decides which third-party services to talk to, this toolset works best with explicit [permissions](../../configuration/permissions/index.md) on the surrounding tools (filesystem writes, shell commands) so a misrouted server cannot exfiltrate data unnoticed. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/mcp/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/mcp/index.md new file mode 100644 index 000000000000..b1acb0cca7ea --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/mcp/index.md @@ -0,0 +1,309 @@ +--- +title: "MCP Tool" +description: "Extend agents with external tools via the Model Context Protocol." +keywords: docker agent, ai agents, tools, toolsets, mcp tool +linkTitle: "MCP" +weight: 130 +canonical: https://docs.docker.com/ai/docker-agent/tools/mcp/ +aliases: + - /ai/docker-agent/integrations/mcp/ +--- + +_Extend agents with external tools via the Model Context Protocol (MCP)._ + +## Overview + +The `mcp` toolset connects your agent to any MCP server — a process or remote service that exposes tools, resources, and prompts over the [Model Context Protocol](https://modelcontextprotocol.io/). Three flavours are supported: + +| Flavour | Transport | Best for | +| --- | --- | --- | +| **Docker MCP** | Container via the [MCP Gateway](https://github.com/docker/mcp-gateway) | Curated, sandboxed servers from the [Docker MCP Catalog](https://hub.docker.com/u/mcp) | +| **Local stdio** | Subprocess over stdin/stdout | Custom or community MCP servers run from a binary or `npx`/`pip` package | +| **Remote** | Streamable HTTP or SSE | Cloud services with hosted MCP endpoints (Linear, Notion, Atlassian, …) | + +> [!NOTE] +> **What is MCP?** +> +> The [Model Context Protocol](https://modelcontextprotocol.io/) is an open standard for connecting AI tools. Docker Agent can both _use_ MCP servers (this page) and _expose_ agents as MCP servers — see [MCP Mode](../../features/mcp-mode/index.md). + +## Docker MCP (Recommended) + +Run MCP servers as secure Docker containers via the MCP Gateway. The `ref: docker:<name>` syntax pulls a curated definition from the Docker MCP Catalog: + +```yaml +toolsets: + - type: mcp + ref: docker:duckduckgo # web search + - type: mcp + ref: docker:github-official # GitHub integration + tools: ["list_issues", "create_issue"] +``` + +Browse available servers at the [Docker MCP Catalog](https://hub.docker.com/u/mcp). + +| Property | Type | Description | +| ------------- | ------ | ---------------------------------------------------------------- | +| `ref` | string | Docker MCP reference (`docker:name`) or a name from the [reusable `mcps:`](../../configuration/overview/index.md#reusable-mcp-servers-mcps) block. | +| `tools` | array | Optional whitelist — only expose these tools to the model. | +| `instruction` | string | Custom instructions injected into the agent's context. | +| `config` | any | MCP server-specific configuration passed during initialization. | +| `working_dir` | string | Working directory for the MCP gateway subprocess. Only applies when the catalog entry runs as a local process (not remote). Relative paths are resolved against the agent's working directory. Supports `${env.VAR}` (canonical), plus `~` and shell-style `$VAR`/`${VAR}` expansion ([details](../../configuration/overview/index.md#variable-expansion-in-config-fields)). | + +## Local MCP (stdio) + +Run MCP servers as local processes communicating over stdin/stdout: + +```yaml +toolsets: + - type: mcp + command: python + args: ["-m", "mcp_server"] + tools: ["search", "fetch"] + env: + API_KEY: value +``` + +| Property | Type | Description | +| ------------- | ------ | ----------- | +| `command` | string | Command to execute the MCP server. | +| `args` | array | Command arguments. | +| `tools` | array | Optional whitelist — only expose these tools. | +| `env` | object | Environment variables (key-value pairs). | +| `working_dir` | string | Working directory for the MCP server process. Relative paths are resolved against the agent's working directory. Defaults to the agent's working directory when omitted. Supports `${env.VAR}` (canonical), plus `~` and shell-style `$VAR`/`${VAR}` expansion ([details](../../configuration/overview/index.md#variable-expansion-in-config-fields)). | +| `instruction` | string | Custom instructions injected into the agent's context. | +| `version` | string | Package reference for [auto-installing](../../configuration/tools/index.md#auto-installing-tools) the command binary. | + +> [!TIP] +> **Auto-installation** +> +> If the `command` is not in your `PATH`, Docker Agent looks it up in the [aqua registry](https://github.com/aquaproj/aqua-registry) and installs it for you. Use `version: "false"` to opt out, or set `DOCKER_AGENT_AUTO_INSTALL=false` globally. See [Auto-Installing Tools](../../configuration/tools/index.md#auto-installing-tools). + +## Remote MCP (Streamable HTTP / SSE) + +Connect to MCP servers over the network. OAuth flows (including [Dynamic Client Registration](https://datatracker.ietf.org/doc/html/rfc7591)) are handled automatically — Docker Agent opens your browser when authentication is required and caches tokens for subsequent sessions. Tokens are refreshed silently when they expire or are revoked server-side; if a silent refresh is not possible, the OAuth prompt reappears on the next message. + +```yaml +toolsets: + - type: mcp + remote: + url: "https://mcp.linear.app/mcp" + transport_type: "streamable" # or "sse" for legacy servers + headers: + Authorization: "Bearer ${env.LINEAR_TOKEN}" + # Optional: allow OAuth helper requests to reach private/internal IPs. + allow_private_ips: false + tools: ["search_issues", "create_issue"] +``` + +| Property | Type | Description | +| ----------------------- | ------- | ----------- | +| `remote.url` | string | Base URL of the MCP server. | +| `remote.transport_type` | string | `streamable` or `sse`. | +| `remote.headers` | object | HTTP headers sent on every request. Values support `${env.VAR}` and `${headers.NAME}` placeholders, resolved per request. See [Remote MCP Servers](../../features/remote-mcp/index.md#per-request-header-template-expansion) for details. | +| `remote.oauth` | object | Explicit OAuth client credentials for servers that don't support DCR. See [Remote MCP Servers](../../features/remote-mcp/index.md#oauth-for-servers-without-dynamic-client-registration). | +| `allow_private_ips` | boolean | Permit remote MCP OAuth helper requests to dial non-public IP addresses. Use only for trusted internal servers. | + +For a curated list of public remote MCP endpoints (Linear, GitHub, Vercel, Notion, …) and full OAuth configuration details, see [Remote MCP Servers](../../features/remote-mcp/index.md). + +## MCP Prompts + +MCP servers can expose **prompts** — named, parameterized templates that the server provides via the `/prompts` endpoint. Docker Agent discovers these at toolset startup and registers them as **slash commands** in the TUI, so you can invoke them directly from the input box. + +```text +# Type / to see available prompts alongside built-in commands +/review # invoke an MCP prompt named "review" +/summarize My text here # invoke with the first argument filled in +``` + +**How it works:** + +- Each MCP prompt appears in the command palette (accessible via <kbd>Ctrl</kbd>+<kbd>K</kbd>) under the **MCP Prompts** category. +- Typing `/<prompt-name>` in the input box invokes the prompt immediately. +- If the prompt declares arguments and you provide text after the slash command, that text is mapped to the first declared argument. +- If a required argument is missing, Docker Agent opens the argument input dialog before running the prompt. +- When no argument is needed or all required arguments are supplied, the prompt runs immediately. + +> [!NOTE] +> MCP prompt discovery requires a YAML-declared `mcp` toolset. Prompts from servers activated through the [Docker MCP Catalog](../../tools/mcp-catalog/index.md) (`ref: docker:<name>`) are not currently surfaced. + +## Embedded Resources + +MCP tool results can include embedded resources — images, PDFs, and text files returned directly in the tool response. Docker Agent preserves these as attachments and forwards them to the model as native content blocks: + +- **Anthropic** — images become `image` blocks in the `tool_result`; PDFs and other documents become `document` blocks. +- **OpenAI** — images are forwarded as `input_image` data URIs; PDFs as `input_file` data URIs in the tool result content. +- **Bedrock** and **Gemini** — receive equivalent provider-native representations. + +No configuration is required. When an MCP server returns an embedded resource alongside its text output, the resource is automatically attached and sent to the model on the next turn. This is useful for MCP servers that generate charts, export PDFs, or return binary data as part of their responses. + +## Reusable Definitions (`mcps:`) + +Repeated MCP server configurations can be hoisted into the top-level `mcps:` section and referenced by name with `{type: mcp, ref: <name>}`: + +```yaml +mcps: + github: + remote: + url: https://api.githubcopilot.com/mcp + transport_type: sse + playwright: + command: npx + args: ["-y", "@modelcontextprotocol/server-playwright"] + +agents: + root: + model: openai/gpt-5 + toolsets: + - type: mcp + ref: github + - type: mcp + ref: playwright +``` + +See [Reusable MCP Servers](../../configuration/overview/index.md#reusable-mcp-servers-mcps) for the full reference. + +## Common Options + +These properties apply to every MCP toolset regardless of flavour: + +### Tool filtering + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + tools: ["list_issues", "create_issue", "get_pull_request"] +``` + +Whitelisting tools improves model accuracy — fewer choices means less confusion. + +### Deferred loading + +Skip the toolset's startup cost until its tools are actually called: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + defer: true + # Or defer specific tools within a toolset: + - type: mcp + ref: docker:slack + defer: ["list_channels", "search_messages"] +``` + +### Custom instructions + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + instruction: | + Use these tools to manage GitHub issues. + Always check for existing issues before creating new ones. + Label new issues with 'triage' by default. +``` + +### TOON-encoded outputs + +Re-encode verbose JSON outputs as the compact [TOON](https://github.com/alpkeskin/gotoon) format to save context budget. Typically yields 30–60% smaller payloads on list/search tools. + +`toon` is a regex string that is matched against tool names. Any tool whose name matches the pattern has its JSON output transparently re-encoded as TOON before it is shown to the model. The re-encoding reduces schema verbosity, which is especially useful when a model struggles with large or repetitive tool output. + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + toon: ".*" # toonify every tool from this server + - type: mcp + command: my-server + toon: "list_.*,get_.*" # only toonify list_/get_ tools +``` + +The value is a comma-separated list of regexes (or a single regex). A tool name must match at least one pattern to be re-encoded. Setting `toon: ".*"` re-encodes all tools from that toolset. + +See [`examples/github-toon.yaml`](https://github.com/docker/docker-agent/blob/main/examples/github-toon.yaml) for a practical example using the GitHub MCP server. + +### Per-toolset model routing + +Process tool results from this toolset with a different (typically cheaper / faster) model. The override is one-shot — subsequent turns return to the agent's primary model: + +```yaml +toolsets: + - type: mcp + ref: docker:github-official + model: openai/gpt-4o-mini +``` + +See [Per-Toolset Model Routing](../../configuration/tools/index.md#per-toolset-model-routing). + +### Lifecycle (auto-restart, profiles) + +Local stdio and remote MCP servers are supervised: crashed servers reconnect automatically with exponential backoff. **Remote** MCP servers (Streamable HTTP / SSE) also reconnect after idle/clean connection closes — services like Notion and Linear periodically close idle connections, and Docker Agent reconnects transparently. Tune the policy with the `lifecycle` block: + +```yaml +toolsets: + - type: mcp + ref: docker:duckduckgo + lifecycle: + profile: resilient # default; auto-restart with backoff + - type: mcp + command: docker + args: ["mcp", "gateway"] + lifecycle: + profile: strict # fail-fast: required, no retries +``` + +See [Toolset Lifecycle](../../configuration/tools/index.md#toolset-lifecycle) for all profiles and tuning knobs, and [`/toolset-restart`](../../features/tui/index.md) to force a reconnect from the TUI. + +## Combined Example + +```yaml +mcps: + github: + remote: + url: https://api.githubcopilot.com/mcp + transport_type: sse + +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Full-featured developer assistant + instruction: You are an expert developer. + toolsets: + # Docker MCP catalog entry + - type: mcp + ref: docker:duckduckgo + + # Reusable definition from the top-level mcps: block + - type: mcp + ref: github + tools: ["list_issues", "create_issue"] + toon: "list_.*" + + # Local stdio server with auto-install + - type: mcp + command: gopls + version: "golang/tools@v0.21.0" + args: ["mcp"] + + # Remote MCP with OAuth (handled automatically) + - type: mcp + remote: + url: "https://mcp.linear.app/mcp" + transport_type: "streamable" + instruction: Use Linear for issue tracking. +``` + +> [!WARNING] +> **Toolset order matters** +> +> If multiple toolsets provide a tool with the same name, the first one wins: the duplicate from the later toolset is ignored and a warning identifies both toolsets. Order your toolsets intentionally. To keep both tools callable, give the MCP toolset a unique `name:` (its tools are then exposed as `<name>_<tool>`) or restrict the overlapping toolset with its `tools:` filter. + +## See Also + +- [Tool Configuration](../../configuration/tools/index.md) — full reference for every toolset type, plus shared options (lifecycle, TOON, model routing, …). +- [Reusable MCP Servers](../../configuration/overview/index.md#reusable-mcp-servers-mcps) — the top-level `mcps:` block. +- [Remote MCP Servers](../../features/remote-mcp/index.md) — catalog of public remote MCP endpoints + OAuth recipes. +- [MCP Mode](../../features/mcp-mode/index.md) — expose your own agents as MCP tools to Claude Desktop, Claude Code, etc. +- [Auto-Installing Tools](../../configuration/tools/index.md#auto-installing-tools) — automatic installation of MCP server binaries. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/memory/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/memory/index.md new file mode 100644 index 000000000000..1e5671a304ea --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/memory/index.md @@ -0,0 +1,59 @@ +--- +title: "Memory Tool" +description: "Persistent key-value storage backed by SQLite for cross-session recall." +keywords: docker agent, ai agents, tools, toolsets, memory tool +linkTitle: "Memory" +weight: 100 +canonical: https://docs.docker.com/ai/docker-agent/tools/memory/ +--- + +_Persistent key-value storage backed by SQLite for cross-session recall._ + +## Overview + +The memory tool provides persistent key-value storage backed by SQLite. Data survives across sessions, allowing agents to remember facts, user preferences, project context, and past decisions. Memories can be organized with categories and searched by keyword. + +By default, the database is stored at `~/.cagent/memory/<config-name>/memory.db`, where `<config-name>` is derived from the loaded configuration (typically the YAML file name) and falls back to `default` when unavailable. When the agent is loaded from an OCI reference (e.g. `docker/my-agent:latest`), characters that are reserved in filesystem paths (such as `:`) are sanitised in the `<config-name>` segment — the agent's display name elsewhere is unchanged. Agents declared in the same configuration share this database by default; set an explicit `path` per toolset to isolate them. + +## Available Tools + +| Tool | Description | +| ----------------- | -------------------------------------------------------------------------------- | +| `add_memory` | Store a new memory with optional category | +| `get_memories` | Retrieve all stored memories | +| `delete_memory` | Delete a specific memory by ID | +| `search_memories` | Search memories by keywords and/or category (more efficient than `get_memories`) | +| `update_memory` | Update an existing memory's content and/or category by ID | + +## Configuration + +```yaml +toolsets: + - type: memory +``` + +### Options + +| Property | Type | Default | Description | +| -------- | ------ | ----------------------------------------- | -------------------------------- | +| `path` | string | `~/.cagent/memory/<config-name>/memory.db` | Path to the SQLite database file | + +### Custom Database Path + +```yaml +toolsets: + - type: memory + path: ./agent_memory.db +``` + +## Categories + +Memories support an optional `category` field for organization and filtering. Common categories include: + +- `preference` — User preferences and settings +- `fact` — Factual information about the project or user +- `project` — Project-specific context +- `decision` — Past decisions and their rationale + +> [!TIP] +> Memory is especially useful for long-running assistants that need to recall information across conversations — like coding preferences, project conventions, or context discovered during previous sessions. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/model-picker/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/model-picker/index.md new file mode 100644 index 000000000000..0c0d4613021c --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/model-picker/index.md @@ -0,0 +1,73 @@ +--- +title: "Model Picker Tool" +description: "Let the agent pick between several models per turn." +keywords: docker agent, ai agents, tools, toolsets, model picker tool +linkTitle: "Model Picker" +weight: 200 +canonical: https://docs.docker.com/ai/docker-agent/tools/model-picker/ +--- + +_Let the agent pick between several models per turn._ + +## Overview + +The model picker tool gives an agent the ability to dynamically choose which model to use for each turn of the conversation. This is useful when you want the agent to route different types of requests to different models — for example, using a fast, inexpensive model for simple queries and a more capable model for complex reasoning tasks. + +## Configuration + +```yaml +toolsets: + - type: model_picker + models: + - openai/gpt-5-mini + - anthropic/claude-sonnet-4-5 + - openai/gpt-5 +``` + +### Options + +| Property | Type | Required | Description | +| -------- | -------------- | -------- | ------------------------------------------------------------ | +| `models` | array[string] | ✓ | List of model references the agent can choose from. Use `provider/model` format. | + +## How It Works + +When the model picker toolset is enabled, the agent gets two tools: `change_model` to switch to one of the configured models, and `revert_model` to return to its default model. The agent decides which model to use based on the complexity of the task, cost considerations, or other factors you describe in its instruction. + +## Example + +```yaml +agents: + root: + model: openai/gpt-5-mini # Default model + instruction: | + You are a helpful assistant. For simple questions, use gpt-5-mini. + For complex reasoning or coding tasks, switch to claude-sonnet-4-5 or gpt-5. + toolsets: + - type: model_picker + models: + - openai/gpt-5-mini + - anthropic/claude-sonnet-4-5 + - openai/gpt-5 +``` + +> [!TIP] +> **Cost optimization** +> +> The model picker tool is particularly useful for cost optimization: let the agent use a cheap model by default and only escalate to expensive models when necessary. + +## Tool Interface + +The toolset exposes two tools: + +### `change_model` + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | --------------------------------------------------------------------------- | +| `model` | string | ✓ | The model to switch to. Must be one of the configured models. | + +### `revert_model` + +Takes no parameters. Reverts the agent to its original/default model. + +The switch takes effect immediately: the next inference call — including the remainder of the current agentic loop — uses the new model. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/open-url/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/open-url/index.md new file mode 100644 index 000000000000..b2a97dd44b36 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/open-url/index.md @@ -0,0 +1,95 @@ +--- +title: "Open URL Tool" +description: "Open a fixed URL in the user's default browser." +keywords: docker agent, ai agents, tools, toolsets, open url tool +linkTitle: "Open URL" +weight: 40 +canonical: https://docs.docker.com/ai/docker-agent/tools/open-url/ +--- + +_Open a fixed URL in the user's default browser._ + +## Overview + +The `open_url` toolset exposes a single, argument-less tool that opens a URL +baked into the toolset definition in the user's default browser. The model +never supplies the URL — it just calls the tool by name. Launching the browser +is cross-platform: Docker Agent uses `open` on macOS, `xdg-open` on Linux, and +`rundll32` on Windows. + +> [!NOTE] +> **When to Use** +> +> - Letting an agent open a dashboard, documentation page, or deep link on demand +> - Deep-linking into a desktop app via a custom URI scheme (e.g. `docker-desktop://`) +> - Any "take me there" action where the destination is fixed and known up front + +## Configuration + +```yaml +agents: + assistant: + model: openai/gpt-4o + description: Assistant that can open the dashboard + instruction: When the user asks to see the dashboard, call open_dashboard. + toolsets: + - type: open_url + name: open_dashboard + url: https://example.com/dashboard +``` + +## Properties + +| Property | Type | Required | Description | +| -------- | ------ | -------- | ---------------------------------------------------------------------------------------------------- | +| `url` | string | ✓ | URL to open. Supports `${env.VAR}` interpolation. Any scheme the OS can dispatch is allowed. | +| `name` | string | ✗ | Tool name the agent references. Defaults to `open_url`. Use a descriptive name when configuring several. | + +## Multiple URLs + +Add one toolset entry per destination, each with its own `name`: + +```yaml +toolsets: + - type: open_url + name: open_dashboard + url: https://example.com/dashboard + - type: open_url + name: open_docs + url: https://docs.example.com/${env.DOCS_VERSION} +``` + +## URL Interpolation + +The `url` field supports `${env.VAR}` placeholders, expanded at call time +against the runtime environment: + +```yaml +toolsets: + - type: open_url + name: open_docs + url: https://docs.example.com/${env.DOCS_VERSION} +``` + +## Custom URI Schemes + +Any scheme the operating system knows how to dispatch works, including deep +links into desktop applications: + +```yaml +toolsets: + - type: open_url + name: open_in_docker_desktop + url: docker-desktop://dashboard/apps +``` + +## Limitations + +- The URL must include a scheme (e.g. `https://`); bare paths are rejected. +- URLs that look like a command-line flag (starting with `-`) are refused to + prevent argument injection into the platform `open` helper. +- The tool opens the URL on the **host** running Docker Agent; in headless or + remote environments where no browser/launcher is available, the call fails + gracefully and reports the error to the agent. + +See [`examples/open_url.yaml`](https://github.com/docker/docker-agent/blob/main/examples/open_url.yaml) for a complete configuration. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/openapi/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/openapi/index.md new file mode 100644 index 000000000000..56c0c30561cc --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/openapi/index.md @@ -0,0 +1,83 @@ +--- +title: "OpenAPI Tool" +description: "Automatically generate tools from an OpenAPI specification." +keywords: docker agent, ai agents, tools, toolsets, openapi tool +linkTitle: "OpenAPI" +weight: 230 +canonical: https://docs.docker.com/ai/docker-agent/tools/openapi/ +--- + +_Automatically generate tools from an OpenAPI specification._ + +## Overview + +The OpenAPI tool fetches an OpenAPI 3.x specification from a URL and creates one tool per API operation. Each endpoint's parameters, request body, and description are translated into a callable tool that the agent can invoke directly. + +## Configuration + +```yaml +toolsets: + - type: openapi + url: "https://petstore3.swagger.io/api/v3/openapi.json" +``` + +### With custom headers + +Pass custom headers to every HTTP request made by the generated tools (for example, for authentication): + +```yaml +toolsets: + - type: openapi + url: "https://api.example.com/openapi.json" + headers: + Authorization: "Bearer ${env.API_TOKEN}" + X-Custom-Header: "my-value" +``` + +### Custom timeout + +Override the default 30-second HTTP timeout (applies both to fetching the spec and to the generated tool calls): + +```yaml +toolsets: + - type: openapi + url: "https://api.example.com/openapi.json" + timeout: 60 +``` + +### Reaching internal services + +By default the OpenAPI tool refuses connections to non-public IP addresses, blocking SSRF attempts even when DNS resolves an otherwise-public host to an internal range. Opt in with `allow_private_ips` when the spec or its `servers` entries legitimately target localhost or your internal network: + +```yaml +toolsets: + - type: openapi + url: "http://localhost:8080/openapi.json" + allow_private_ips: true +``` + +## Properties + +| Property | Type | Required | Description | +| ------------------- | ----------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `url` | string | ✓ | URL of the OpenAPI specification (JSON format). Supports `${env.VAR}` interpolation. | +| `headers` | map[string]string | ✗ | Custom HTTP headers sent with every request — both the spec fetch and every generated tool call. Values support `${env.VAR}` and `${headers.NAME}` placeholders (the latter forwards a header from the caller's incoming request when docker agent is exposed as a server). | +| `timeout` | int | ✗ | HTTP client timeout in seconds (default: `30`). Applies to both the spec fetch and the generated tools' requests. | +| `allow_private_ips` | boolean | ✗ | Opt in to dialling **non-public** IP addresses (loopback, RFC1918, link-local — including the cloud-metadata endpoint at `169.254.169.254` — multicast and the unspecified address). Set to `true` only when the spec or its servers legitimately target internal services. By default such addresses are refused at dial time, after DNS resolution, so DNS rebinding cannot bypass the check. | + +## How it works + +1. The spec is fetched from the configured `url` at startup. +2. Each operation (GET, POST, PUT, …) becomes a separate tool named after its `operationId` (or `method_path` when no `operationId` is set). +3. Path and query parameters are exposed as tool parameters. Request body properties are prefixed with `body_`. +4. Read-only operations (GET, HEAD, OPTIONS) are annotated accordingly. +5. Responses are returned as text; errors include the HTTP status code. + +## Limits + +- The OpenAPI spec must be **10 MB or less**. +- Individual API responses are truncated at **1 MB**. + +## Example + +See the full [Pet Store example](https://github.com/docker/docker-agent/blob/main/examples/openapi-petstore.yaml) for a working agent configuration. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/plan/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/plan/index.md new file mode 100644 index 000000000000..3f27b0198939 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/plan/index.md @@ -0,0 +1,166 @@ +--- +title: "Plan Tool" +description: "Shared persistent scratchpad for multi-agent collaboration." +keywords: docker agent, ai agents, tools, toolsets, plan tool +linkTitle: "Plan" +weight: 150 +canonical: https://docs.docker.com/ai/docker-agent/tools/plan/ +--- + +_Shared persistent scratchpad for multi-agent collaboration._ + +## Overview + +The plan tool gives agents a shared, persistent scratchpad of named documents. Any agent in a multi-agent config that loads the `plan` toolset can read and write the same plans, and those plans survive across sessions. This makes it straightforward to wire a planner agent that sketches work and one or more executor agents that consume it without any custom tool wiring. + +Plans are stored as JSON files in the Docker Agent data directory (`~/.cagent/plans/` by default). Agents that share a process serialize on a single mutex, and every write or delete additionally holds an advisory lock on a sentinel file in the plans directory, so writers in *separate* Docker Agent processes are serialized too: concurrent edits can never silently overwrite each other, and a stale revision always fails with a deterministic version conflict. Writes are atomic (temp file + rename), so a reader never observes partial content. + +## Configuration + +```yaml +toolsets: + - type: plan +``` + +No additional options are required. All agents that include `type: plan` in their toolsets share the same plans. + +## Available Tools + +| Tool | Description | +| ----------------------- | ------------------------------------------------------------------------------------------------- | +| `write_plan` | Create or update a shared plan by name. Replaces the entire plan content — read it first to preserve what you want to keep. Each write bumps the revision number. | +| `read_plan` | Read a shared plan by name, including its title, content, author, status, revision number, and last-updated timestamp. | +| `list_plans` | List all shared plans with their name, title, author, status, revision, and last-updated timestamp. | +| `delete_plan` | Delete a shared plan by name. | +| `update_plan_from_file` | Create or update a plan, taking the new content from a file on disk instead of inline. Use it with `export_plan_to_file` to edit a large plan without re-sending its whole body. | +| `export_plan_to_file` | Write a plan's content to a file. The content goes to disk and is **not** returned as tool output, so materialising a plan costs no tokens. | +| `set_plan_status` | Set a plan's free-form status without rewriting its body. The plan must already exist. | +| `get_plan_status` | Read a plan's status and current revision without fetching its body. | + +### Cheap edits with file-based revisions + +Re-sending a whole plan on every revision is expensive. The file-based tools let +an agent edit a plan without paying input-token cost for its body: + +1. `export_plan_to_file` writes the current plan content to a path. The content + is written to disk and is **not** returned. +2. The agent edits that file in place with its filesystem tools. +3. `update_plan_from_file` commits the file's new contents as the next revision. + +### Free-form status + +Each plan carries a free-form `status` string. There is no fixed vocabulary: +define your own in the system prompt (e.g. `idle`, `in-progress`, `blocked`, +`done`, `canceled`). Read and write it independently of the body with +`get_plan_status` and `set_plan_status`, or pass `status` to `write_plan` and +`update_plan_from_file`. The TUI surfaces the status next to the plan title. + +### Optimistic locking + +When several sessions edit the same plan, concurrent writes could silently +overwrite each other. Every read returns a `revision` number; pass the value you +last read as `last_known_revision` to `write_plan`, `update_plan_from_file`, +`set_plan_status`, or `delete_plan`. If the plan changed since (its current +revision no longer matches), the write is rejected with a version-conflict +error and the caller should re-read the plan and retry. The revision check and +the write happen under the storage's cross-process file lock, so the conflict +is detected reliably even when the competing writer runs in a different Docker +Agent process. Omit `last_known_revision` to write unconditionally (last +writer wins). + +### Plan Names + +Plan names must match the pattern `[a-z0-9][a-z0-9_-]*` (lowercase letters, digits, `-`, `_`). This is enforced structurally so two different inputs can never collapse onto the same file and path-traversal is impossible by construction. + +### Plan Fields + +Each plan document contains: + +| Field | Description | +| ---------- | --------------------------------------------------------- | +| `name` | The plan's unique slug name | +| `title` | A short human-readable title (optional) | +| `content` | The full Markdown or free-form plan text | +| `author` | Free-form label identifying who last wrote the plan | +| `status` | Free-form lifecycle label (optional), e.g. `in-progress` | +| `revision` | Monotonically increasing version counter, bumped on every write | +| `updatedAt`| ISO 8601 timestamp of the last write | + +## Example + +Two agents collaborate on a shared plan — the architect drafts it and the builder refines it: + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Coordinator + instruction: | + Route work between the architect and the builder. + handoffs: [architect, builder] + + architect: + model: anthropic/claude-sonnet-4-5 + description: Drafts high-level plans + instruction: | + Use list_plans and read_plan to inspect existing plans, then write_plan + to create or revise one. Always read before writing. When done, hand off + to the builder. + toolsets: + - type: plan + handoffs: [builder] + + builder: + model: openai/gpt-4o + description: Adds implementation steps to plans + instruction: | + Read the architect's plan with read_plan, then use write_plan to append + concrete implementation steps. Always read before writing. When done, + hand off back to root. + toolsets: + - type: plan + handoffs: [root] +``` + +See [`examples/shared_plan.yaml`](https://github.com/docker/docker-agent/blob/main/examples/shared_plan.yaml) for a complete working example. + +## Error Handling + +- `read_plan` returns a distinct "not found" error when a plan does not exist, as opposed to any other I/O error, so callers can tell "plan missing" from "plan unreadable." +- `list_plans` skips corrupt entries but reports them in a `warnings` field so an agent can detect and recover from a bad state (e.g., by calling `delete_plan`). +- `delete_plan` can remove a corrupt plan to recover from a bad state. + +## Managing plans from the host + +Shared plans can also be inspected and managed outside a session with the [`docker agent plans`](../../features/cli/index.md#docker-agent-plans) command group: list, get, create, update, set status, export, and delete — with the same optimistic-locking semantics as the tools (`--expected-version` guards a write and a stale version fails with exit code 3; `--force` writes unconditionally). Session plans (the per-session "draft, review, execute" plan) can be listed, read, and exported through the same commands but stay owned by their session and cannot be mutated from the host. + +```bash +$ docker agent plans list +$ docker agent plans get release > plan.md +$ docker agent plans update release --file ./plan.md --expected-version 1 +``` + +### The `/plans` browser in the TUI + +Inside the full-screen TUI, the `/plans` slash command (also in the <kbd>Ctrl</kbd>+<kbd>K</kbd> command palette) opens a plan browser over the same store the agents use, so changes made by agents mid-session appear immediately. The list shows every shared plan plus the current session's [session plan](../session_plan/index.md), with each plan's scope, identity (name, or session ID for the session plan), status, version (`-` for the unversioned session plan), last update time, and title. + +Keybindings: + +| Key | Action | +| --- | ------ | +| <kbd>↑</kbd>/<kbd>↓</kbd>, mouse | Navigate; <kbd>Enter</kbd> or double-click opens a detail view with the full metadata and scrollable markdown content | +| <kbd>/</kbd> | Filter by name, title, status, or scope (<kbd>Esc</kbd> leaves filter mode) | +| <kbd>r</kbd> | Refresh from storage | +| <kbd>x</kbd> | Export the selected plan to `<name>.md` (shared) or `session-plan-<short-id>.md` (session) in the session's working directory. An existing file is never overwritten — the export fails with a notification instead | +| <kbd>s</kbd> | Set a shared plan's free-form status via a small input dialog | +| <kbd>e</kbd> | Edit a shared plan's content in `$VISUAL`/`$EDITOR` | +| <kbd>n</kbd> | Create a new shared plan: pick a name, then draft the content in `$VISUAL`/`$EDITOR` (an empty draft aborts) | +| <kbd>d</kbd> | Delete a shared plan after a confirmation that names the plan and its version | +| <kbd>Esc</kbd> | Close the detail view / the browser | + +Every mutation is guarded by the version shown on screen (the same optimistic locking as `last_known_revision`): if an agent changed the plan in the meantime, the write is rejected, a notification reports the current version, the newer content is left intact and re-read into the browser, and an edit draft is kept in a temp file so nothing is lost. Session plans are read-only here — status, edit, and delete report why instead of attempting the write. The browser also refreshes live when agents in the same process write, re-status, or delete plans (and when this session's agent updates its session plan); in the lean TUI, which has no overlays, `/plans` is unavailable. + +> [!TIP] +> **Plan vs. Todo vs. Tasks** +> +> Use **plan** for shared, free-form documents that multiple agents collaborate on (design docs, requirements, work items). Use [todo](../todo/index.md) for lightweight in-session task lists. Use [tasks](../tasks/index.md) for a structured, persistent task database with priorities and dependencies. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/rag/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/rag/index.md new file mode 100644 index 000000000000..0aa77a99350f --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/rag/index.md @@ -0,0 +1,267 @@ +--- +title: "RAG Tool" +description: "Give your agents access to document knowledge bases with background indexing, multiple retrieval strategies, and hybrid search." +keywords: docker agent, ai agents, tools, toolsets, rag tool +linkTitle: "RAG" +weight: 110 +canonical: https://docs.docker.com/ai/docker-agent/tools/rag/ +aliases: + - /ai/docker-agent/rag/ +--- + +_Give your agents access to document knowledge bases with background indexing, multiple retrieval strategies, and hybrid search._ + +## Overview + +The `rag` toolset lets agents search through your documents to find relevant information before responding. Knowledge bases are declared once at the top of the config under `rag:` and then referenced from any agent via `type: rag, ref: <name>`. Docker Agent supports: + +- **Background indexing** — Files are indexed automatically and re-indexed on change +- **Multiple strategies** — Semantic embeddings, BM25 keyword search, and LLM-enhanced search +- **Hybrid search** — Combine strategies with result fusion for best results +- **Reranking** — Re-score results with specialized models for improved relevance + +RAG is the strategy to reach for when a document collection is too large to inline directly, or gets queried repeatedly across turns/sessions — see [Choosing a Large-Input Strategy](../../guides/headless/index.md#choosing-a-large-input-strategy) for how it compares to `@`/`/attach` attachments and prompt files. + +## Quick Start + +```yaml +rag: + my_docs: + tool: + description: "Technical documentation" + docs: [./documents, ./some-doc.md] + strategies: + - type: chunked-embeddings + embedding_model: openai/text-embedding-3-small + database: ./docs.db + vector_dimensions: 1536 + +agents: + root: + model: openai/gpt-4o + instruction: | + You have access to a knowledge base. Use it to answer questions. + toolsets: + - type: rag + ref: my_docs +``` + +## Retrieval Strategies + +### Chunked Embeddings (Semantic Search) + +Uses embedding models to find semantically similar content. Best for understanding intent, synonyms, and paraphrasing. + +```yaml +strategies: + - type: chunked-embeddings + embedding_model: openai/text-embedding-3-small + database: ./vector.db + vector_dimensions: 1536 + similarity_metric: cosine_similarity + threshold: 0.5 + limit: 10 + embedding_batch_size: 50 + chunking: + size: 1000 + overlap: 100 +``` + +### Semantic Embeddings (LLM-Enhanced) + +Uses an LLM to generate semantic summaries of each chunk before embedding, capturing meaning and intent. Best for code search and understanding implementations. + +```yaml +strategies: + - type: semantic-embeddings + embedding_model: openai/text-embedding-3-small + vector_dimensions: 1536 + chat_model: openai/gpt-4o-mini + database: ./semantic.db + ast_context: true # include AST metadata + chunking: + size: 1000 + code_aware: true # AST-aware chunking +``` + +> [!NOTE] +> **Trade-offs** +> +> Semantic embeddings provide higher quality retrieval but slower indexing (LLM call per chunk) and additional API costs. + +### BM25 (Keyword Search) + +Traditional keyword matching using the BM25 algorithm. Best for exact terms, technical jargon, and code identifiers. + +```yaml +strategies: + - type: bm25 + database: ./bm25.db + k1: 1.5 # term frequency saturation + b: 0.75 # length normalization + threshold: 0.3 + limit: 10 + chunking: + size: 1000 + overlap: 100 +``` + +## Hybrid Search + +Combine multiple strategies for best results. Strategies run in parallel and results are fused together: + +```yaml +rag: + hybrid: + docs: [./docs] + strategies: + - type: chunked-embeddings + embedding_model: openai/text-embedding-3-small + database: ./vector.db + vector_dimensions: 1536 + limit: 20 + chunking: { size: 1000, overlap: 100 } + - type: bm25 + database: ./bm25.db + limit: 15 + chunking: { size: 1000, overlap: 100 } + results: + fusion: + strategy: rrf # Reciprocal Rank Fusion + k: 60 + deduplicate: true + limit: 5 +``` + +## Fusion Strategies + +| Strategy | Best For | Description | +| ---------- | --------------------------------- | ------------------------------------------------------------------ | +| `rrf` | General use (recommended) | Reciprocal Rank Fusion — rank-based, no score normalization needed | +| `weighted` | Known performance characteristics | Weight strategies differently (e.g., embeddings: 0.7, BM25: 0.3) | +| `max` | Same scoring scale | Takes the maximum score from any strategy | + +## Reranking + +Re-score retrieved documents with a specialized model to improve relevance: + +```yaml +results: + reranking: + model: openai/gpt-4o-mini + top_k: 10 # only rerank top 10 + threshold: 0.3 # minimum score after reranking + criteria: | + Prioritize official documentation over blog posts. + Prefer recent information and practical examples. + limit: 5 +``` + +Supported reranking providers: **DMR** (native `/rerank` endpoint), **OpenAI**, **Anthropic**, **Gemini**. + +## Code-Aware Chunking + +For source code, enable AST-based chunking to keep functions and methods intact: + +```yaml +chunking: + size: 2000 + code_aware: true # Uses tree-sitter for AST-based chunking +``` + +> [!NOTE] +> **Language Support** +> +> Currently supports Go (`.go`) files. More languages will be added. Falls back to plain text chunking for unsupported file types. + +## Debugging RAG + +Enable debug logging to see retrieval details: + +```bash +$ docker agent run config.yaml --debug --log-file debug.log +``` + +Look for log tags: `[RAG Manager]`, `[Chunked-Embeddings Strategy]`, `[BM25 Strategy]`, `[RRF Fusion]`, `[Reranker]`. + +**Permanent model errors abort early.** If the embedding model, semantic-LLM model, or reranking model returns a permanent error (HTTP 400, 401, 404, or 429 — invalid config, bad auth, unknown model, or rate limit), Docker Agent treats the model configuration as invalid and stops immediately rather than retrying doomed requests: + +- **Indexing** — the entire indexing run is aborted after the first permanent failure (including 429). The error is surfaced in the logs so you know immediately if a model name or API key is wrong, rather than silently producing incomplete results. +- **Reranking** — a permanent error (including 429) permanently disables the reranker for the lifetime of the manager. Subsequent queries fall back to un-reranked results. Only transient errors (5xx, timeouts) fall back and retry on the next query. + +> [!TIP] +> **Examples** +> +> See the [RAG examples](https://github.com/docker/docker-agent/tree/main/examples/rag) in the GitHub repo for complete, runnable configurations. + +## Configuration Reference + +### Top-Level RAG Fields + +| Field | Type | Default | Description | +| ------------- | -------- | ------- | -------------------------------------------------------------- | +| `docs` | []string | — | Document paths/directories (shared across strategies) | +| `description` | string | — | Human-readable description of this RAG source | +| `respect_vcs` | boolean | `true` | Respect `.gitignore` files when indexing documents | +| `strategies` | []object | — | Array of retrieval strategy configurations | +| `results` | object | — | Post-processing: fusion, reranking, deduplication, final limit | + +### Chunked-Embeddings Strategy + +| Field | Type | Default | Description | +| --------------------------- | ------ | ------------------- | ------------------------------------------------------------ | +| `embedding_model` | string | — | **Required.** Embedding model reference | +| `database` | string | — | Path to local SQLite database | +| `vector_dimensions` | int | — | Embedding dimensions (e.g., 1536 for text-embedding-3-small) | +| `similarity_metric` | string | `cosine_similarity` | Similarity metric | +| `threshold` | float | `0.5` | Minimum similarity score (0–1) | +| `limit` | int | `5` | Max results from this strategy | +| `embedding_batch_size` | int | `50` | Chunks per embedding request | +| `max_embedding_concurrency` | int | `3` | Max concurrent embedding requests | +| `chunking.size` | int | `1500` | Chunk size in characters (`4000` when `code_aware` is set) | +| `chunking.overlap` | int | `75` | Overlap between chunks in characters | +| `chunking.code_aware` | bool | `false` | AST-based chunking (Go files only) | + +### Semantic-Embeddings Strategy + +| Field | Type | Default | Description | +| -------------------------- | ------ | ---------- | ------------------------------------------------------------------ | +| `embedding_model` | string | — | **Required.** Embedding model reference | +| `chat_model` | string | — | **Required.** LLM for generating semantic summaries | +| `vector_dimensions` | int | — | **Required.** Embedding dimensions | +| `database` | string | — | Path to local SQLite database | +| `semantic_prompt` | string | (built-in) | Custom prompt template (`${path}`, `${content}`, `${ast_context}`) | +| `ast_context` | bool | `false` | Include tree-sitter AST metadata in prompts | +| `threshold` | float | `0.5` | Minimum similarity score (0–1) | +| `limit` | int | `5` | Max results | +| `max_indexing_concurrency` | int | `3` | Max concurrent file indexing | +| `chunking.size` | int | `1500` | Chunk size in characters (`4000` when `code_aware` is set) | +| `chunking.overlap` | int | `75` | Overlap between chunks | +| `chunking.code_aware` | bool | `false` | AST-based chunking | + +### BM25 Strategy + +| Field | Type | Default | Description | +| ------------------ | ------ | ------- | ----------------------------------------------- | +| `database` | string | — | Path to local SQLite database | +| `k1` | float | `1.5` | Term frequency saturation (1.2–2.0 recommended) | +| `b` | float | `0.75` | Length normalization (0–1) | +| `threshold` | float | `0.0` | Minimum BM25 score | +| `limit` | int | `5` | Max results | +| `chunking.size` | int | `1500` | Chunk size in characters | +| `chunking.overlap` | int | `75` | Overlap between chunks | + +### Results (Post-Processing) + +| Field | Type | Default | Description | +| --------------------- | ------ | ------- | ----------------------------------------------------------- | +| `fusion.strategy` | string | `rrf` | Fusion method: `rrf`, `weighted`, or `max` | +| `fusion.k` | int | `60` | RRF rank constant | +| `deduplicate` | bool | `true` | Remove duplicate results | +| `limit` | int | `15` | Final number of results | +| `include_score` | bool | `false` | Include relevance scores in results | +| `return_full_content` | bool | `false` | Return full document content instead of just matched chunks | +| `reranking.model` | string | — | Reranking model reference | +| `reranking.top_k` | int | (`limit`) | Only rerank top K results. Defaults to the results `limit` when set. | +| `reranking.threshold` | float | `0.5` | Minimum relevance score after reranking | +| `reranking.criteria` | string | — | Custom relevance guidance for the reranking model | diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/scheduler/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/scheduler/index.md new file mode 100644 index 000000000000..16635f7f77f2 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/scheduler/index.md @@ -0,0 +1,96 @@ +--- +title: "Scheduler Tool" +description: "Schedule instructions to run at a time or on a recurring interval." +keywords: docker agent, ai agents, tools, toolsets, scheduler tool, cron +linkTitle: "Scheduler" +weight: 135 +canonical: https://docs.docker.com/ai/docker-agent/tools/scheduler/ +--- + +_Schedule instructions to run at a time or on a recurring interval._ + +## Overview + +The scheduler toolset lets an agent make something happen at a chosen time or on a repeating cadence during a session. You give it an instruction and a schedule; when the schedule is due, the instruction is delivered back to the agent, which then carries out the action with its normal tools (`shell`, `api`, `fetch`, and so on). + +The scheduler does not run shell or API calls itself. When a schedule fires it injects the instruction into the agent loop via the runtime's recall mechanism — the same primitive [`background_jobs`](../background-jobs/index.md) uses to report completed work — and the agent decides how to act. This keeps every action under the agent's normal tools and permissions rather than adding a second, unattended +command runner. + +> [!NOTE] +> Schedules only fire while the session is running (interactive TUI or a server mode) and are not persisted across restarts. Scheduling requires a host that supports recall; if it does not, `create_schedule` returns an error. + +## Configuration + +```yaml +toolsets: + - type: scheduler +``` + +No configuration options. + +## Tools + +| Tool | Description | +| --- | --- | +| `create_schedule` | Register an instruction to run at a time or interval. | +| `list_schedules` | List active schedules with their id, spec, and next fire time. | +| `cancel_schedule` | Remove a schedule by id. | + +### `create_schedule` + +| Parameter | Required | Description | +| --- | --- | --- | +| `prompt` | Yes | The instruction to deliver to the agent when the schedule fires. | +| `when` | Yes | When to fire (see [Schedule specs](#schedule-specs)). | +| `name` | No | Optional human-readable label. | + +Returns the new schedule's id and its next fire time. + +### `cancel_schedule` + +| Parameter | Required | Description | +| --- | --- | --- | +| `id` | Yes | The id of the schedule to cancel (from `create_schedule` or `list_schedules`). | + +## Schedule specs + +The `when` argument accepts: + +| Form | Meaning | Example | +| --- | --- | --- | +| `in:<duration>` | One-shot, after a delay | `in:10m` | +| `at:<RFC3339>` | One-shot, at an absolute future time | `at:2026-07-14T09:00:00Z` | +| `every:<duration>` | Recurring, at a fixed interval | `every:1h` | +| `minutely` / `hourly` / `daily` / `weekly` | Recurring preset intervals | `hourly` | + +Durations use Go's duration syntax (`30s`, `15m`, `2h`). Preset and `every:` intervals are measured from the schedule's creation time (for example `hourly` fires every hour after it is created), not aligned to wall-clock slots. + +> [!IMPORTANT] +> **Recurring schedules have a one-minute minimum.** Every fire injects a message into the agent loop and typically costs an LLM turn, so `every:` values below `1m` are rejected — a typo such as `every:1s` in place of `every:1h` would otherwise become a runaway token burn. One-shot schedules (`in:` / `at:`) are not restricted, since they fire once. + +## Example + +```yaml +agents: + root: + model: openai/gpt-5-mini + description: A monitoring assistant + instruction: | + Every 15 minutes, run `git fetch` and tell me if origin/main moved. + toolsets: + - type: scheduler + - type: shell +``` + +The agent calls: + +```text +create_schedule(prompt="Run git fetch and report if origin/main moved", when="every:15m") +``` + +Every 15 minutes it is reminded, runs the command with the `shell` tool, and reports back. + +> [!TIP] +> **When to use** +> +> Use the scheduler for recurring monitoring, timed one-shots, and unattended housekeeping loops during a long-running session. For work that should run immediately and be awaited, use [`background_jobs`](../background-jobs/index.md) instead. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/script/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/script/index.md new file mode 100644 index 000000000000..b4f912705517 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/script/index.md @@ -0,0 +1,64 @@ +--- +title: "Script Tool" +description: "Define custom shell scripts as named tools with typed parameters." +keywords: docker agent, ai agents, tools, toolsets, script tool +linkTitle: "Script" +weight: 30 +canonical: https://docs.docker.com/ai/docker-agent/tools/script/ +--- + +_Define custom shell scripts as named tools with typed parameters._ + +## Overview + +The script tool lets you define custom shell scripts as named tools. Unlike the generic [shell tool](../shell/index.md) where the agent writes the command, script tools execute predefined commands — ideal for exposing safe, well-scoped operations with descriptive names. + +## Configuration + +### Simple Scripts + +```yaml +toolsets: + - type: script + shell: + run_tests: + cmd: task test + description: Run the project test suite + lint: + cmd: task lint + description: Run the linter +``` + +### Scripts with Parameters + +Use `${param}` interpolation and JSON Schema to define typed arguments: + +```yaml +toolsets: + - type: script + shell: + deploy: + cmd: ./scripts/deploy.sh ${env} + description: Deploy to an environment + args: + env: + type: string + enum: [staging, production] + required: [env] +``` + +## Properties + +| Property | Type | Description | +| --------------------------------- | ------ | ---------------------------------------------------------- | +| `shell.<name>.cmd` | string | Shell command to execute (supports `${arg}` interpolation) | +| `shell.<name>.description` | string | Description shown to the model | +| `shell.<name>.args` | object | Parameter definitions (JSON Schema properties) | +| `shell.<name>.required` | array | Required parameter names | +| `shell.<name>.env` | object | Environment variables for this script | +| `shell.<name>.working_dir` | string | Working directory for script execution | + +> [!TIP] +> **Script vs. Shell** +> +> Use the [shell tool](../shell/index.md) when the agent needs to run arbitrary commands. Use the script tool when you want to expose specific, predefined operations with clear names and typed parameters — giving the agent less freedom but more safety. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/session_context/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/session_context/index.md new file mode 100644 index 000000000000..9f241bb551db --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/session_context/index.md @@ -0,0 +1,67 @@ +--- +title: "Session Context Tool" +description: "Reference a previous session as context in the current one." +keywords: docker agent, ai agents, tools, toolsets, session context tool +linkTitle: "Session Context" +weight: 210 +canonical: https://docs.docker.com/ai/docker-agent/tools/session_context/ +--- + +_Reference a previous session as context, without manual export/import._ + +## Overview + +The `session_context` toolset lets an agent discover earlier sessions and pull one in as context for the current session. It removes the manual workaround of exporting a conversation to HTML and re-attaching it with an `@` mention. + +The tool surface is two read-only tools: + +| Tool | Description | +| --------------- | ------------------------------------------------------------------------------------------------------------ | +| `list_sessions` | List previous sessions (most recent first) with id, title, creation time and message count. | +| `read_session` | Return the transcript of a previous session, by id or by a relative reference like `-1`. | + +The session the agent is currently running in is never listed by `list_sessions` and cannot be read by `read_session` (a circular reference returns an error). + +## Configuration + +```yaml +toolsets: + - type: session_context +``` + +No configuration options. Both tools are read-only and operate against the same session store the runtime already uses for persistence. + +Restrict the toolset to a subset of tools the standard way: + +```yaml +# An agent that may browse but never pull a full transcript into context. +toolsets: + - type: session_context + tools: + - list_sessions +``` + +## Selecting a session + +`read_session` accepts either form: + +- A concrete id returned by `list_sessions`, e.g. `read_session("a1b2c3...")`. +- A relative reference: `-1` is the most recent session, `-2` the second most recent, and so on. Relative references resolve against the same ordering `list_sessions` uses (most recent first), excluding sub-sessions. + +## Transcript size + +A long session could overflow the current context window, so `read_session` caps the rendered transcript. When a transcript is larger than the budget, the oldest messages are dropped (the most recent are usually the most useful for continuing work) and a note records how many were omitted: + +```text +[12 earlier message(s) omitted to fit the context budget; showing the most recent 8] +``` + +## Notes + +- `list_sessions` defaults to 20 sessions and is capped at 100; pass `limit` to request fewer. +- `read_session` returns an error when the session is not found, when the reference cannot be resolved, or when it points at the current session. +- Both tools are read-only: they never modify, branch, or delete sessions. + +## Example + +See [`examples/session_context.yaml`](https://github.com/docker/docker-agent/blob/main/examples/session_context.yaml) for a complete working example. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/session_plan/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/session_plan/index.md new file mode 100644 index 000000000000..ea4c8e4970f0 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/session_plan/index.md @@ -0,0 +1,134 @@ +--- +title: "Session Plan Tool" +description: "Per-session plan tracker for the draft, review, execute workflow." +keywords: docker agent, ai agents, tools, toolsets, session plan tool +linkTitle: "Session Plan" +weight: 160 +canonical: https://docs.docker.com/ai/docker-agent/tools/session_plan/ +--- + +_Per-session plan tracker for the "draft, review, execute" workflow._ + +## Overview + +The `session_plan` toolset gives one agent a place to write a plan for the current session, signal that the plan is ready, and let the host route the next turn to an executing agent. + +Different from the [`plan` toolset](../plan/index.md) — `plan` is for shared, named plans multiple agents collaborate on over many sessions. `session_plan` is for one ephemeral plan per session, scoped to that session by ID. + +Plans live as Markdown files under: + +```text +~/.cagent/session_plans/<session-id>.md +``` + +The tool surface is three tools: + +| Tool | Description | +| -------------------- | ---------------------------------------------------------------------------------------------------- | +| `write_session_plan` | Create or replace this session's plan as markdown. There's exactly one plan per session. | +| `read_session_plan` | Read the plan written for the current session and return it as markdown. | +| `exit_plan_mode` | Signal that the plan is ready for review. Does not switch agents on its own. | + +## Configuration + +```yaml +toolsets: + - type: session_plan +``` + +No configuration options. The plan path is derived from the session ID; the agent does not name plans. + +Restrict the toolset to a subset of tools the standard way: + +```yaml +# An agent that consumes a plan but should not be able to (re)write or finalize one. +toolsets: + - type: session_plan + tools: + - read_session_plan +``` + +## When to call exit_plan_mode + +Call `exit_plan_mode` once the plan is complete and you do not intend to change it on the next turn. It validates that a plan exists for the session and returns a "ready for review" tool result. It does **not** switch agents or solicit user approval on its own — the host application owns the next-turn routing (for example, by reading the tool result, by a UI affordance the user toggles, or by a `handoff` declared on the agent). + +This separation keeps the tool reusable across UIs: a CLI that prints tool results inline, a chat UI with a plan-mode toggle, and a server that auto-routes the next turn through a `handoff` can all consume the same signal without one stepping on another. + +## Storage and cleanup + +- Plans are markdown files written atomically (temp + rename), so concurrent readers — in this process or another — never observe a partial write. +- A best-effort sweep on first use of the toolset removes plan files older than 30 days under the plans directory. Stranded plans for long-gone sessions do not accumulate. +- The session ID identifies the file directly. There is no in-process mutex or revision counter, because two sessions cannot map to the same path. + +## Events + +A `session_plan_updated` event is emitted whenever `write_session_plan` succeeds: + +```json +{ + "type": "session_plan_updated", + "session_id": "...", + "path": "/Users/.../.cagent/session_plans/<session-id>.md", + "content": "# my plan\n...", + "agent_name": "planner" +} +``` + +Embedders that render the plan inline can subscribe and update without re-reading the file. + +## Managing session plans from the host + +A session plan belongs to its session: hosts can read and export it, never change it. + +- **CLI** — the [`docker agent plans`](../../features/cli/index.md#docker-agent-plans) command group lists, reads (`get --session <session-id>`), and exports session plans alongside shared plans. Mutations (`update`, `status`, `delete`) are refused with an `unsupported` error explaining the ownership rule. +- **TUI** — the `/plans` browser (see the [plan toolset docs](../plan/index.md#the-plans-browser-in-the-tui) for the full keybinding table) includes the **current session's** plan as the `session` scope row; plans of other sessions are never enumerated. Its identity is the session ID and its version column shows `-` — session plans have no versions. <kbd>Enter</kbd> opens the detail view (scope, session ID, update time, scrollable markdown) and <kbd>x</kbd> exports to `session-plan-<short-id>.md` in the working directory (refusing to overwrite an existing file). <kbd>e</kbd> opens the plan body in your external editor (`$VISUAL` or `$EDITOR`) for editing — the write is unguarded and last-write-wins by design. Status and delete visibly report that session plans don't support them (session plans belong to their session and carry no shared-plan metadata). The browser refreshes live on the `session_plan_updated` event, so a plan the agent just wrote appears without reopening. + +## Example + +A two-agent workflow: `root` executes, `planner` plans. `/plan` hands off to the planner; `exit_plan_mode` signals "ready", and the host decides what happens next. + +```yaml +agents: + root: + model: anthropic/claude-sonnet-4-5 + description: Executes approved plans + instruction: | + You execute plans the planner has handed off. When you see a message + that a plan has been approved, read it with read_session_plan and work + through its steps in order. + toolsets: + - type: session_plan + tools: + - read_session_plan + - type: filesystem + - type: shell + commands: + plan: + description: "Switch to the planner" + agent: planner + + planner: + model: anthropic/claude-sonnet-4-5 + description: Investigates and writes plans for review + instruction: | + Investigate the user's request, then write the plan with + write_session_plan. Iterate with the user until the plan is complete, + then call exit_plan_mode to mark it ready for review. + toolsets: + - type: session_plan + - type: filesystem + readonly: true + - type: user_prompt +``` + +See [`examples/session_plan.yaml`](https://github.com/docker/docker-agent/blob/main/examples/session_plan.yaml) for a complete working example. + +## Error Handling + +- `read_session_plan` and `exit_plan_mode` return a "no plan written yet" error when called before `write_session_plan`. +- `write_session_plan` validates the session ID and refuses to write anything that could escape the plans directory; in practice the runtime generates UUIDs so this only triggers if an embedder supplies a hand-crafted ID. + +> [!TIP] +> **session_plan vs. plan vs. todo vs. tasks** +> +> Use **session_plan** when one agent drafts an approach for the user to review before another agent executes it (ephemeral, one per session). Use [plan](../plan/index.md) for shared, named plans multiple agents collaborate on over many sessions. Use [todo](../todo/index.md) for lightweight in-session task lists. Use [tasks](../tasks/index.md) for a structured, persistent task database with priorities and dependencies. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/shell/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/shell/index.md new file mode 100644 index 000000000000..5da9fc8f8233 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/shell/index.md @@ -0,0 +1,117 @@ +--- +title: "Shell Tool" +description: "Execute arbitrary shell commands in the user's environment." +keywords: docker agent, ai agents, tools, toolsets, shell tool +linkTitle: "Shell" +weight: 20 +canonical: https://docs.docker.com/ai/docker-agent/tools/shell/ +--- + +_Execute arbitrary shell commands in the user's environment._ + +## Overview + +The shell tool allows agents to execute arbitrary shell commands synchronously. This is one of the most powerful tools — it lets agents run builds, install dependencies, query APIs, and interact with the system. Each call runs in a fresh, isolated shell session — no state persists between calls. + +Commands have a default 30-second timeout and require user confirmation unless `--yolo` is used. For servers, watchers, and other long-running commands, add the [`background_jobs`](../background-jobs/index.md) toolset alongside `shell`. + +### Shell interpreter detection + +The shell tool automatically detects and names the resolved shell interpreter (e.g., `bash`, `zsh`, `powershell`, `pwsh`, `cmd`) in its description to the model, along with the operating system (Linux, macOS, Windows). This helps models use the correct shell syntax for the host environment. + +For example: + +- On Linux with bash: "Executes the given shell command with bash on Linux." +- On Windows with PowerShell: "Executes the given shell command with powershell on Windows. Use Windows PowerShell 5.1 syntax: chain commands with ";" (not "&&"), and avoid POSIX commands/flags like "ls -la"." + +This reduces wasted turns where models assume POSIX syntax on Windows or vice versa. + +## Configuration + +```yaml +toolsets: + - type: shell +``` + +### Options + +| Property | Type | Description | +| -------------- | ------- | --------------------------------------------------------------------------------------------------- | +| `env` | object | Environment variables to set for all shell commands | +| `safer` | boolean | Deprecated and ignored — shell commands are always classified now (see [Command classification](#command-classification)). Kept so existing YAMLs still parse. | +| `sudo_askpass` | boolean | Opt in to prompting for a `sudo` password (see [Sudo support](#sudo-support)). Default `false`. | + +### Custom Environment Variables + +```yaml +toolsets: + - type: shell + env: + MY_VAR: "value" + PATH: "${env.PATH}:/custom/bin" +``` + +### Command classification + +Every shell command is classified against an embedded taxonomy before the approval decision — no opt-in required: + +- **Destructive matches** (`rm -rf <path>`, `docker volume rm`, `mkfs`, `dd if=… of=/dev/<disk>`, …) are labelled `destructive` with a `blast_radius` (`low` / `medium` / `high`) and a `category` tag. The TUI confirmation dialog renders the blast radius with a color badge. +- **Known-safe reads** (`ls`, `cat`, `git status`, `git diff`, `docker ps`, `docker logs`, `kubectl get`, …) are labelled `safe`. +- **Everything else** is labelled `unknown`. + +The session's [safety mode](../../configuration/permissions/index.md#safety-modes) decides what each label means: `strict` asks about everything, `balanced` auto-runs safe commands and asks about destructive/unknown ones, `restricted` auto-runs safe commands and denies destructive/unknown ones without asking (fail-closed for unattended runs), `autonomous` runs everything. Custom permission rules always win over the mode. + +Compound shell (`a && b`, `a; b`, `a | b`) is never matched against the safe allowlist; any destructive segment falls through to ask. The full taxonomy lives in [`pkg/safety/safety_patterns.json`](https://github.com/docker/docker-agent/blob/main/pkg/safety/safety_patterns.json). + +See [`examples/safety_modes.yaml`](https://github.com/docker/docker-agent/blob/main/examples/safety_modes.yaml) for a full example. The legacy `safer: true` toolset flag is deprecated and ignored. + +### Sudo support + +By default a shell command has no controlling terminal, so a `sudo` command that needs a password hangs until it times out (the agent usually gives up and falls back to printing manual instructions). + +Set `sudo_askpass: true` to enable a sudo privilege escalation flow: + +```yaml +toolsets: + - type: shell + sudo_askpass: true +``` + +When enabled, `sudo` commands prompt you for your password through the host UI (the input is masked). The password is handed to `sudo` over a private, per-session socket via the standard `SUDO_ASKPASS` mechanism — it is never written to the command line, the logs, or stored by the agent. + +The bridge environment variables (`SUDO_ASKPASS`, `CAGENT_ASKPASS_SOCKET`, `CAGENT_ASKPASS_TOKEN`) are added only to commands that invoke `sudo`, but within such a command they are visible to every child process, not just `sudo`. They carry a socket path and a session token, not the password; the socket lives in a `0700` directory, so only your own user can reach it. + +Notes and limitations: + +- Unix only. The flag has no effect on Windows. +- Interactive UI only. In headless / non-interactive runs the prompt is declined automatically and `sudo` fails as before. +- Only a bare `sudo ...` invocation in a POSIX shell (`sh`, `bash`, `zsh`, ...) is handled. `sudo` called by absolute path (`/usr/bin/sudo`), via `env sudo`, from inside a nested script, or under a non-POSIX shell (e.g. `fish`) is not intercepted and behaves as before. +- Caching is `sudo`'s own. Because each shell tool call runs in a fresh shell with no controlling terminal, `sudo`'s credential cache does not persist across separate tool calls: you are prompted once per shell command that uses `sudo`. Within a single command, multiple `sudo` calls (e.g. `sudo a && sudo b`) usually share one prompt, subject to `sudo`'s own timestamp configuration. +- The prompt must be answered within the command's timeout; raise the `timeout` parameter for `sudo` commands that may wait on input. +- Prompts are serialized: if a single command runs two `sudo` calls in parallel (e.g. `sudo a & sudo b`), the second waits for the first prompt to be answered rather than opening two dialogs at once. + +## Available Tools + +The shell toolset exposes one tool: + +| Tool Name | Description | +| --------- | ---------------------------------------------------------------------------- | +| `shell` | Run a command synchronously and return its combined output when it finishes. | + +### `shell` parameters + +| Parameter | Type | Required | Description | +| --------- | ------- | -------- | ------------------------------------------------------------------------- | +| `cmd` | string | ✓ | The shell command to execute. | +| `cwd` | string | ✗ | Working directory to run the command in (default: `.`). | +| `timeout` | integer | ✗ | Per-call execution timeout in seconds (default: `30`). | + +> [!WARNING] +> **Safety** +> +> The shell tool gives agents full access to the system shell. Always set `max_iterations` on agents that use the shell tool to prevent infinite loops. A value of 20–50 is typical for development agents. Use [Sandbox Mode](../../configuration/sandbox/index.md) for additional isolation. + +> [!NOTE] +> **Tool Confirmation** +> +> By default, Docker Agent asks for user confirmation before executing shell commands. Use `--yolo` to auto-approve all tool calls. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/tasks/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/tasks/index.md new file mode 100644 index 000000000000..9d399f96958b --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/tasks/index.md @@ -0,0 +1,59 @@ +--- +title: "Tasks Tool" +description: "Persistent task database with priorities and dependencies, shared across sessions." +keywords: docker agent, ai agents, tools, toolsets, tasks tool +linkTitle: "Tasks" +weight: 180 +canonical: https://docs.docker.com/ai/docker-agent/tools/tasks/ +--- + +_Persistent task database with priorities and dependencies, shared across sessions._ + +## Overview + +The tasks tool provides a persistent task database that survives across agent sessions. Unlike the [Todo tool](../todo/index.md), which maintains an in-memory task list for the current session only, the tasks tool stores tasks in a JSON file on disk so they can be accessed and updated across multiple sessions. Tasks support priorities and dependencies — a task is _blocked_ until every task it depends on is `done`. + +## Configuration + +```yaml +toolsets: + - type: tasks + path: ./tasks.json # Optional: custom database path +``` + +### Options + +| Property | Type | Default | Description | +| -------- | ------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `path` | string | `tasks.json` | Path to the JSON task database. Relative paths resolve against the agent config directory (or `--working-dir` when set). | + +## Available Tools + +The tasks toolset exposes these tools: + +| Tool Name | Description | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `create_task` | Create a new task with a title, description (or markdown file path), optional priority, and optional dependencies. | +| `get_task` | Get full details of a single task by ID, including its effective status (`blocked` if any dependency is not `done`). | +| `update_task` | Update a task's title, description, priority, status, or dependency list. | +| `delete_task` | Delete a task by ID. Also removes it from other tasks' dependency lists. | +| `list_tasks` | List tasks sorted by priority (critical first) with blocked tasks last. Optionally filter by status or priority. | +| `next_task` | Return the highest-priority actionable task — one that is not blocked and not done. Great for "what should I work on?". | +| `add_dependency` | Add a dependency: a task is blocked until the task it depends on is `done`. | +| `remove_dependency` | Remove a dependency from a task. | + +## Example + +```yaml +agents: + root: + model: openai/gpt-4o + toolsets: + - type: tasks + path: ./project-tasks.json +``` + +> [!TIP] +> **Tasks vs. Todo** +> +> Use the **tasks** tool when you need persistence across sessions, priorities, or dependencies (e.g., long-running projects, recurring work). Use the [todo tool](../todo/index.md) for ephemeral, session-scoped task lists. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/think/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/think/index.md new file mode 100644 index 000000000000..24873fcacfe3 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/think/index.md @@ -0,0 +1,30 @@ +--- +title: "Think Tool" +description: "Step-by-step reasoning scratchpad for planning and decision-making." +keywords: docker agent, ai agents, tools, toolsets, think tool +linkTitle: "Think" +weight: 140 +canonical: https://docs.docker.com/ai/docker-agent/tools/think/ +--- + +_Step-by-step reasoning scratchpad for planning and decision-making._ + +## Overview + +The think tool is a reasoning scratchpad that lets agents think step-by-step before acting. The agent can write its thoughts without producing visible output to the user — ideal for planning complex tasks, breaking down problems, and reasoning through multi-step solutions. + +This is a lightweight tool with no side effects. It is most useful for models that lack built-in reasoning or thinking capabilities (e.g., smaller or older models). For models that already support native thinking — such as Claude with extended thinking, OpenAI o-series, or Gemini with a thinking budget — this tool is unnecessary since the model can reason internally. + +## Configuration + +```yaml +toolsets: + - type: think +``` + +No configuration options. + +> [!TIP] +> **When to use** +> +> Use the think tool with models that don't have native reasoning capabilities. If your model already supports a [thinking budget](../../configuration/models/index.md#thinking-budget), you likely don't need this tool. diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/todo/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/todo/index.md new file mode 100644 index 000000000000..7f2154379cce --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/todo/index.md @@ -0,0 +1,54 @@ +--- +title: "Todo Tool" +description: "Task list management for complex multi-step workflows." +keywords: docker agent, ai agents, tools, toolsets, todo tool +linkTitle: "Todo" +weight: 170 +canonical: https://docs.docker.com/ai/docker-agent/tools/todo/ +--- + +_Task list management for complex multi-step workflows._ + +## Overview + +The todo tool provides task list management. Agents can create, update, list, and track progress on tasks with status tracking (pending, in-progress, completed). Useful for complex multi-step workflows where the agent needs to stay organized and ensure all steps are completed. + +## Available Tools + +| Tool | Description | +| -------------- | ---------------------------------------- | +| `create_todo` | Create a new task | +| `create_todos` | Create multiple tasks at once | +| `update_todos` | Update status of one or more tasks | +| `list_todos` | List all current tasks with their status | + +### Task Statuses + +| Status | Description | +| ------------- | ---------------------------- | +| `pending` | Task has not been started | +| `in-progress` | Task is currently being done | +| `completed` | Task is finished | + +## Configuration + +```yaml +toolsets: + - type: todo +``` + +### Options + +| Property | Type | Default | Description | +| -------- | ------- | ------- | ----------------------------------------------------------------------- | +| `shared` | boolean | `false` | When `true`, todos are shared across all agents in a multi-agent config | + +### Shared Todos + +In multi-agent setups, enable shared todos so all agents can see and update the same task list: + +```yaml +toolsets: + - type: todo + shared: true +``` diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/transfer-task/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/transfer-task/index.md new file mode 100644 index 000000000000..9d3bc2a03a07 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/transfer-task/index.md @@ -0,0 +1,73 @@ +--- +title: "Transfer Task Tool" +description: "Delegate tasks to sub-agents in multi-agent setups." +keywords: docker agent, ai agents, tools, toolsets, transfer task tool +linkTitle: "Transfer Task" +weight: 80 +canonical: https://docs.docker.com/ai/docker-agent/tools/transfer-task/ +--- + +_Delegate tasks to sub-agents in multi-agent setups._ + +## Overview + +The `transfer_task` tool allows an agent to delegate tasks to specialized sub-agents and receive their results. This is the core mechanism for multi-agent orchestration. + +**You don't need to add it manually** — it's automatically available when an agent has `sub_agents` configured. + +## Configuration + +The tool is enabled implicitly when `sub_agents` is set: + +```yaml +agents: + coordinator: + model: openai/gpt-4o + description: Coordinates work across specialists + instruction: Analyze requests and delegate to the right specialist. + sub_agents: [developer, researcher] + + developer: + model: anthropic/claude-sonnet-4-5 + description: Expert software developer + instruction: Write clean, production-ready code. + toolsets: + - type: filesystem + - type: shell + + researcher: + model: openai/gpt-4o + description: Web researcher + instruction: Search for information online. + toolsets: + - type: mcp + ref: docker:duckduckgo +``` + +The coordinator agent automatically gets a `transfer_task` tool that can delegate to `developer` or `researcher`. + +## Tool Interface + +The `transfer_task` tool takes three parameters: + +| Parameter | Type | Required | Description | +| ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------- | +| `agent` | string | ✓ | Name of the sub-agent to delegate to. Must be listed under the caller's `sub_agents`. | +| `task` | string | ✓ | Clear, concise description of the task the sub-agent should achieve. | +| `expected_output` | string | ✓ | Description of the result/format the caller expects back. | + +The call blocks until the sub-agent returns its result, which becomes the tool's response. For non-blocking parallel delegation, use [`background_agents`](../background-agents/index.md) instead. + +## Delegation Limits + +Sub-agents can have `sub_agents` of their own, so multi-level delegation chains are supported. Two runtime guards keep chains sane, applied to both `transfer_task` and `run_background_agent`: + +- **Cycles are rejected.** A delegation targeting an agent that is already part of the active delegation chain (for example `a -> b -> a`) fails with an error naming the cycle. +- **Depth is capped at 10 nested delegations.** The root agent delegating to its first sub-agent counts as depth 1; a call that would exceed the cap fails with an error stating the attempted depth. + +A rejected delegation returns a tool error to the calling agent and never starts the sub-agent. + +> [!TIP] +> **See also** +> +> For parallel task delegation, see [Background Agents](../background-agents/index.md). For multi-agent patterns, see [Multi-Agent](../../concepts/multi-agent/index.md). diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/user-prompt/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/user-prompt/index.md new file mode 100644 index 000000000000..739892c93750 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/user-prompt/index.md @@ -0,0 +1,186 @@ +--- +title: "User Prompt Tool" +description: "Ask the user questions and collect interactive input during agent execution." +keywords: docker agent, ai agents, tools, toolsets, user prompt tool +linkTitle: "User Prompt" +weight: 190 +canonical: https://docs.docker.com/ai/docker-agent/tools/user-prompt/ +--- + +_Ask the user questions and collect interactive input during agent execution._ + +## Overview + +The user prompt tool allows agents to ask questions and collect input from users during execution. This enables interactive workflows where the agent needs clarification, confirmation, or additional information before proceeding. + +> [!NOTE] +> **When to Use** +> +> - When the agent needs clarification before proceeding +> - Collecting credentials or configuration values +> - Presenting choices and getting user decisions +> - Confirming destructive or important actions + +## Configuration + +```yaml +agents: + assistant: + model: openai/gpt-4o + description: Interactive assistant + instruction: | + You are a helpful assistant. When you need information + from the user, use the user_prompt tool to ask them. + toolsets: + - type: user_prompt + - type: filesystem + - type: shell +``` + +## Tool Interface + +The `user_prompt` tool takes these parameters: + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------------------------------------------------------------------------------------- | +| `message` | string | ✓ | The question or prompt to display. | +| `title` | string | ✗ | Optional title for the dialog window in the TUI. Defaults to `"Question"` when not provided. | +| `schema` | object | ✗ | JSON Schema defining the expected response structure (object or primitive). | + +## Response Format + +The tool returns a JSON response: + +```json +{ + "action": "accept", + "content": { + "field1": "user value", + "field2": true + } +} +``` + +### Action Values + +| Action | Meaning | +| --------- | ------------------------------------------ | +| `accept` | User provided a response (check `content`) | +| `decline` | User declined to answer | +| `cancel` | User cancelled the prompt | + +## Schema Examples + +### Simple String Input + +```json +{ + "type": "string", + "title": "API Key", + "description": "Enter your API key" +} +``` + +### Multiple Choice + +```json +{ + "type": "string", + "enum": ["development", "staging", "production"], + "title": "Environment", + "description": "Select the target environment" +} +``` + +### Boolean Confirmation + +```json +{ + "type": "boolean", + "title": "Confirm", + "description": "Are you sure you want to proceed?" +} +``` + +### Object with Multiple Fields + +```json +{ + "type": "object", + "properties": { + "username": { + "type": "string", + "description": "Your username" + }, + "password": { + "type": "string", + "description": "Your password" + }, + "remember": { + "type": "boolean", + "description": "Remember credentials" + } + }, + "required": ["username", "password"] +} +``` + +### Number Input + +```json +{ + "type": "integer", + "title": "Port Number", + "description": "Enter the port number (1024-65535)", + "minimum": 1024, + "maximum": 65535 +} +``` + +## Example Usage + +Here's how an agent might use the user prompt tool: + +```text +Agent: I need to deploy this application. Let me ask which environment to target. + +[Calls user_prompt with message: "Which environment should I deploy to?" + and schema with enum: ["development", "staging", "production"]] + +User selects: "staging" + +Agent: Great, I'll deploy to staging. Let me confirm this action. + +[Calls user_prompt with message: "Deploy to staging? This will replace the current version." + and schema with type: "boolean"] + +User confirms: true + +Agent: Deploying to staging... +``` + +## UI Presentation + +How the prompt appears depends on the interface: + +- **TUI**: Displays an interactive dialog with appropriate input controls +- **CLI (exec mode)**: Prints the prompt and reads from stdin +- **API/MCP**: Returns an elicitation request to the client + +> [!TIP] +> **Best Practice** +> +> Provide clear, concise messages. Include context about why you're asking and what the information will be used for. Use schemas with descriptions to guide users on expected input format. + +## Handling Responses + +The agent should handle all possible actions: + +- **accept**: Process the `content` and continue +- **decline**: Acknowledge and try an alternative approach or explain what's needed +- **cancel**: Stop the current operation gracefully + +> [!WARNING] +> **Context Requirement** +> +> The user prompt tool requires an elicitation handler to be configured. It works in the TUI and CLI modes but may not be available in all contexts (e.g., some MCP client configurations). diff --git a/_vendor/github.com/docker/docker-agent/docs/tools/webhook/index.md b/_vendor/github.com/docker/docker-agent/docs/tools/webhook/index.md new file mode 100644 index 000000000000..ded710754192 --- /dev/null +++ b/_vendor/github.com/docker/docker-agent/docs/tools/webhook/index.md @@ -0,0 +1,143 @@ +--- +title: "Webhook Tool" +description: "Reliable outbound notifications to Slack, Discord, Telegram, IFTTT, and more." +keywords: docker agent, ai agents, tools, toolsets, webhook, slack, discord, telegram, ifttt, notifications +linkTitle: "Webhook" +weight: 145 +canonical: https://docs.docker.com/ai/docker-agent/tools/webhook/ +--- + +_Reliable outbound notifications to Slack, Discord, Telegram, IFTTT, and more._ + +## Overview + +The webhook toolset delivers a notification to a destination **you configure**. The +agent supplies only the message text: it never sees or chooses the URL, because a +webhook URL is itself a credential (Slack and Mattermost embed a secret path, +Discord a token, IFTTT a key, Telegram a bot token). + +This is not a general HTTP client — that is the [`api`](../api/index.md) toolset. +The webhook toolset owns *delivery*: + +- **At-least-once delivery.** Transient failures (`429`, `5xx`, network errors) are + retried with exponential backoff, honouring the server's `Retry-After`. A `4xx` + is permanent and fails immediately without wasting retries. +- **Non-blocking.** The call returns as soon as the notification is queued, so a + slow or retrying endpoint never stalls the agent's turn. The agent is messaged + back **only if delivery ultimately fails**. +- **Storm protection.** An identical message to the same destination inside a short + window is suppressed, and notifications are rate limited, so a looping agent + cannot flood a channel. +- **Provider-shaped payloads.** Each service's wire format is applied for you. + +## Configuration + +The destination lives in `webhook_config`. Use `${env.VAR}` for anything secret — +values are expanded at call time and never stored in the config file. + +```yaml +toolsets: + - type: webhook + webhook_config: + provider: slack + url: ${env.SLACK_WEBHOOK_URL} +``` + +| Field | Required | Description | +| --- | --- | --- | +| `url` | Yes | Webhook endpoint. Usually embeds a secret — prefer `${env.VAR}`. | +| `provider` | No | Payload shape (default `generic`). | +| `headers` | No | Extra headers, for endpoints authenticating with a token. | +| `chat_id` | No | Destination chat — required for `provider: telegram`. | + +`timeout` on the toolset (seconds) overrides the per-request HTTP timeout. + +## Providers + +| Provider | Payload sent | Where the secret lives | +| --- | --- | --- | +| `slack`, `mattermost`, `rocketchat`, `googlechat`, `teams`, `generic` | `{"text": message}` | secret webhook URL | +| `discord` | `{"content": message}` | token in the webhook URL | +| `ifttt` | `{"value1": message, "value2": …, "value3": …}` | key in the webhook URL | +| `telegram` | `{"chat_id": …, "text": message}` | bot token in the URL, plus `chat_id` | + +Aliases are accepted: `msteams`/`microsoft_teams` → `teams`, `google_chat`/`gchat` +→ `googlechat`, `rocket.chat` → `rocketchat`. + +### Per-service examples + +```yaml +# Slack / Mattermost / Rocket.Chat — the URL is the credential +toolsets: + - type: webhook + webhook_config: + provider: slack + url: ${env.SLACK_WEBHOOK_URL} +``` + +```yaml +# Discord — the token is part of the webhook URL +toolsets: + - type: webhook + webhook_config: + provider: discord + url: ${env.DISCORD_WEBHOOK_URL} +``` + +```yaml +# Telegram — bot token in the URL, chat_id selects the destination chat +toolsets: + - type: webhook + webhook_config: + provider: telegram + url: https://api.telegram.org/bot${env.TELEGRAM_BOT_TOKEN}/sendMessage + chat_id: "123456789" +``` + +```yaml +# IFTTT — the key is part of the trigger URL +toolsets: + - type: webhook + webhook_config: + provider: ifttt + url: https://maker.ifttt.com/trigger/build_failed/with/key/${env.IFTTT_KEY} +``` + +```yaml +# Generic endpoint authenticating with a bearer token +toolsets: + - type: webhook + webhook_config: + provider: generic + url: https://alerts.example.com/notify + headers: + Authorization: Bearer ${env.ALERTS_TOKEN} +``` + +## `send_webhook` + +| Parameter | Required | Description | +| --- | --- | --- | +| `message` | Yes | The message text to deliver. | +| `value2`, `value3` | No | Extra IFTTT data fields (`provider: ifttt`). | + +Returns immediately once queued. On success nothing further happens; if delivery +ultimately fails, the agent receives a message saying so. + +## Example + +```yaml +agents: + root: + model: openai/gpt-5-mini + instruction: If a check fails, notify the team with send_webhook. + toolsets: + - type: webhook + webhook_config: + provider: slack + url: ${env.SLACK_WEBHOOK_URL} +``` + +> [!NOTE] +> Requests to non-public addresses are refused (the SSRF-safe HTTP client), and the +> configured URL is never echoed back to the model or into error messages. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model.yaml new file mode 100644 index 000000000000..6d1588f6f05c --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model.yaml @@ -0,0 +1,74 @@ +command: docker model +short: Docker Model Runner +long: |- + Use Docker Model Runner to run and interact with AI models directly from the command line. + For more information, see the [documentation](/ai/model-runner/) +pname: docker +plink: docker.yaml +cname: + - docker model bench + - docker model context + - docker model df + - docker model gateway + - docker model inspect + - docker model install-runner + - docker model launch + - docker model list + - docker model logs + - docker model package + - docker model ps + - docker model pull + - docker model purge + - docker model push + - docker model reinstall-runner + - docker model requests + - docker model restart-runner + - docker model rm + - docker model run + - docker model search + - docker model show + - docker model skills + - docker model start-runner + - docker model status + - docker model stop-runner + - docker model tag + - docker model uninstall-runner + - docker model unload + - docker model version +clink: + - docker_model_bench.yaml + - docker_model_context.yaml + - docker_model_df.yaml + - docker_model_gateway.yaml + - docker_model_inspect.yaml + - docker_model_install-runner.yaml + - docker_model_launch.yaml + - docker_model_list.yaml + - docker_model_logs.yaml + - docker_model_package.yaml + - docker_model_ps.yaml + - docker_model_pull.yaml + - docker_model_purge.yaml + - docker_model_push.yaml + - docker_model_reinstall-runner.yaml + - docker_model_requests.yaml + - docker_model_restart-runner.yaml + - docker_model_rm.yaml + - docker_model_run.yaml + - docker_model_search.yaml + - docker_model_show.yaml + - docker_model_skills.yaml + - docker_model_start-runner.yaml + - docker_model_status.yaml + - docker_model_stop-runner.yaml + - docker_model_tag.yaml + - docker_model_uninstall-runner.yaml + - docker_model_unload.yaml + - docker_model_version.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_bench.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_bench.yaml new file mode 100644 index 000000000000..65071532f5fe --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_bench.yaml @@ -0,0 +1,69 @@ +command: docker model bench +short: Benchmark a model's performance at different concurrency levels +long: |- + Benchmark a model's performance showing tokens per second at different concurrency levels. + + This command runs a series of benchmarks with 1, 2, 4, and 8 concurrent requests by default, + measuring the tokens per second (TPS) that the model can generate. +usage: docker model bench MODEL +pname: docker model +plink: docker_model.yaml +options: + - option: concurrency + value_type: intSlice + default_value: '[1,2,4,8]' + description: Concurrency levels to test + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: duration + value_type: duration + default_value: 30s + description: Duration to run each concurrency test + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: json + value_type: bool + default_value: "false" + description: Output results in JSON format + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: prompt + value_type: string + default_value: | + Write a comprehensive 100 word summary on whales and their impact on society. + description: Prompt to use for benchmarking + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: timeout + value_type: duration + default_value: 5m0s + description: Timeout for each individual request + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose.yaml new file mode 100644 index 000000000000..4ed9874c0f10 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose.yaml @@ -0,0 +1,28 @@ +command: docker model compose +pname: docker model +plink: docker_model.yaml +cname: + - docker model compose down + - docker model compose metadata + - docker model compose up +clink: + - docker_model_compose_down.yaml + - docker_model_compose_metadata.yaml + - docker_model_compose_up.yaml +options: + - option: project-name + value_type: string + description: compose project name + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_down.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_down.yaml new file mode 100644 index 000000000000..39ff0baf59ee --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_down.yaml @@ -0,0 +1,21 @@ +command: docker model compose down +usage: docker model compose down +pname: docker model compose +plink: docker_model_compose.yaml +inherited_options: + - option: project-name + value_type: string + description: compose project name + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_metadata.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_metadata.yaml new file mode 100644 index 000000000000..d618dcc588a6 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_metadata.yaml @@ -0,0 +1,23 @@ +command: docker model compose metadata +short: Metadata for Docker Compose +long: Metadata for Docker Compose +usage: docker model compose metadata +pname: docker model compose +plink: docker_model_compose.yaml +inherited_options: + - option: project-name + value_type: string + description: compose project name + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_up.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_up.yaml new file mode 100644 index 000000000000..17e91577948c --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_compose_up.yaml @@ -0,0 +1,90 @@ +command: docker model compose up +usage: docker model compose up +pname: docker model compose +plink: docker_model_compose.yaml +options: + - option: backend + value_type: string + default_value: llama.cpp + description: inference backend to use + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: context-size + value_type: int64 + default_value: "-1" + description: context size for the model + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: model + value_type: stringArray + default_value: '[]' + description: model to use + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: runtime-flags + value_type: string + description: raw runtime flags to pass to the inference engine + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-draft-model + value_type: string + description: draft model for speculative decoding + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-min-acceptance-rate + value_type: float64 + default_value: "0" + description: minimum acceptance rate for speculative decoding + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-num-tokens + value_type: int + default_value: "0" + description: number of tokens to predict speculatively + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: + - option: project-name + value_type: string + description: compose project name + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure.yaml new file mode 100644 index 000000000000..77f914fdcf6a --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure.yaml @@ -0,0 +1,105 @@ +command: docker model configure +aliases: docker model configure, docker model config +short: Manage model runtime configurations +long: Manage model runtime configurations +usage: docker model configure [--context-size=<n>] [--speculative-draft-model=<model>] [--hf_overrides=<json>] [--gpu-memory-utilization=<float>] [--mode=<mode>] [--think] [--keep-alive=<duration>] MODEL [-- <runtime-flags...>] +pname: docker model +plink: docker_model.yaml +cname: + - docker model configure show +clink: + - docker_model_configure_show.yaml +options: + - option: context-size + value_type: int32 + description: context size (in tokens) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gpu-memory-utilization + value_type: float64 + description: | + fraction of GPU memory to use for the model executor (0.0-1.0) - vLLM only + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: hf_overrides + value_type: string + description: HuggingFace model config overrides (JSON) - vLLM only + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: keep-alive + value_type: string + description: | + duration to keep model loaded (e.g., '5m', '1h', '0' to unload immediately, '-1' to never unload) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: mode + value_type: string + description: | + backend operation mode (completion, embedding, reranking, image-generation) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-draft-model + value_type: string + description: draft model for speculative decoding + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-min-acceptance-rate + value_type: float64 + default_value: "0" + description: minimum acceptance rate for speculative decoding + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: speculative-num-tokens + value_type: int + default_value: "0" + description: number of tokens to predict speculatively + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: think + value_type: bool + description: enable reasoning mode for thinking models + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure_show.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure_show.yaml new file mode 100644 index 000000000000..588c5c1b3e8f --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_configure_show.yaml @@ -0,0 +1,13 @@ +command: docker model configure show +short: Show model configurations +long: Show model configurations +usage: docker model configure show [MODEL] +pname: docker model configure +plink: docker_model_configure.yaml +deprecated: false +hidden: true +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context.yaml new file mode 100644 index 000000000000..05a532ba7272 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context.yaml @@ -0,0 +1,24 @@ +command: docker model context +short: Manage Docker Model Runner contexts +long: Manage Docker Model Runner contexts +pname: docker model +plink: docker_model.yaml +cname: + - docker model context create + - docker model context inspect + - docker model context ls + - docker model context rm + - docker model context use +clink: + - docker_model_context_create.yaml + - docker_model_context_inspect.yaml + - docker_model_context_ls.yaml + - docker_model_context_rm.yaml + - docker_model_context_use.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_create.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_create.yaml new file mode 100644 index 000000000000..47e5bb49db1d --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_create.yaml @@ -0,0 +1,61 @@ +command: docker model context create +short: Create a named Model Runner context +long: Create a named Model Runner context +usage: docker model context create NAME +pname: docker model context +plink: docker_model_context.yaml +options: + - option: description + value_type: string + description: Optional human-readable description for this context + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + description: Model Runner API base URL (e.g. http://192.168.1.100:12434) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls + value_type: bool + default_value: "false" + description: Enable TLS for connections to this context + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-ca-cert + value_type: string + description: Path to a custom CA certificate PEM file for TLS verification + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-skip-verify + value_type: bool + default_value: "false" + description: Skip TLS server certificate verification + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_inspect.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_inspect.yaml new file mode 100644 index 000000000000..82c897dd3874 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_inspect.yaml @@ -0,0 +1,13 @@ +command: docker model context inspect +short: Display detailed information about one or more contexts +long: Display detailed information about one or more contexts +usage: docker model context inspect NAME [NAME...] +pname: docker model context +plink: docker_model_context.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_ls.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_ls.yaml new file mode 100644 index 000000000000..cf97594f1df3 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_ls.yaml @@ -0,0 +1,14 @@ +command: docker model context ls +aliases: docker model context ls, docker model context list +short: List Model Runner contexts +long: List Model Runner contexts +usage: docker model context ls +pname: docker model context +plink: docker_model_context.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_rm.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_rm.yaml new file mode 100644 index 000000000000..2efa303bb1b0 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_rm.yaml @@ -0,0 +1,14 @@ +command: docker model context rm +aliases: docker model context rm, docker model context remove +short: Remove one or more Model Runner contexts +long: Remove one or more Model Runner contexts +usage: docker model context rm NAME [NAME...] +pname: docker model context +plink: docker_model_context.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_use.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_use.yaml new file mode 100644 index 000000000000..720281626cfe --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_context_use.yaml @@ -0,0 +1,15 @@ +command: docker model context use +short: Set the active Model Runner context +long: |- + Set the active Model Runner context. Pass "default" to revert to + automatic backend detection. +usage: docker model context use NAME +pname: docker model context +plink: docker_model_context.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_df.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_df.yaml new file mode 100644 index 000000000000..7f1ba55b875d --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_df.yaml @@ -0,0 +1,13 @@ +command: docker model df +short: Show Docker Model Runner disk usage +long: Show Docker Model Runner disk usage +usage: docker model df +pname: docker model +plink: docker_model.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_gateway.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_gateway.yaml new file mode 100644 index 000000000000..b6cf57a39bdc --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_gateway.yaml @@ -0,0 +1,182 @@ +command: docker model gateway +short: Run an OpenAI-compatible LLM gateway +long: |- + `docker model gateway` starts a local OpenAI-compatible HTTP gateway that routes + requests to one or more configured LLM providers. It supports Docker Model Runner + as a first-class provider, alongside Ollama, OpenAI, Anthropic, Groq, Mistral, + Azure OpenAI, and many other OpenAI-compatible endpoints. + + The gateway is configured through a YAML file that declares the model list, + provider routing, load-balancing, retries, and fallbacks. + + ### Configuration file format + + ```yaml + model_list: + - model_name: <alias exposed to clients> + params: + model: <provider>/<upstream-model-name> + api_base: <optional base URL override> + api_key: <optional key or os.environ/VAR_NAME> + + general_settings: + master_key: <optional API key required by clients> + num_retries: <optional integer, default 0> + fallbacks: + - <primary-alias>: [<fallback-alias>, ...] + ``` + + The `model` field under `params` uses the format `provider/model-name`. + Supported provider prefixes include: `docker_model_runner`, `openai`, + `anthropic`, `ollama`, `groq`, `mistral`, `together_ai`, `deepseek`, + `fireworks_ai`, `openrouter`, `perplexity`, `xai`, `nvidia_nim`, + `cerebras`, `sambanova`, `deepinfra`, `azure`, `azure_ai`, `vllm`, + `lm_studio`, `huggingface`. + + API keys can be supplied inline, as `os.environ/VAR_NAME` references, or as + `${VAR_NAME}` references. The gateway resolves well-known environment variables + automatically (for example, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`). +usage: docker model gateway +pname: docker model +plink: docker_model.yaml +options: + - option: config + shorthand: c + value_type: string + description: Path to the YAML configuration file + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + default_value: 0.0.0.0 + description: Host address to bind to + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + shorthand: p + value_type: uint16 + default_value: "4000" + description: Port to listen on + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: verbose + shorthand: v + value_type: bool + default_value: "false" + description: Enable verbose (debug) logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Route requests to Docker Model Runner + + ```yaml + model_list: + - model_name: smollm2 + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 + ``` + + ```console + $ docker model gateway --config config.yaml + ``` + + The gateway starts on `http://0.0.0.0:4000`. Send requests using any + OpenAI-compatible client: + + ```console + $ curl http://localhost:4000/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "smollm2", + "messages": [{"role": "user", "content": "Hello"}] + }' + ``` + + ### Route requests to multiple providers with fallback + + ```yaml + model_list: + - model_name: fast + params: + model: groq/llama-3.1-8b-instant + api_key: os.environ/GROQ_API_KEY + - model_name: smart + params: + model: openai/gpt-4o + api_key: os.environ/OPENAI_API_KEY + - model_name: local + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 + + general_settings: + num_retries: 2 + fallbacks: + - fast: [local] + - smart: [fast, local] + ``` + + ```console + $ docker model gateway --config config.yaml --port 8080 + ``` + + ### Secure the gateway with an API key + + ```yaml + model_list: + - model_name: smollm2 + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 + + general_settings: + master_key: os.environ/GATEWAY_API_KEY + ``` + + ```console + $ GATEWAY_API_KEY=my-secret docker model gateway --config config.yaml + ``` + + Clients must then pass the key as a Bearer token or via the `x-api-key` header: + + ```console + $ curl http://localhost:4000/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{"model": "smollm2", "messages": [{"role": "user", "content": "Hi"}]}' + ``` + + ### Use a custom host and port + + ```console + $ docker model gateway --config config.yaml --host 127.0.0.1 --port 9000 + ``` + + ### Enable debug logging + + ```console + $ docker model gateway --config config.yaml --verbose + ``` +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_inspect.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_inspect.yaml new file mode 100644 index 000000000000..c422f0210389 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_inspect.yaml @@ -0,0 +1,35 @@ +command: docker model inspect +short: Display detailed information on one model +long: Display detailed information on one model +usage: docker model inspect MODEL +pname: docker model +plink: docker_model.yaml +options: + - option: openai + value_type: bool + default_value: "false" + description: List model in an OpenAI format + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: remote + shorthand: r + value_type: bool + default_value: "false" + description: Show info for remote models + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_install-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_install-runner.yaml new file mode 100644 index 000000000000..562fd6bbfbff --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_install-runner.yaml @@ -0,0 +1,123 @@ +command: docker model install-runner +short: Install Docker Model Runner (Docker Engine only) +long: | + This command runs implicitly when a docker model command is executed. You can run this command explicitly to add a new configuration. +usage: docker model install-runner +pname: docker model +plink: docker_model.yaml +options: + - option: backend + value_type: string + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: debug + value_type: bool + default_value: "false" + description: Enable debug logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: do-not-track + value_type: bool + default_value: "false" + description: Do not track models usage in Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gpu + value_type: string + default_value: auto + description: Specify GPU support (none|auto|cuda|rocm|musa|cann) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + default_value: 127.0.0.1 + description: Host address to bind Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + value_type: uint16 + default_value: "0" + description: | + Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: proxy-cert + value_type: string + description: Path to a CA certificate file for proxy SSL inspection + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls + value_type: bool + default_value: "false" + description: Enable TLS/HTTPS for Docker Model Runner API + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-cert + value_type: string + description: Path to TLS certificate file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-key + value_type: string + description: Path to TLS private key file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-port + value_type: uint16 + default_value: "0" + description: | + TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_launch.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_launch.yaml new file mode 100644 index 000000000000..58f074ee0237 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_launch.yaml @@ -0,0 +1,84 @@ +command: docker model launch +short: Launch an app configured to use Docker Model Runner +long: |- + Launch an app configured to use Docker Model Runner. + + Without arguments, lists all supported apps. + + Supported apps: anythingllm, claude, codex, openclaw, opencode, openwebui + + Examples: + docker model launch + docker model launch opencode + docker model launch claude -- --help + docker model launch openwebui --port 3000 + docker model launch claude --config +usage: docker model launch [APP] [-- APP_ARGS...] +pname: docker model +plink: docker_model.yaml +options: + - option: config + value_type: bool + default_value: "false" + description: Print configuration without launching + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: detach + value_type: bool + default_value: "false" + description: Run containerized app in background + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: dry-run + value_type: bool + default_value: "false" + description: Print what would be executed without running it + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: image + value_type: string + description: Override container image for containerized apps + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: model + value_type: string + description: Model to use (for opencode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + value_type: int + default_value: "0" + description: Host port to expose (web UIs) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_list.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_list.yaml new file mode 100644 index 000000000000..242462f4c145 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_list.yaml @@ -0,0 +1,55 @@ +command: docker model list +aliases: docker model list, docker model ls +short: List the models pulled to your local environment +long: List the models pulled to your local environment +usage: docker model list [OPTIONS] [MODEL] +pname: docker model +plink: docker_model.yaml +options: + - option: json + value_type: bool + default_value: "false" + description: List models in a JSON format + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: openai + value_type: bool + default_value: "false" + description: List models in an OpenAI format + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: openaiurl + value_type: string + description: OpenAI-compatible API endpoint URL to list models from + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show model IDs + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_logs.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_logs.yaml new file mode 100644 index 000000000000..4f5daf177fe8 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_logs.yaml @@ -0,0 +1,35 @@ +command: docker model logs +short: Fetch the Docker Model Runner logs +long: Fetch the Docker Model Runner logs +usage: docker model logs [OPTIONS] +pname: docker model +plink: docker_model.yaml +options: + - option: follow + shorthand: f + value_type: bool + default_value: "false" + description: View logs with real-time streaming + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: no-engines + value_type: bool + default_value: "false" + description: Exclude inference engine logs from the output + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_package.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_package.yaml new file mode 100644 index 000000000000..7bc696c5b7ca --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_package.yaml @@ -0,0 +1,149 @@ +command: docker model package +short: Package a model into a Docker Model OCI artifact +long: |- + Package a model into a Docker Model OCI artifact. + + The model source must be one of: + --gguf A GGUF file (single file or first shard of a sharded model) + --safetensors-dir A directory containing .safetensors and configuration files + --dduf A .dduf (Diffusers Unified Format) archive + --from An existing packaged model reference + + By default, the packaged artifact is loaded into the local Model Runner content store. + Use --push to publish the model to a registry instead. + + MODEL specifies the target model reference (for example: myorg/llama3:8b). + When using --push, MODEL must be a registry-qualified reference. + + Packaging behavior: + + GGUF + --gguf must point to a .gguf file. + For sharded models, point to the first shard. All shards must: + • reside in the same directory + • follow an indexed naming convention (e.g. model-00001-of-00015.gguf) + All shards are automatically discovered and packaged together. + + Safetensors + --safetensors-dir must point to a directory containing .safetensors files + and required configuration files (e.g. model config, tokenizer files). + All files under the directory (including nested subdirectories) are + automatically discovered. Each file is packaged as a separate OCI layer. + + DDUF + --dduf must point to a .dduf archive file. + + Repackaging + --from repackages an existing model. You may override selected properties + such as --context-size to create a variant of the original model. + + Multimodal models + Use --mmproj to include a multimodal projector file. +usage: docker model package (--gguf <path> | --safetensors-dir <path> | --dduf <path> | --from <model>) [--license <path>...] [--mmproj <path>] [--context-size <tokens>] [--push] MODEL +pname: docker model +plink: docker_model.yaml +options: + - option: chat-template + value_type: string + description: absolute path to chat template file (must be Jinja format) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: context-size + value_type: uint64 + default_value: "0" + description: context size in tokens + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: dduf + value_type: string + description: absolute path to DDUF archive file (Diffusers Unified Format) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: format + value_type: string + default_value: docker + description: | + output artifact format: "docker" (default) or "cncf" (CNCF ModelPack spec) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: from + value_type: string + description: reference to an existing model to repackage + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gguf + value_type: string + description: absolute path to gguf file + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: license + shorthand: l + value_type: stringArray + default_value: '[]' + description: absolute path to a license file + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: mmproj + value_type: string + description: absolute path to multimodal projector file + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: push + value_type: bool + default_value: "false" + description: | + push to registry (if not set, the model is loaded into the Model Runner content store) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: safetensors-dir + value_type: string + description: absolute path to directory containing safetensors files and config + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_ps.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_ps.yaml new file mode 100644 index 000000000000..0f4cf1e63b77 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_ps.yaml @@ -0,0 +1,13 @@ +command: docker model ps +short: List running models +long: List running models +usage: docker model ps +pname: docker model +plink: docker_model.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_pull.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_pull.yaml new file mode 100644 index 000000000000..c939304581de --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_pull.yaml @@ -0,0 +1,33 @@ +command: docker model pull +short: Pull a model from Docker Hub or HuggingFace to your local environment +long: | + Pull a model to your local environment. Downloaded models also appear in the Docker Desktop Dashboard. +usage: docker model pull MODEL +pname: docker model +plink: docker_model.yaml +examples: |- + ### Pulling a model from Docker Hub + + ```console + docker model pull ai/smollm2 + ``` + + ### Pulling from HuggingFace + + You can pull GGUF models directly from [Hugging Face](https://huggingface.co/models?library=gguf). + + **Note about quantization:** If no tag is specified, the command tries to pull the `Q4_K_M` version of the model. + If `Q4_K_M` doesn't exist, the command pulls the first GGUF found in the **Files** view of the model on HuggingFace. + To specify the quantization, provide it as a tag, for example: + `docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF:Q4_K_S` + + ```console + docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF + ``` +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_purge.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_purge.yaml new file mode 100644 index 000000000000..425923b91d37 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_purge.yaml @@ -0,0 +1,25 @@ +command: docker model purge +short: Remove all models +long: Remove all models +usage: docker model purge [OPTIONS] +pname: docker model +plink: docker_model.yaml +options: + - option: force + shorthand: f + value_type: bool + default_value: "false" + description: Forcefully remove all models + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_push.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_push.yaml new file mode 100644 index 000000000000..65c9ddfbe64f --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_push.yaml @@ -0,0 +1,13 @@ +command: docker model push +short: Push a model to Docker Hub or Hugging Face +long: Push a model to Docker Hub or Hugging Face +usage: docker model push MODEL +pname: docker model +plink: docker_model.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml new file mode 100644 index 000000000000..35d328b55181 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_reinstall-runner.yaml @@ -0,0 +1,123 @@ +command: docker model reinstall-runner +short: Reinstall Docker Model Runner (Docker Engine only) +long: | + This command removes the existing Docker Model Runner container and reinstalls it with the specified configuration. Models and images are preserved during reinstallation. +usage: docker model reinstall-runner +pname: docker model +plink: docker_model.yaml +options: + - option: backend + value_type: string + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: debug + value_type: bool + default_value: "false" + description: Enable debug logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: do-not-track + value_type: bool + default_value: "false" + description: Do not track models usage in Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gpu + value_type: string + default_value: auto + description: Specify GPU support (none|auto|cuda|rocm|musa|cann) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + default_value: 127.0.0.1 + description: Host address to bind Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + value_type: uint16 + default_value: "0" + description: | + Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: proxy-cert + value_type: string + description: Path to a CA certificate file for proxy SSL inspection + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls + value_type: bool + default_value: "false" + description: Enable TLS/HTTPS for Docker Model Runner API + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-cert + value_type: string + description: Path to TLS certificate file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-key + value_type: string + description: Path to TLS private key file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-port + value_type: uint16 + default_value: "0" + description: | + TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_requests.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_requests.yaml new file mode 100644 index 000000000000..eecab3ba3607 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_requests.yaml @@ -0,0 +1,45 @@ +command: docker model requests +short: Fetch requests+responses from Docker Model Runner +long: Fetch requests+responses from Docker Model Runner +usage: docker model requests [OPTIONS] +pname: docker model +plink: docker_model.yaml +options: + - option: follow + shorthand: f + value_type: bool + default_value: "false" + description: Follow requests stream + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: include-existing + value_type: bool + default_value: "false" + description: | + Include existing requests when starting to follow (only available with --follow) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: model + value_type: string + description: Specify the model to filter requests + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_restart-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_restart-runner.yaml new file mode 100644 index 000000000000..652fb64b0808 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_restart-runner.yaml @@ -0,0 +1,77 @@ +command: docker model restart-runner +short: Restart Docker Model Runner (Docker Engine only) +long: |- + This command restarts the Docker Model Runner without pulling container images. Use this command to restart the runner when you already have the required images locally. + + For the first-time setup or to ensure you have the latest images, use `docker model install-runner` instead. +usage: docker model restart-runner +pname: docker model +plink: docker_model.yaml +options: + - option: debug + value_type: bool + default_value: "false" + description: Enable debug logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: do-not-track + value_type: bool + default_value: "false" + description: Do not track models usage in Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gpu + value_type: string + default_value: auto + description: Specify GPU support (none|auto|cuda|rocm|musa|cann) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + default_value: 127.0.0.1 + description: Host address to bind Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + value_type: uint16 + default_value: "0" + description: | + Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: proxy-cert + value_type: string + description: Path to a CA certificate file for proxy SSL inspection + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_rm.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_rm.yaml new file mode 100644 index 000000000000..1a1028dc8a79 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_rm.yaml @@ -0,0 +1,25 @@ +command: docker model rm +short: Remove local models downloaded from Docker Hub +long: Remove local models downloaded from Docker Hub +usage: docker model rm [MODEL...] +pname: docker model +plink: docker_model.yaml +options: + - option: force + shorthand: f + value_type: bool + default_value: "false" + description: Forcefully remove the model + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_run.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_run.yaml new file mode 100644 index 000000000000..9ffb3785c542 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_run.yaml @@ -0,0 +1,103 @@ +command: docker model run +short: Run a model and interact with it using a submitted prompt or chat mode +long: |- + When you run a model, Docker calls an inference server API endpoint hosted by the Model Runner through Docker Desktop. The model stays in memory until another model is requested, or until a pre-defined inactivity timeout is reached (currently 5 minutes). + + You do not have to use Docker model run before interacting with a specific model from a host process or from within a container. Model Runner transparently loads the requested model on-demand, assuming it has been pulled and is locally available. + + You can also use chat mode in the Docker Desktop Dashboard when you select the model in the **Models** tab. +usage: docker model run MODEL [PROMPT] +pname: docker model +plink: docker_model.yaml +options: + - option: color + value_type: string + default_value: "no" + description: Use colored output (auto|yes|no) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: debug + value_type: bool + default_value: "false" + description: Enable debug logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: detach + shorthand: d + value_type: bool + default_value: "false" + description: Load the model in the background without interaction + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: openaiurl + value_type: string + description: OpenAI-compatible API endpoint URL to chat with + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: websearch + value_type: bool + default_value: "false" + description: Enable web search tool during chat + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### One-time prompt + + ```console + docker model run ai/smollm2 "Hi" + ``` + + Output: + + ```console + Hello! How can I assist you today? + ``` + + ### Interactive chat + + ```console + docker model run ai/smollm2 + ``` + + Output: + + ```console + > Hi + Hi there! It's SmolLM, AI assistant. How can I help you today? + > /bye + ``` + + ### Pre-load a model + + ```console + docker model run --detach ai/smollm2 + ``` + + This loads the model into memory without interaction, ensuring maximum performance for subsequent requests. +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_search.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_search.yaml new file mode 100644 index 000000000000..72129bd7a32e --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_search.yaml @@ -0,0 +1,57 @@ +command: docker model search +short: Search for models on Docker Hub and HuggingFace +long: |- + Search for models from Docker Hub (ai/ namespace) and HuggingFace. + + When no search term is provided, lists all available models. + When a search term is provided, filters models by name/description. + + Examples: + docker model search # List available models from Docker Hub + docker model search llama # Search for models containing "llama" + docker model search --source=all # Search both Docker Hub and HuggingFace + docker model search --source=huggingface # Only search HuggingFace + docker model search --limit=50 phi # Search with custom limit + docker model search --json llama # Output as JSON +usage: docker model search [OPTIONS] [TERM] +pname: docker model +plink: docker_model.yaml +options: + - option: json + value_type: bool + default_value: "false" + description: Output results as JSON + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: limit + shorthand: "n" + value_type: int + default_value: "32" + description: Maximum number of results to show + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: source + value_type: string + default_value: all + description: 'Source to search: all, dockerhub, huggingface' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_show.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_show.yaml new file mode 100644 index 000000000000..c119856732f3 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_show.yaml @@ -0,0 +1,25 @@ +command: docker model show +short: Show information for a model +long: Display detailed information about a model in a human-readable format. +usage: docker model show MODEL +pname: docker model +plink: docker_model.yaml +options: + - option: remote + shorthand: r + value_type: bool + default_value: "false" + description: Show info for remote models + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_skills.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_skills.yaml new file mode 100644 index 000000000000..27274b18b0f1 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_skills.yaml @@ -0,0 +1,79 @@ +command: docker model skills +short: Install Docker Model Runner skills for AI coding assistants +long: |- + Install Docker Model Runner skills for AI coding assistants. + + Skills are configuration files that help AI coding assistants understand + how to use Docker Model Runner effectively for local model inference. + + Supported targets: + --codex Install to ~/.codex/skills (OpenAI Codex CLI) + --claude Install to ~/.claude/skills (Claude Code) + --opencode Install to ~/.config/opencode/skills (OpenCode) + --dest Install to a custom directory + + Example: + docker model skills --claude + docker model skills --codex --claude + docker model skills --dest /path/to/skills +usage: docker model skills +pname: docker model +plink: docker_model.yaml +options: + - option: claude + value_type: bool + default_value: "false" + description: Install skills for Claude Code (~/.claude/skills) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: codex + value_type: bool + default_value: "false" + description: Install skills for OpenAI Codex CLI (~/.codex/skills) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: dest + value_type: string + description: Install skills to a custom directory + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: force + shorthand: f + value_type: bool + default_value: "false" + description: Overwrite existing skills without prompting + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: opencode + value_type: bool + default_value: "false" + description: Install skills for OpenCode (~/.config/opencode/skills) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_start-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_start-runner.yaml new file mode 100644 index 000000000000..740e36c53a1d --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_start-runner.yaml @@ -0,0 +1,125 @@ +command: docker model start-runner +short: Start Docker Model Runner (Docker Engine only) +long: |- + This command starts the Docker Model Runner without pulling container images. Use this command to start the runner when you already have the required images locally. + + For the first-time setup or to ensure you have the latest images, use `docker model install-runner` instead. +usage: docker model start-runner +pname: docker model +plink: docker_model.yaml +options: + - option: backend + value_type: string + description: 'Specify backend (llama.cpp|vllm|diffusers). Default: llama.cpp' + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: debug + value_type: bool + default_value: "false" + description: Enable debug logging + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: do-not-track + value_type: bool + default_value: "false" + description: Do not track models usage in Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: gpu + value_type: string + default_value: auto + description: Specify GPU support (none|auto|cuda|rocm|musa|cann) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: host + value_type: string + default_value: 127.0.0.1 + description: Host address to bind Docker Model Runner + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: port + value_type: uint16 + default_value: "0" + description: | + Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: proxy-cert + value_type: string + description: Path to a CA certificate file for proxy SSL inspection + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls + value_type: bool + default_value: "false" + description: Enable TLS/HTTPS for Docker Model Runner API + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-cert + value_type: string + description: Path to TLS certificate file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-key + value_type: string + description: Path to TLS private key file (auto-generated if not provided) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: tls-port + value_type: uint16 + default_value: "0" + description: | + TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_status.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_status.yaml new file mode 100644 index 000000000000..8f0b789f85bb --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_status.yaml @@ -0,0 +1,25 @@ +command: docker model status +short: Check if the Docker Model Runner is running +long: | + Check whether the Docker Model Runner is running and displays the current inference engine. +usage: docker model status +pname: docker model +plink: docker_model.yaml +options: + - option: json + value_type: bool + default_value: "false" + description: Format output in JSON + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_stop-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_stop-runner.yaml new file mode 100644 index 000000000000..8d565b868191 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_stop-runner.yaml @@ -0,0 +1,27 @@ +command: docker model stop-runner +short: Stop Docker Model Runner (Docker Engine only) +long: |- + This command stops the Docker Model Runner by removing the running containers, but preserves the container images on disk. Use this command when you want to temporarily stop the runner but plan to start it again later. + + To completely remove the runner including images, use `docker model uninstall-runner --images` instead. +usage: docker model stop-runner +pname: docker model +plink: docker_model.yaml +options: + - option: models + value_type: bool + default_value: "false" + description: Remove model storage volume + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_tag.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_tag.yaml new file mode 100644 index 000000000000..6239e6138751 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_tag.yaml @@ -0,0 +1,14 @@ +command: docker model tag +short: Tag a model +long: | + Specify a particular version or variant of the model. If no tag is provided, Docker defaults to `latest`. +usage: docker model tag SOURCE TARGET +pname: docker model +plink: docker_model.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_uninstall-runner.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_uninstall-runner.yaml new file mode 100644 index 000000000000..e93363d5381b --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_uninstall-runner.yaml @@ -0,0 +1,43 @@ +command: docker model uninstall-runner +short: Uninstall Docker Model Runner (Docker Engine only) +long: Uninstall Docker Model Runner (Docker Engine only) +usage: docker model uninstall-runner +pname: docker model +plink: docker_model.yaml +options: + - option: backend + value_type: string + description: Uninstall a deferred backend (e.g. vllm, diffusers) + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: images + value_type: bool + default_value: "false" + description: Remove docker/model-runner images + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: models + value_type: bool + default_value: "false" + description: Remove model storage volume + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_unload.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_unload.yaml new file mode 100644 index 000000000000..ee0de45bb327 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_unload.yaml @@ -0,0 +1,34 @@ +command: docker model unload +aliases: docker model unload, docker model stop +short: Unload running models +long: Unload running models +usage: docker model unload (MODEL [MODEL ...] [--backend BACKEND] | --all) +pname: docker model +plink: docker_model.yaml +options: + - option: all + value_type: bool + default_value: "false" + description: Unload all running models + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + - option: backend + value_type: string + description: Optional backend to target + deprecated: false + hidden: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_version.yaml b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_version.yaml new file mode 100644 index 000000000000..2674843c99eb --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/docker_model_version.yaml @@ -0,0 +1,13 @@ +command: docker model version +short: Show the Docker Model Runner version +long: Show the Docker Model Runner version +usage: docker model version +pname: docker model +plink: docker_model.yaml +deprecated: false +hidden: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model.md new file mode 100644 index 000000000000..e26c01924be3 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model.md @@ -0,0 +1,47 @@ +# docker model + +<!---MARKER_GEN_START--> +Docker Model Runner + +### Subcommands + +| Name | Description | +|:------------------------------------------------|:-----------------------------------------------------------------------| +| [`bench`](model_bench.md) | Benchmark a model's performance at different concurrency levels | +| [`context`](model_context.md) | Manage Docker Model Runner contexts | +| [`df`](model_df.md) | Show Docker Model Runner disk usage | +| [`gateway`](model_gateway.md) | Run an OpenAI-compatible LLM gateway | +| [`inspect`](model_inspect.md) | Display detailed information on one model | +| [`install-runner`](model_install-runner.md) | Install Docker Model Runner (Docker Engine only) | +| [`launch`](model_launch.md) | Launch an app configured to use Docker Model Runner | +| [`list`](model_list.md) | List the models pulled to your local environment | +| [`logs`](model_logs.md) | Fetch the Docker Model Runner logs | +| [`package`](model_package.md) | Package a model into a Docker Model OCI artifact | +| [`ps`](model_ps.md) | List running models | +| [`pull`](model_pull.md) | Pull a model from Docker Hub or HuggingFace to your local environment | +| [`purge`](model_purge.md) | Remove all models | +| [`push`](model_push.md) | Push a model to Docker Hub or Hugging Face | +| [`reinstall-runner`](model_reinstall-runner.md) | Reinstall Docker Model Runner (Docker Engine only) | +| [`requests`](model_requests.md) | Fetch requests+responses from Docker Model Runner | +| [`restart-runner`](model_restart-runner.md) | Restart Docker Model Runner (Docker Engine only) | +| [`rm`](model_rm.md) | Remove local models downloaded from Docker Hub | +| [`run`](model_run.md) | Run a model and interact with it using a submitted prompt or chat mode | +| [`search`](model_search.md) | Search for models on Docker Hub and HuggingFace | +| [`show`](model_show.md) | Show information for a model | +| [`skills`](model_skills.md) | Install Docker Model Runner skills for AI coding assistants | +| [`start-runner`](model_start-runner.md) | Start Docker Model Runner (Docker Engine only) | +| [`status`](model_status.md) | Check if the Docker Model Runner is running | +| [`stop-runner`](model_stop-runner.md) | Stop Docker Model Runner (Docker Engine only) | +| [`tag`](model_tag.md) | Tag a model | +| [`uninstall-runner`](model_uninstall-runner.md) | Uninstall Docker Model Runner (Docker Engine only) | +| [`unload`](model_unload.md) | Unload running models | +| [`version`](model_version.md) | Show the Docker Model Runner version | + + + +<!---MARKER_GEN_END--> + +## Description + +Use Docker Model Runner to run and interact with AI models directly from the command line. +For more information, see the [documentation](https://docs.docker.com/ai/model-runner/) diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_bench.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_bench.md new file mode 100644 index 000000000000..fbeaf5ac5358 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_bench.md @@ -0,0 +1,21 @@ +# docker model bench + +<!---MARKER_GEN_START--> +Benchmark a model's performance showing tokens per second at different concurrency levels. + +This command runs a series of benchmarks with 1, 2, 4, and 8 concurrent requests by default, +measuring the tokens per second (TPS) that the model can generate. + +### Options + +| Name | Type | Default | Description | +|:----------------|:-----------|:--------------------------------------------------------------------------------|:--------------------------------------| +| `--concurrency` | `intSlice` | `[1,2,4,8]` | Concurrency levels to test | +| `--duration` | `duration` | `30s` | Duration to run each concurrency test | +| `--json` | `bool` | | Output results in JSON format | +| `--prompt` | `string` | `Write a comprehensive 100 word summary on whales and their impact on society.` | Prompt to use for benchmarking | +| `--timeout` | `duration` | `5m0s` | Timeout for each individual request | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_configure.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_configure.md new file mode 100644 index 000000000000..81fc1546bd5e --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_configure.md @@ -0,0 +1,14 @@ +# docker model configure + +<!---MARKER_GEN_START--> +Configure runtime options for a model + +### Options + +| Name | Type | Default | Description | +|:-----------------|:--------|:--------|:-------------------------| +| `--context-size` | `int64` | `-1` | context size (in tokens) | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context.md new file mode 100644 index 000000000000..d5c05658ce3b --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context.md @@ -0,0 +1,19 @@ +# docker model context + +<!---MARKER_GEN_START--> +Manage Docker Model Runner contexts + +### Subcommands + +| Name | Description | +|:--------------------------------------|:--------------------------------------------------------| +| [`create`](model_context_create.md) | Create a named Model Runner context | +| [`inspect`](model_context_inspect.md) | Display detailed information about one or more contexts | +| [`ls`](model_context_ls.md) | List Model Runner contexts | +| [`rm`](model_context_rm.md) | Remove one or more Model Runner contexts | +| [`use`](model_context_use.md) | Set the active Model Runner context | + + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_create.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_create.md new file mode 100644 index 000000000000..cee0c6338275 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_create.md @@ -0,0 +1,18 @@ +# docker model context create + +<!---MARKER_GEN_START--> +Create a named Model Runner context + +### Options + +| Name | Type | Default | Description | +|:--------------------|:---------|:--------|:--------------------------------------------------------------| +| `--description` | `string` | | Optional human-readable description for this context | +| `--host` | `string` | | Model Runner API base URL (e.g. http://192.168.1.100:12434) | +| `--tls` | `bool` | | Enable TLS for connections to this context | +| `--tls-ca-cert` | `string` | | Path to a custom CA certificate PEM file for TLS verification | +| `--tls-skip-verify` | `bool` | | Skip TLS server certificate verification | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_inspect.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_inspect.md new file mode 100644 index 000000000000..75357d4a1d61 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_inspect.md @@ -0,0 +1,8 @@ +# docker model context inspect + +<!---MARKER_GEN_START--> +Display detailed information about one or more contexts + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_ls.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_ls.md new file mode 100644 index 000000000000..5d9e980d85d4 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_ls.md @@ -0,0 +1,12 @@ +# docker model context ls + +<!---MARKER_GEN_START--> +List Model Runner contexts + +### Aliases + +`docker model context ls`, `docker model context list` + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_rm.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_rm.md new file mode 100644 index 000000000000..65a408590f82 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_rm.md @@ -0,0 +1,12 @@ +# docker model context rm + +<!---MARKER_GEN_START--> +Remove one or more Model Runner contexts + +### Aliases + +`docker model context rm`, `docker model context remove` + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_use.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_use.md new file mode 100644 index 000000000000..f6544f63fd1d --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_context_use.md @@ -0,0 +1,9 @@ +# docker model context use + +<!---MARKER_GEN_START--> +Set the active Model Runner context. Pass "default" to revert to +automatic backend detection. + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_df.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_df.md new file mode 100644 index 000000000000..e6a4073670b4 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_df.md @@ -0,0 +1,8 @@ +# docker model df + +<!---MARKER_GEN_START--> +Show Docker Model Runner disk usage + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_gateway.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_gateway.md new file mode 100644 index 000000000000..630ef5ecc96c --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_gateway.md @@ -0,0 +1,150 @@ +# docker model gateway + +<!---MARKER_GEN_START--> +Run an OpenAI-compatible LLM gateway that routes requests to configured providers. + +Supported providers include Docker Model Runner, Ollama, OpenAI, Anthropic, +Groq, Mistral, Azure OpenAI, and many more OpenAI-compatible endpoints. + +### Options + +| Name | Type | Default | Description | +|:------------------|:---------|:----------|:------------------------------------| +| `-c`, `--config` | `string` | | Path to the YAML configuration file | +| `--host` | `string` | `0.0.0.0` | Host address to bind to | +| `-p`, `--port` | `uint16` | `4000` | Port to listen on | +| `-v`, `--verbose` | `bool` | | Enable verbose (debug) logging | + + +<!---MARKER_GEN_END--> + +## Description + +`docker model gateway` starts a local OpenAI-compatible HTTP gateway that routes +requests to one or more configured LLM providers. It supports Docker Model Runner +as a first-class provider, alongside Ollama, OpenAI, Anthropic, Groq, Mistral, +Azure OpenAI, and many other OpenAI-compatible endpoints. + +The gateway is configured through a YAML file that declares the model list, +provider routing, load-balancing, retries, and fallbacks. + +### Configuration file format + +```yaml +model_list: + - model_name: <alias exposed to clients> + params: + model: <provider>/<upstream-model-name> + api_base: <optional base URL override> + api_key: <optional key or os.environ/VAR_NAME> + +general_settings: + master_key: <optional API key required by clients> + num_retries: <optional integer, default 0> + fallbacks: + - <primary-alias>: [<fallback-alias>, ...] +``` + +The `model` field under `params` uses the format `provider/model-name`. +Supported provider prefixes include: `docker_model_runner`, `openai`, +`anthropic`, `ollama`, `groq`, `mistral`, `together_ai`, `deepseek`, +`fireworks_ai`, `openrouter`, `perplexity`, `xai`, `nvidia_nim`, +`cerebras`, `sambanova`, `deepinfra`, `azure`, `azure_ai`, `vllm`, +`lm_studio`, `huggingface`. + +API keys can be supplied inline, as `os.environ/VAR_NAME` references, or as +`${VAR_NAME}` references. The gateway resolves well-known environment variables +automatically (for example, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`). + +## Examples + +### Route requests to Docker Model Runner + +```yaml +model_list: + - model_name: smollm2 + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 +``` + +```console +$ docker model gateway --config config.yaml +``` + +The gateway starts on `http://0.0.0.0:4000`. Send requests using any +OpenAI-compatible client: + +```console +$ curl http://localhost:4000/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "smollm2", + "messages": [{"role": "user", "content": "Hello"}] + }' +``` + +### Route requests to multiple providers with fallback + +```yaml +model_list: + - model_name: fast + params: + model: groq/llama-3.1-8b-instant + api_key: os.environ/GROQ_API_KEY + - model_name: smart + params: + model: openai/gpt-4o + api_key: os.environ/OPENAI_API_KEY + - model_name: local + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 + +general_settings: + num_retries: 2 + fallbacks: + - fast: [local] + - smart: [fast, local] +``` + +```console +$ docker model gateway --config config.yaml --port 8080 +``` + +### Secure the gateway with an API key + +```yaml +model_list: + - model_name: smollm2 + params: + model: docker_model_runner/ai/smollm2 + api_base: http://localhost:12434/engines/llama.cpp/v1 + +general_settings: + master_key: os.environ/GATEWAY_API_KEY +``` + +```console +$ GATEWAY_API_KEY=my-secret docker model gateway --config config.yaml +``` + +Clients must then pass the key as a Bearer token or via the `x-api-key` header: + +```console +$ curl http://localhost:4000/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{"model": "smollm2", "messages": [{"role": "user", "content": "Hi"}]}' +``` + +### Use a custom host and port + +```console +$ docker model gateway --config config.yaml --host 127.0.0.1 --port 9000 +``` + +### Enable debug logging + +```console +$ docker model gateway --config config.yaml --verbose +``` diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_inspect.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_inspect.md new file mode 100644 index 000000000000..7df015093814 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_inspect.md @@ -0,0 +1,15 @@ +# docker model inspect + +<!---MARKER_GEN_START--> +Display detailed information on one model + +### Options + +| Name | Type | Default | Description | +|:-----------------|:-------|:--------|:-------------------------------| +| `--openai` | `bool` | | List model in an OpenAI format | +| `-r`, `--remote` | `bool` | | Show info for remote models | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_install-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_install-runner.md new file mode 100644 index 000000000000..de40a5028656 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_install-runner.md @@ -0,0 +1,27 @@ +# docker model install-runner + +<!---MARKER_GEN_START--> +Install Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | +| `--debug` | `bool` | | Enable debug logging | +| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | +| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | +| `--host` | `string` | `127.0.0.1` | Host address to bind Docker Model Runner | +| `--port` | `uint16` | `0` | Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) | +| `--proxy-cert` | `string` | | Path to a CA certificate file for proxy SSL inspection | +| `--tls` | `bool` | | Enable TLS/HTTPS for Docker Model Runner API | +| `--tls-cert` | `string` | | Path to TLS certificate file (auto-generated if not provided) | +| `--tls-key` | `string` | | Path to TLS private key file (auto-generated if not provided) | +| `--tls-port` | `uint16` | `0` | TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) | + + +<!---MARKER_GEN_END--> + +## Description + + This command runs implicitly when a docker model command is executed. You can run this command explicitly to add a new configuration. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_launch.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_launch.md new file mode 100644 index 000000000000..161e2a3a3062 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_launch.md @@ -0,0 +1,30 @@ +# docker model launch + +<!---MARKER_GEN_START--> +Launch an app configured to use Docker Model Runner. + +Without arguments, lists all supported apps. + +Supported apps: anythingllm, claude, codex, openclaw, opencode, openwebui + +Examples: + docker model launch + docker model launch opencode + docker model launch claude -- --help + docker model launch openwebui --port 3000 + docker model launch claude --config + +### Options + +| Name | Type | Default | Description | +|:------------|:---------|:--------|:------------------------------------------------| +| `--config` | `bool` | | Print configuration without launching | +| `--detach` | `bool` | | Run containerized app in background | +| `--dry-run` | `bool` | | Print what would be executed without running it | +| `--image` | `string` | | Override container image for containerized apps | +| `--model` | `string` | | Model to use (for opencode) | +| `--port` | `int` | `0` | Host port to expose (web UIs) | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_list.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_list.md new file mode 100644 index 000000000000..24d260a5d86a --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_list.md @@ -0,0 +1,21 @@ +# docker model list + +<!---MARKER_GEN_START--> +List the models pulled to your local environment + +### Aliases + +`docker model list`, `docker model ls` + +### Options + +| Name | Type | Default | Description | +|:----------------|:---------|:--------|:-------------------------------------------------------| +| `--json` | `bool` | | List models in a JSON format | +| `--openai` | `bool` | | List models in an OpenAI format | +| `--openaiurl` | `string` | | OpenAI-compatible API endpoint URL to list models from | +| `-q`, `--quiet` | `bool` | | Only show model IDs | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_logs.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_logs.md new file mode 100644 index 000000000000..8c5810924a18 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_logs.md @@ -0,0 +1,15 @@ +# docker model logs + +<!---MARKER_GEN_START--> +Fetch the Docker Model Runner logs + +### Options + +| Name | Type | Default | Description | +|:-----------------|:-------|:--------|:----------------------------------------------| +| `-f`, `--follow` | `bool` | | View logs with real-time streaming | +| `--no-engines` | `bool` | | Exclude inference engine logs from the output | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_package.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_package.md new file mode 100644 index 000000000000..571b77c1fa36 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_package.md @@ -0,0 +1,60 @@ +# docker model package + +<!---MARKER_GEN_START--> +Package a model into a Docker Model OCI artifact. + +The model source must be one of: + --gguf A GGUF file (single file or first shard of a sharded model) + --safetensors-dir A directory containing .safetensors and configuration files + --dduf A .dduf (Diffusers Unified Format) archive + --from An existing packaged model reference + +By default, the packaged artifact is loaded into the local Model Runner content store. +Use --push to publish the model to a registry instead. + +MODEL specifies the target model reference (for example: myorg/llama3:8b). +When using --push, MODEL must be a registry-qualified reference. + +Packaging behavior: + + GGUF + --gguf must point to a .gguf file. + For sharded models, point to the first shard. All shards must: + • reside in the same directory + • follow an indexed naming convention (e.g. model-00001-of-00015.gguf) + All shards are automatically discovered and packaged together. + + Safetensors + --safetensors-dir must point to a directory containing .safetensors files + and required configuration files (e.g. model config, tokenizer files). + All files under the directory (including nested subdirectories) are + automatically discovered. Each file is packaged as a separate OCI layer. + + DDUF + --dduf must point to a .dduf archive file. + + Repackaging + --from repackages an existing model. You may override selected properties + such as --context-size to create a variant of the original model. + + Multimodal models + Use --mmproj to include a multimodal projector file. + +### Options + +| Name | Type | Default | Description | +|:--------------------|:--------------|:---------|:---------------------------------------------------------------------------------------| +| `--chat-template` | `string` | | absolute path to chat template file (must be Jinja format) | +| `--context-size` | `uint64` | `0` | context size in tokens | +| `--dduf` | `string` | | absolute path to DDUF archive file (Diffusers Unified Format) | +| `--format` | `string` | `docker` | output artifact format: "docker" (default) or "cncf" (CNCF ModelPack spec) | +| `--from` | `string` | | reference to an existing model to repackage | +| `--gguf` | `string` | | absolute path to gguf file | +| `-l`, `--license` | `stringArray` | | absolute path to a license file | +| `--mmproj` | `string` | | absolute path to multimodal projector file | +| `--push` | `bool` | | push to registry (if not set, the model is loaded into the Model Runner content store) | +| `--safetensors-dir` | `string` | | absolute path to directory containing safetensors files and config | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_ps.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_ps.md new file mode 100644 index 000000000000..15f5371553f6 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_ps.md @@ -0,0 +1,8 @@ +# docker model ps + +<!---MARKER_GEN_START--> +List running models + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_pull.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_pull.md new file mode 100644 index 000000000000..246cc59d78af --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_pull.md @@ -0,0 +1,32 @@ +# docker model pull + +<!---MARKER_GEN_START--> +Pull a model from Docker Hub or HuggingFace to your local environment + + +<!---MARKER_GEN_END--> + +## Description + +Pull a model to your local environment. Downloaded models also appear in the Docker Desktop Dashboard. + +## Examples + +### Pulling a model from Docker Hub + +```console +docker model pull ai/smollm2 +``` + +### Pulling from HuggingFace + +You can pull GGUF models directly from [Hugging Face](https://huggingface.co/models?library=gguf). + +**Note about quantization:** If no tag is specified, the command tries to pull the `Q4_K_M` version of the model. +If `Q4_K_M` doesn't exist, the command pulls the first GGUF found in the **Files** view of the model on HuggingFace. +To specify the quantization, provide it as a tag, for example: +`docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF:Q4_K_S` + +```console +docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF +``` diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_purge.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_purge.md new file mode 100644 index 000000000000..4fcc85c349dd --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_purge.md @@ -0,0 +1,14 @@ +# docker model purge + +<!---MARKER_GEN_START--> +Remove all models + +### Options + +| Name | Type | Default | Description | +|:----------------|:-------|:--------|:-----------------------------| +| `-f`, `--force` | `bool` | | Forcefully remove all models | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_push.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_push.md new file mode 100644 index 000000000000..7b040fe0bf82 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_push.md @@ -0,0 +1,13 @@ +# docker model push + +<!---MARKER_GEN_START--> +Push a model to Docker Hub or Hugging Face + + +<!---MARKER_GEN_END--> + +### Example + +```console +docker model push <namespace>/<model> +``` diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_reinstall-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_reinstall-runner.md new file mode 100644 index 000000000000..457b322e5789 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_reinstall-runner.md @@ -0,0 +1,27 @@ +# docker model reinstall-runner + +<!---MARKER_GEN_START--> +Reinstall Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | +| `--debug` | `bool` | | Enable debug logging | +| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | +| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | +| `--host` | `string` | `127.0.0.1` | Host address to bind Docker Model Runner | +| `--port` | `uint16` | `0` | Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) | +| `--proxy-cert` | `string` | | Path to a CA certificate file for proxy SSL inspection | +| `--tls` | `bool` | | Enable TLS/HTTPS for Docker Model Runner API | +| `--tls-cert` | `string` | | Path to TLS certificate file (auto-generated if not provided) | +| `--tls-key` | `string` | | Path to TLS private key file (auto-generated if not provided) | +| `--tls-port` | `uint16` | `0` | TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) | + + +<!---MARKER_GEN_END--> + +## Description + +This command removes the existing Docker Model Runner container and reinstalls it with the specified configuration. Models and images are preserved during reinstallation. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_requests.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_requests.md new file mode 100644 index 000000000000..970dc3c3d6ed --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_requests.md @@ -0,0 +1,16 @@ +# docker model requests + +<!---MARKER_GEN_START--> +Fetch requests+responses from Docker Model Runner + +### Options + +| Name | Type | Default | Description | +|:---------------------|:---------|:--------|:---------------------------------------------------------------------------------| +| `-f`, `--follow` | `bool` | | Follow requests stream | +| `--include-existing` | `bool` | | Include existing requests when starting to follow (only available with --follow) | +| `--model` | `string` | | Specify the model to filter requests | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_restart-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_restart-runner.md new file mode 100644 index 000000000000..80565a8dfa1a --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_restart-runner.md @@ -0,0 +1,24 @@ +# docker model restart-runner + +<!---MARKER_GEN_START--> +Restart Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| +| `--debug` | `bool` | | Enable debug logging | +| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | +| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | +| `--host` | `string` | `127.0.0.1` | Host address to bind Docker Model Runner | +| `--port` | `uint16` | `0` | Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) | +| `--proxy-cert` | `string` | | Path to a CA certificate file for proxy SSL inspection | + + +<!---MARKER_GEN_END--> + +## Description + +This command restarts the Docker Model Runner without pulling container images. Use this command to restart the runner when you already have the required images locally. + +For the first-time setup or to ensure you have the latest images, use `docker model install-runner` instead. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_rm.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_rm.md new file mode 100644 index 000000000000..6463903bd899 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_rm.md @@ -0,0 +1,14 @@ +# docker model rm + +<!---MARKER_GEN_START--> +Remove local models downloaded from Docker Hub + +### Options + +| Name | Type | Default | Description | +|:----------------|:-------|:--------|:----------------------------| +| `-f`, `--force` | `bool` | | Forcefully remove the model | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_run.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_run.md new file mode 100644 index 000000000000..b6190d26a032 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_run.md @@ -0,0 +1,61 @@ +# docker model run + +<!---MARKER_GEN_START--> +Run a model and interact with it using a submitted prompt or chat mode + +### Options + +| Name | Type | Default | Description | +|:-----------------|:---------|:--------|:-----------------------------------------------------| +| `--color` | `string` | `no` | Use colored output (auto\|yes\|no) | +| `--debug` | `bool` | | Enable debug logging | +| `-d`, `--detach` | `bool` | | Load the model in the background without interaction | +| `--openaiurl` | `string` | | OpenAI-compatible API endpoint URL to chat with | +| `--websearch` | `bool` | | Enable web search tool during chat | + + +<!---MARKER_GEN_END--> + +## Description + +When you run a model, Docker calls an inference server API endpoint hosted by the Model Runner through Docker Desktop. The model stays in memory until another model is requested, or until a pre-defined inactivity timeout is reached (currently 5 minutes). + +You do not have to use Docker model run before interacting with a specific model from a host process or from within a container. Model Runner transparently loads the requested model on-demand, assuming it has been pulled and is locally available. + +You can also use chat mode in the Docker Desktop Dashboard when you select the model in the **Models** tab. + +## Examples + +### One-time prompt + +```console +docker model run ai/smollm2 "Hi" +``` + +Output: + +```console +Hello! How can I assist you today? +``` + +### Interactive chat + +```console +docker model run ai/smollm2 +``` + +Output: + +```console +> Hi +Hi there! It's SmolLM, AI assistant. How can I help you today? +> /bye +``` + +### Pre-load a model + +```console +docker model run --detach ai/smollm2 +``` + +This loads the model into memory without interaction, ensuring maximum performance for subsequent requests. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_search.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_search.md new file mode 100644 index 000000000000..b146e60c6d18 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_search.md @@ -0,0 +1,27 @@ +# docker model search + +<!---MARKER_GEN_START--> +Search for models from Docker Hub (ai/ namespace) and HuggingFace. + +When no search term is provided, lists all available models. +When a search term is provided, filters models by name/description. + +Examples: + docker model search # List available models from Docker Hub + docker model search llama # Search for models containing "llama" + docker model search --source=all # Search both Docker Hub and HuggingFace + docker model search --source=huggingface # Only search HuggingFace + docker model search --limit=50 phi # Search with custom limit + docker model search --json llama # Output as JSON + +### Options + +| Name | Type | Default | Description | +|:----------------|:---------|:--------|:----------------------------------------------| +| `--json` | `bool` | | Output results as JSON | +| `-n`, `--limit` | `int` | `32` | Maximum number of results to show | +| `--source` | `string` | `all` | Source to search: all, dockerhub, huggingface | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_show.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_show.md new file mode 100644 index 000000000000..d8c37da522a8 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_show.md @@ -0,0 +1,14 @@ +# docker model show + +<!---MARKER_GEN_START--> +Display detailed information about a model in a human-readable format. + +### Options + +| Name | Type | Default | Description | +|:-----------------|:-------|:--------|:----------------------------| +| `-r`, `--remote` | `bool` | | Show info for remote models | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_skills.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_skills.md new file mode 100644 index 000000000000..39ecc0ed7212 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_skills.md @@ -0,0 +1,32 @@ +# docker model skills + +<!---MARKER_GEN_START--> +Install Docker Model Runner skills for AI coding assistants. + +Skills are configuration files that help AI coding assistants understand +how to use Docker Model Runner effectively for local model inference. + +Supported targets: + --codex Install to ~/.codex/skills (OpenAI Codex CLI) + --claude Install to ~/.claude/skills (Claude Code) + --opencode Install to ~/.config/opencode/skills (OpenCode) + --dest Install to a custom directory + +Example: + docker model skills --claude + docker model skills --codex --claude + docker model skills --dest /path/to/skills + +### Options + +| Name | Type | Default | Description | +|:----------------|:---------|:--------|:--------------------------------------------------------| +| `--claude` | `bool` | | Install skills for Claude Code (~/.claude/skills) | +| `--codex` | `bool` | | Install skills for OpenAI Codex CLI (~/.codex/skills) | +| `--dest` | `string` | | Install skills to a custom directory | +| `-f`, `--force` | `bool` | | Overwrite existing skills without prompting | +| `--opencode` | `bool` | | Install skills for OpenCode (~/.config/opencode/skills) | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_start-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_start-runner.md new file mode 100644 index 000000000000..24cf2fe12f33 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_start-runner.md @@ -0,0 +1,29 @@ +# docker model start-runner + +<!---MARKER_GEN_START--> +Start Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:-----------------|:---------|:------------|:-------------------------------------------------------------------------------------------------------| +| `--backend` | `string` | | Specify backend (llama.cpp\|vllm\|diffusers). Default: llama.cpp | +| `--debug` | `bool` | | Enable debug logging | +| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner | +| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda\|rocm\|musa\|cann) | +| `--host` | `string` | `127.0.0.1` | Host address to bind Docker Model Runner | +| `--port` | `uint16` | `0` | Docker container port for Docker Model Runner (default: 12434 for Docker Engine, 12435 for Cloud mode) | +| `--proxy-cert` | `string` | | Path to a CA certificate file for proxy SSL inspection | +| `--tls` | `bool` | | Enable TLS/HTTPS for Docker Model Runner API | +| `--tls-cert` | `string` | | Path to TLS certificate file (auto-generated if not provided) | +| `--tls-key` | `string` | | Path to TLS private key file (auto-generated if not provided) | +| `--tls-port` | `uint16` | `0` | TLS port for Docker Model Runner (default: 12444 for Docker Engine, 12445 for Cloud mode) | + + +<!---MARKER_GEN_END--> + +## Description + +This command starts the Docker Model Runner without pulling container images. Use this command to start the runner when you already have the required images locally. + +For the first-time setup or to ensure you have the latest images, use `docker model install-runner` instead. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_status.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_status.md new file mode 100644 index 000000000000..baa630073db8 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_status.md @@ -0,0 +1,17 @@ +# docker model status + +<!---MARKER_GEN_START--> +Check if the Docker Model Runner is running + +### Options + +| Name | Type | Default | Description | +|:---------|:-------|:--------|:----------------------| +| `--json` | `bool` | | Format output in JSON | + + +<!---MARKER_GEN_END--> + +## Description + +Check whether the Docker Model Runner is running and displays the current inference engine. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_stop-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_stop-runner.md new file mode 100644 index 000000000000..99a6b0cda601 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_stop-runner.md @@ -0,0 +1,19 @@ +# docker model stop-runner + +<!---MARKER_GEN_START--> +Stop Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:-----------|:-------|:--------|:----------------------------| +| `--models` | `bool` | | Remove model storage volume | + + +<!---MARKER_GEN_END--> + +## Description + +This command stops the Docker Model Runner by removing the running containers, but preserves the container images on disk. Use this command when you want to temporarily stop the runner but plan to start it again later. + +To completely remove the runner including images, use `docker model uninstall-runner --images` instead. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_tag.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_tag.md new file mode 100644 index 000000000000..3f1615e296fc --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_tag.md @@ -0,0 +1,11 @@ +# docker model tag + +<!---MARKER_GEN_START--> +Tag a model + + +<!---MARKER_GEN_END--> + +## Description + +Specify a particular version or variant of the model. If no tag is provided, Docker defaults to `latest`. diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_uninstall-runner.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_uninstall-runner.md new file mode 100644 index 000000000000..8beb8744fd48 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_uninstall-runner.md @@ -0,0 +1,16 @@ +# docker model uninstall-runner + +<!---MARKER_GEN_START--> +Uninstall Docker Model Runner (Docker Engine only) + +### Options + +| Name | Type | Default | Description | +|:------------|:---------|:--------|:----------------------------------------------------| +| `--backend` | `string` | | Uninstall a deferred backend (e.g. vllm, diffusers) | +| `--images` | `bool` | | Remove docker/model-runner images | +| `--models` | `bool` | | Remove model storage volume | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_unload.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_unload.md new file mode 100644 index 000000000000..17060c649651 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_unload.md @@ -0,0 +1,19 @@ +# docker model unload + +<!---MARKER_GEN_START--> +Unload running models + +### Aliases + +`docker model unload`, `docker model stop` + +### Options + +| Name | Type | Default | Description | +|:------------|:---------|:--------|:---------------------------| +| `--all` | `bool` | | Unload all running models | +| `--backend` | `string` | | Optional backend to target | + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_version.md b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_version.md new file mode 100644 index 000000000000..eb32c61fd979 --- /dev/null +++ b/_vendor/github.com/docker/model-runner/cmd/cli/docs/reference/model_version.md @@ -0,0 +1,8 @@ +# docker model version + +<!---MARKER_GEN_START--> +Show the Docker Model Runner version + + +<!---MARKER_GEN_END--> + diff --git a/_vendor/github.com/docker/scout-cli/docs/docker_scout_attestation_add.yaml b/_vendor/github.com/docker/scout-cli/docs/docker_scout_attestation_add.yaml deleted file mode 100644 index f6850825358b..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/docker_scout_attestation_add.yaml +++ /dev/null @@ -1,54 +0,0 @@ -command: docker scout attestation add -aliases: docker scout attestation add, docker scout attest add -short: Add attestation to image -long: The docker scout attestation add command adds attestations to images. -usage: docker scout attestation add OPTIONS IMAGE [IMAGE...] -pname: docker scout attestation -plink: docker_scout_attestation.yaml -options: - - option: file - value_type: stringSlice - default_value: '[]' - description: File location of attestations to attach - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: predicate-type - value_type: string - description: Predicate-type for attestations - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -inherited_options: - - option: debug - value_type: bool - default_value: "false" - description: Debug messages - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: verbose-debug - value_type: bool - default_value: "false" - description: Verbose debug - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -deprecated: false -experimental: false -experimentalcli: true -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/scout-cli/docs/docker_scout_docker-cli-plugin-hooks.yaml b/_vendor/github.com/docker/scout-cli/docs/docker_scout_docker-cli-plugin-hooks.yaml deleted file mode 100644 index a36ba75bb9b2..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/docker_scout_docker-cli-plugin-hooks.yaml +++ /dev/null @@ -1,33 +0,0 @@ -command: docker scout docker-cli-plugin-hooks -short: runs the plugins hooks -long: runs the plugins hooks -usage: docker scout docker-cli-plugin-hooks -pname: docker scout -plink: docker_scout.yaml -inherited_options: - - option: debug - value_type: bool - default_value: "false" - description: Debug messages - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: verbose-debug - value_type: bool - default_value: "false" - description: Verbose debug - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -deprecated: false -experimental: false -experimentalcli: false -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/scout-cli/docs/docker_scout_policy.yaml b/_vendor/github.com/docker/scout-cli/docs/docker_scout_policy.yaml deleted file mode 100644 index 077907ee2b08..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/docker_scout_policy.yaml +++ /dev/null @@ -1,140 +0,0 @@ -command: docker scout policy -short: | - Evaluate policies against an image and display the policy evaluation results (experimental) -long: |- - The `docker scout policy` command evaluates policies against an image. - The image analysis is uploaded to Docker Scout where policies get evaluated. - - The policy evaluation results may take a few minutes to become available. -usage: docker scout policy [IMAGE | REPO] -pname: docker scout -plink: docker_scout.yaml -options: - - option: env - value_type: string - description: Name of the environment to compare to - deprecated: true - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: exit-code - shorthand: e - value_type: bool - default_value: "false" - description: Return exit code '2' if policies are not met, '0' otherwise - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: only-policy - value_type: stringSlice - default_value: '[]' - description: Comma separated list of policies to evaluate - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: org - value_type: string - description: Namespace of the Docker organization - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: output - shorthand: o - value_type: string - description: Write the report to a file - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: platform - value_type: string - description: Platform of image to pull policy results from - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: to-env - value_type: string - description: Name of the environment to compare to - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: to-latest - value_type: bool - default_value: "false" - description: Latest image processed to compare to - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -inherited_options: - - option: debug - value_type: bool - default_value: "false" - description: Debug messages - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: verbose-debug - value_type: bool - default_value: "false" - description: Verbose debug - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -examples: |- - ### Evaluate policies against an image and display the results - - ```console - $ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 - ``` - - ### Evaluate policies against an image for a specific organization - - ```console - $ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --org dockerscoutpolicy - ``` - - ### Evaluate policies against an image with a specific platform - - ```console - $ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --platform linux/amd64 - ``` - - ### Compare policy results for a repository in a specific environment - - ```console - $ docker scout policy dockerscoutpolicy/customers-api-service --to-env production - ``` -deprecated: false -experimental: false -experimentalcli: true -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/scout-cli/docs/docker_scout_watch.yaml b/_vendor/github.com/docker/scout-cli/docs/docker_scout_watch.yaml deleted file mode 100644 index 30b6dbef4718..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/docker_scout_watch.yaml +++ /dev/null @@ -1,161 +0,0 @@ -command: docker scout watch -short: | - Watch repositories in a registry and push images and indexes to Docker Scout (experimental) -long: |- - The `docker scout watch` command watches repositories in a registry - and pushes images or analysis results to Docker Scout. -usage: docker scout watch -pname: docker scout -plink: docker_scout.yaml -options: - - option: all-images - value_type: bool - default_value: "false" - description: | - Push all images instead of only the ones pushed during the watch command is running - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: dry-run - value_type: bool - default_value: "false" - description: Watch images and prepare them, but do not push them - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: interval - value_type: int64 - default_value: "60" - description: Interval in seconds between checks - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: org - value_type: string - description: Namespace of the Docker organization to which image will be pushed - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: refresh-registry - value_type: bool - default_value: "false" - description: | - Refresh the list of repositories of a registry at every run. Only with --registry. - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: registry - value_type: string - description: Registry to watch - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: repository - value_type: stringSlice - default_value: '[]' - description: Repository to watch - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: sbom - value_type: bool - default_value: "true" - description: Create and upload SBOMs - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: tag - value_type: stringSlice - default_value: '[]' - description: Regular expression to match tags to watch - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: workers - value_type: int - default_value: "3" - description: Number of concurrent workers - deprecated: false - hidden: false - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -inherited_options: - - option: debug - value_type: bool - default_value: "false" - description: Debug messages - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false - - option: verbose-debug - value_type: bool - default_value: "false" - description: Verbose debug - deprecated: false - hidden: true - experimental: false - experimentalcli: false - kubernetes: false - swarm: false -examples: |- - ### Watch for new images from two repositories and push them - - ```console - $ docker scout watch --org my-org --repository registry-1.example.com/repo-1 --repository registry-2.example.com/repo-2 - ``` - - ### Only push images with a specific tag - - ```console - $ docker scout watch --org my-org --repository registry.example.com/my-service --tag latest - ``` - - ### Watch all repositories of a registry - - ```console - $ docker scout watch --org my-org --registry registry.example.com - ``` - - ### Push all images and not just the new ones - - ```console - $ docker scout watch--org my-org --repository registry.example.com/my-service --all-images - ``` -deprecated: false -experimental: false -experimentalcli: true -kubernetes: false -swarm: false - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout.md b/_vendor/github.com/docker/scout-cli/docs/scout.md deleted file mode 100644 index aeac72b4c6d1..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout.md +++ /dev/null @@ -1,37 +0,0 @@ -# docker scout - -``` -docker scout COMMAND -``` - -<!---MARKER_GEN_START--> -Command line tool for Docker Scout - -### Subcommands - -| Name | Description | -|:--------------------------------------------------------------|:--------------------------------------------------------------------------------------------| -| [`attestation`](scout_attestation.md) | Manage attestations on image indexes | -| [`cache`](scout_cache.md) | Manage Docker Scout cache and temporary files | -| [`compare`](scout_compare.md) | Compare two images and display differences (experimental) | -| [`config`](scout_config.md) | Manage Docker Scout configuration | -| [`cves`](scout_cves.md) | Display CVEs identified in a software artifact | -| [`docker-cli-plugin-hooks`](scout_docker-cli-plugin-hooks.md) | runs the plugins hooks | -| [`enroll`](scout_enroll.md) | Enroll an organization with Docker Scout | -| [`environment`](scout_environment.md) | Manage environments (experimental) | -| [`help`](scout_help.md) | Display information about the available commands | -| [`integration`](scout_integration.md) | Commands to list, configure, and delete Docker Scout integrations | -| [`policy`](scout_policy.md) | Evaluate policies against an image and display the policy evaluation results (experimental) | -| [`push`](scout_push.md) | Push an image or image index to Docker Scout | -| [`quickview`](scout_quickview.md) | Quick overview of an image | -| [`recommendations`](scout_recommendations.md) | Display available base image updates and remediation recommendations | -| [`repo`](scout_repo.md) | Commands to list, enable, and disable Docker Scout on repositories | -| [`sbom`](scout_sbom.md) | Generate or display SBOM of an image | -| [`stream`](scout_stream.md) | Manage streams (experimental) | -| [`version`](scout_version.md) | Show Docker Scout version information | -| [`watch`](scout_watch.md) | Watch repositories in a registry and push images and indexes to Docker Scout (experimental) | - - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_attestation.md b/_vendor/github.com/docker/scout-cli/docs/scout_attestation.md deleted file mode 100644 index d4f6bc58277e..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_attestation.md +++ /dev/null @@ -1,19 +0,0 @@ -# docker scout attestation - -<!---MARKER_GEN_START--> -Manage attestations on image indexes - -### Aliases - -`docker scout attestation`, `docker scout attest` - -### Subcommands - -| Name | Description | -|:----------------------------------|:-------------------------| -| [`add`](scout_attestation_add.md) | Add attestation to image | - - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_attestation_add.md b/_vendor/github.com/docker/scout-cli/docs/scout_attestation_add.md deleted file mode 100644 index 5f09c0fffda7..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_attestation_add.md +++ /dev/null @@ -1,19 +0,0 @@ -# docker scout attestation add - -<!---MARKER_GEN_START--> -Add attestation to image - -### Aliases - -`docker scout attestation add`, `docker scout attest add` - -### Options - -| Name | Type | Default | Description | -|:-------------------|:--------------|:--------|:----------------------------------------| -| `--file` | `stringSlice` | | File location of attestations to attach | -| `--predicate-type` | `string` | | Predicate-type for attestations | - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_cache.md b/_vendor/github.com/docker/scout-cli/docs/scout_cache.md deleted file mode 100644 index 9bb212dd3db1..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_cache.md +++ /dev/null @@ -1,16 +0,0 @@ -# docker scout cache - -<!---MARKER_GEN_START--> -Manage Docker Scout cache and temporary files - -### Subcommands - -| Name | Description | -|:--------------------------------|:--------------------------------| -| [`df`](scout_cache_df.md) | Show Docker Scout disk usage | -| [`prune`](scout_cache_prune.md) | Remove temporary or cached data | - - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_cache_df.md b/_vendor/github.com/docker/scout-cli/docs/scout_cache_df.md deleted file mode 100644 index 71dcf99560bf..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_cache_df.md +++ /dev/null @@ -1,52 +0,0 @@ -# docker scout cache df - -<!---MARKER_GEN_START--> -Show Docker Scout disk usage - - -<!---MARKER_GEN_END--> - -## Description - -Docker Scout uses a temporary cache storage for generating image SBOMs. -The cache helps avoid regenerating or fetching resources unnecessarily. - -This `docker scout cache df` command shows the cached data on the host. -Each cache entry is identified by the digest of the image. - -You can use the `docker scout cache prune` command to delete cache data at any time. - -## Examples - -### List temporary and cache files - -```console -$ docker scout cache df -Docker Scout temporary directory to generate SBOMs is located at: - /var/folders/dw/d6h9w2sx6rv3lzwwgrnx7t5h0000gp/T/docker-scout - this path can be configured using the DOCKER_SCOUT_CACHE_DIR environment variable - - Image Digest │ Size -──────────────────────────────────────────────────────────────────────────┼──────── - sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1847dde0e0889d2bff │ 21 kB - -Total: 21 kB - - -Docker Scout cached SBOMs are located at: - /Users/user/.docker/scout/sbom - - Image Digest │ Size of SBOM -──────────────────────────────────────────────────────────────────────────┼─────────────── - sha256:02bb6f428431fbc2809c5d1b41eab5a68350194fb508869a33cb1af4444c9b11 │ 42 kB - sha256:03fc002fe4f370463a8f04d3a288cdffa861e462fc8b5be44ab62b296ad95183 │ 100 kB - sha256:088134dd33e4a2997480a1488a41c11abebda465da5cf7f305a0ecf8ed494329 │ 194 kB - sha256:0b80b2f17aff7ee5bfb135c69d0d6fe34070e89042b7aac73d1abcc79cfe6759 │ 852 kB - sha256:0c9e8abe31a5f17d84d5c85d3853d2f948a4f126421e89e68753591f1b6fedc5 │ 930 kB - sha256:0d49cae0723c8d310e413736b5e91e0c59b605ade2546f6e6ef8f1f3ddc76066 │ 510 kB - sha256:0ef04748d071c2e631bb3edce8f805cb5512e746b682c83fdae6d8c0b243280b │ 1.0 MB - sha256:13fd22925b638bb7d2131914bb8f8b0f5f582bee364aec682d9e7fe722bb486a │ 42 kB - sha256:174c41d4fbc7f63e1f2bb7d2f7837318050406f2f27e5073a84a84f18b48b883 │ 115 kB - -Total: 4 MB -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_cache_prune.md b/_vendor/github.com/docker/scout-cli/docs/scout_cache_prune.md deleted file mode 100644 index 7292884c7dca..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_cache_prune.md +++ /dev/null @@ -1,40 +0,0 @@ -# docker scout cache prune - -<!---MARKER_GEN_START--> -Remove temporary or cached data - -### Options - -| Name | Type | Default | Description | -|:----------------|:-----|:--------|:-------------------------------| -| `-f`, `--force` | | | Do not prompt for confirmation | -| `--sboms` | | | Prune cached SBOMs | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout cache prune` command removes temporary data and SBOM cache. - -By default, `docker scout cache prune` only deletes temporary data. -To delete temporary data and clear the SBOM cache, use the `--sboms` flag. - -## Examples - -### Delete temporary data - -```console -$ docker scout cache prune -? Are you sure to delete all temporary data? Yes - ✓ temporary data deleted -``` - -### Delete temporary _and_ cache data - -```console -$ docker scout cache prune --sboms -? Are you sure to delete all temporary data and all cached SBOMs? Yes - ✓ temporary data deleted - ✓ cached SBOMs deleted -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_compare.md b/_vendor/github.com/docker/scout-cli/docs/scout_compare.md deleted file mode 100644 index f25aa8635501..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_compare.md +++ /dev/null @@ -1,110 +0,0 @@ -# docker scout compare - -<!---MARKER_GEN_START--> -Compare two images and display differences (experimental) - -### Aliases - -`docker scout compare`, `docker scout diff` - -### Options - -| Name | Type | Default | Description | -|:----------------------|:--------------|:--------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `-x`, `--exit-on` | `stringSlice` | | Comma separated list of conditions to fail the action step if worse, options are: vulnerability, policy | -| `--format` | `string` | `text` | Output format of the generated vulnerability report:<br>- text: default output, plain text with or without colors depending on the terminal<br>- markdown: Markdown output<br> | -| `--hide-policies` | | | Hide policy status from the output | -| `--ignore-base` | | | Filter out CVEs introduced from base image | -| `--ignore-unchanged` | | | Filter out unchanged packages | -| `--multi-stage` | | | Show packages from multi-stage Docker builds | -| `--only-fixed` | | | Filter to fixable CVEs | -| `--only-package-type` | `stringSlice` | | Comma separated list of package types (like apk, deb, rpm, npm, pypi, golang, etc) | -| `--only-policy` | `stringSlice` | | Comma separated list of policies to evaluate | -| `--only-severity` | `stringSlice` | | Comma separated list of severities (critical, high, medium, low, unspecified) to filter CVEs by | -| `--only-stage` | `stringSlice` | | Comma separated list of multi-stage Docker build stage names | -| `--only-unfixed` | | | Filter to unfixed CVEs | -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to analyze | -| `--ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive | -| `--to` | `string` | | Image, directory, or archive to compare to | -| `--to-env` | `string` | | Name of environment to compare to | -| `--to-latest` | | | Latest image processed to compare to | -| `--to-ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive. | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout compare` command analyzes two images and displays a comparison. - -> This command is **experimental** and its behaviour might change in the future - -The intended use of this command is to compare two versions of the same image. -For instance, when a new image is built and compared to the version running in production. - -If no image is specified, the most recently built image is used -as a comparison target. - -The following artifact types are supported: - -- Images -- OCI layout directories -- Tarball archives, as created by `docker save` -- Local directory or file - -By default, the tool expects an image reference, such as: - -- `redis` -- `curlimages/curl:7.87.0` -- `mcr.microsoft.com/dotnet/runtime:7.0` - -If the artifact you want to analyze is an OCI directory, a tarball archive, a local file or directory, -or if you want to control from where the image will be resolved, you must prefix the reference with one of the following: - -- `image://` (default) use a local image, or fall back to a registry lookup -- `local://` use an image from the local image store (don't do a registry lookup) -- `registry://` use an image from a registry (don't use a local image) -- `oci-dir://` use an OCI layout directory -- `archive://` use a tarball archive, as created by `docker save` -- `fs://` use a local directory or file -- `sbom://` SPDX file or in-toto attestation file with SPDX predicate or `syft` json SBOM file - -## Examples - -### Compare the most recently built image to the latest tag - -```console -$ docker scout compare --to namespace/repo:latest -``` - -### Compare local build to the same tag from the registry - -```console -$ docker scout compare local://namespace/repo:latest --to registry://namespace/repo:latest -``` - -### Ignore base images - -```console -$ docker scout compare --ignore-base --to namespace/repo:latest namespace/repo:v1.2.3-pre -``` - -### Generate a markdown output - -```console -$ docker scout compare --format markdown --to namespace/repo:latest namespace/repo:v1.2.3-pre -``` - -### Only compare maven packages and only display critical vulnerabilities for maven packages - -```console -$ docker scout compare --only-package-type maven --only-severity critical --to namespace/repo:latest namespace/repo:v1.2.3-pre -``` - -### Show all policy results for both images - -```console -docker scout compare --to namespace/repo:latest namespace/repo:v1.2.3-pre -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_config.md b/_vendor/github.com/docker/scout-cli/docs/scout_config.md deleted file mode 100644 index 1a6e8b69c9a3..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_config.md +++ /dev/null @@ -1,38 +0,0 @@ -# docker scout config - -<!---MARKER_GEN_START--> -Manage Docker Scout configuration - - -<!---MARKER_GEN_END--> - -## Description - -`docker scout config` allows you to list, get and set Docker Scout configuration. - -Available configuration key: - -- `organization`: Namespace of the Docker organization to be used by default. - -## Examples - -### List existing configuration - -```console -$ docker scout config -organization=my-org-namespace -``` - -### Print configuration value - -```console -$ docker scout config organization -my-org-namespace -``` - -### Set configuration value - -```console -$ docker scout config organization my-org-namespace - ✓ Successfully set organization to my-org-namespace -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_cves.md b/_vendor/github.com/docker/scout-cli/docs/scout_cves.md deleted file mode 100644 index bdb7f82921d0..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_cves.md +++ /dev/null @@ -1,271 +0,0 @@ -# docker scout cves - -``` -docker scout cves [OPTIONS] [IMAGE|DIRECTORY|ARCHIVE] -``` - -<!---MARKER_GEN_START--> -Display CVEs identified in a software artifact - -### Options - -| Name | Type | Default | Description | -|:-----------------------|:--------------|:-----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `--details` | | | Print details on default text output | -| `--env` | `string` | | Name of environment | -| [`--epss`](#epss) | | | Display the EPSS scores and organize the package's CVEs according to their EPSS score | -| `--epss-percentile` | `float32` | `0` | Exclude CVEs with EPSS scores less than the specified percentile (0 to 1) | -| `--epss-score` | `float32` | `0` | Exclude CVEs with EPSS scores less than the specified value (0 to 1) | -| `-e`, `--exit-code` | | | Return exit code '2' if vulnerabilities are detected | -| `--format` | `string` | `packages` | Output format of the generated vulnerability report:<br>- packages: default output, plain text with vulnerabilities grouped by packages<br>- sarif: json Sarif output<br>- spdx: json SPDX output<br>- gitlab: json GitLab output<br>- markdown: markdown output (including some html tags like collapsible sections)<br>- sbom: json SBOM output<br> | -| `--ignore-base` | | | Filter out CVEs introduced from base image | -| `--ignore-suppressed` | | | Filter CVEs found in Scout exceptions based on the specified exception scope | -| `--locations` | | | Print package locations including file paths and layer diff_id | -| `--multi-stage` | | | Show packages from multi-stage Docker builds | -| `--only-base` | | | Only show CVEs introduced by the base image | -| `--only-cisa-kev` | | | Filter to CVEs listed in the CISA KEV catalog | -| `--only-cve-id` | `stringSlice` | | Comma separated list of CVE ids (like CVE-2021-45105) to search for | -| `--only-fixed` | | | Filter to fixable CVEs | -| `--only-metric` | `stringSlice` | | Comma separated list of CVSS metrics (like AV:N or PR:L) to filter CVEs by | -| `--only-package` | `stringSlice` | | Comma separated regular expressions to filter packages by | -| `--only-package-type` | `stringSlice` | | Comma separated list of package types (like apk, deb, rpm, npm, pypi, golang, etc) | -| `--only-severity` | `stringSlice` | | Comma separated list of severities (critical, high, medium, low, unspecified) to filter CVEs by | -| `--only-stage` | `stringSlice` | | Comma separated list of multi-stage Docker build stage names | -| `--only-unfixed` | | | Filter to unfixed CVEs | -| `--only-vex-affected` | | | Filter CVEs by VEX statements with status not affected | -| `--only-vuln-packages` | | | When used with --format=only-packages ignore packages with no vulnerabilities | -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to analyze | -| `--ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive | -| `--vex-author` | `stringSlice` | | List of VEX statement authors to accept | -| `--vex-location` | `stringSlice` | | File location of directory or file containing VEX statements | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout cves` command analyzes a software artifact for vulnerabilities. - -If no image is specified, the most recently built image is used. - -The following artifact types are supported: - -- Images -- OCI layout directories -- Tarball archives, as created by `docker save` -- Local directory or file - -By default, the tool expects an image reference, such as: - -- `redis` -- `curlimages/curl:7.87.0` -- `mcr.microsoft.com/dotnet/runtime:7.0` - -If the artifact you want to analyze is an OCI directory, a tarball archive, a local file or directory, -or if you want to control from where the image will be resolved, you must prefix the reference with one of the following: - -- `image://` (default) use a local image, or fall back to a registry lookup -- `local://` use an image from the local image store (don't do a registry lookup) -- `registry://` use an image from a registry (don't use a local image) -- `oci-dir://` use an OCI layout directory -- `archive://` use a tarball archive, as created by `docker save` -- `fs://` use a local directory or file -- `sbom://` SPDX file or in-toto attestation file with SPDX predicate or `syft` json SBOM file - In case of `sbom://` prefix, if the file is not defined then it will try to read it from the standard input. - -## Examples - -### Display vulnerabilities grouped by package - -```console -$ docker scout cves alpine -Analyzing image alpine -✓ Image stored for indexing -✓ Indexed 18 packages -✓ No vulnerable package detected -``` - -### Display vulnerabilities from a `docker save` tarball - -```console -$ docker save alpine > alpine.tar - -$ docker scout cves archive://alpine.tar -Analyzing archive alpine.tar -✓ Archive read -✓ SBOM of image already cached, 18 packages indexed -✓ No vulnerable package detected -``` - -### Display vulnerabilities from an OCI directory - -```console -$ skopeo copy --override-os linux docker://alpine oci:alpine - -$ docker scout cves oci-dir://alpine -Analyzing OCI directory alpine -✓ OCI directory read -✓ Image stored for indexing -✓ Indexed 19 packages -✓ No vulnerable package detected -``` - -### Display vulnerabilities from the current directory - -```console -$ docker scout cves fs://. -``` - -### Export vulnerabilities to a SARIF JSON file - -```console -$ docker scout cves --format sarif --output alpine.sarif.json alpine -Analyzing image alpine -✓ SBOM of image already cached, 18 packages indexed -✓ No vulnerable package detected -✓ Report written to alpine.sarif.json -``` - -### Display markdown output - -The following example shows how to generate the vulnerability report as markdown. - -```console -$ docker scout cves --format markdown alpine -✓ Pulled -✓ SBOM of image already cached, 19 packages indexed -✗ Detected 1 vulnerable package with 3 vulnerabilities -<h2>:mag: Vulnerabilities of <code>alpine</code></h2> - -<details open="true"><summary>:package: Image Reference</strong> <code>alpine</code></summary> -<table> -<tr><td>digest</td><td><code>sha256:e3bd82196e98898cae9fe7fbfd6e2436530485974dc4fb3b7ddb69134eda2407</code></td><tr><tr><td>vulnerabilities</td><td><img alt="critical: 0" src="https://img.shields.io/badge/critical-0-lightgrey"/> <img alt="high: 0" src="https://img.shields.io/badge/high-0-lightgrey"/> <img alt="medium: 2" src="https://img.shields.io/badge/medium-2-fbb552"/> <img alt="low: 0" src="https://img.shields.io/badge/low-0-lightgrey"/> <img alt="unspecified: 1" src="https://img.shields.io/badge/unspecified-1-lightgrey"/></td></tr> -<tr><td>platform</td><td>linux/arm64</td></tr> -<tr><td>size</td><td>3.3 MB</td></tr> -<tr><td>packages</td><td>19</td></tr> -</table> -</details></table> -</details> -... -``` - -### List all vulnerable packages of a certain type - -The following example shows how to generate a list of packages, only including -packages of the specified type, and only showing packages that are vulnerable. - -```console -$ docker scout cves --format only-packages --only-package-type golang --only-vuln-packages golang:1.18.0 -✓ Pulled -✓ SBOM of image already cached, 296 packages indexed -✗ Detected 1 vulnerable package with 40 vulnerabilities - -Name Version Type Vulnerabilities -─────────────────────────────────────────────────────────── -stdlib 1.18 golang 2C 29H 8M 1L -``` - -### <a name="epss"></a> Display EPSS score (--epss) - -The `--epss` flag adds [Exploit Prediction Scoring System (EPSS)](https://www.first.org/epss/) -scores to the `docker scout cves` output. EPSS scores are estimates of the likelihood (probability) -that a software vulnerability will be exploited in the wild in the next 30 days. -The higher the score, the greater the probability that a vulnerability will be exploited. - -```console {hl_lines="13,14"} -$ docker scout cves --epss nginx - ✓ Provenance obtained from attestation - ✓ SBOM obtained from attestation, 232 packages indexed - ✓ Pulled - ✗ Detected 23 vulnerable packages with a total of 39 vulnerabilities - -... - - ✗ HIGH CVE-2023-52425 - https://scout.docker.com/v/CVE-2023-52425 - Affected range : >=2.5.0-1 - Fixed version : not fixed - EPSS Score : 0.000510 - EPSS Percentile : 0.173680 -``` - -- `EPSS Score` is a floating point number between 0 and 1 representing the probability of exploitation in the wild in the next 30 days (following score publication). -- `EPSS Percentile` is the percentile of the current score, the proportion of all scored vulnerabilities with the same or a lower EPSS score. - -You can use the `--epss-score` and `--epss-percentile` flags to filter the output -of `docker scout cves` based on these scores. For example, -to only show vulnerabilities with an EPSS score higher than 0.5: - -```console -$ docker scout cves --epss --epss-score 0.5 nginx - ✓ SBOM of image already cached, 232 packages indexed - ✓ EPSS scores for 2024-03-01 already cached - ✗ Detected 1 vulnerable package with 1 vulnerability - -... - - ✗ LOW CVE-2023-44487 - https://scout.docker.com/v/CVE-2023-44487 - Affected range : >=1.22.1-9 - Fixed version : not fixed - EPSS Score : 0.705850 - EPSS Percentile : 0.979410 -``` - -EPSS scores are updated on a daily basis. -By default, the latest available score is displayed. -You can use the `--epss-date` flag to manually specify a date -in the format `yyyy-mm-dd` for fetching EPSS scores. - -```console -$ docker scout cves --epss --epss-date 2024-01-02 nginx -``` - -### List vulnerabilities from an SPDX file - -The following example shows how to generate a list of vulnerabilities from an SPDX file using `syft`. - -```console -$ syft -o spdx-json alpine:3.16.1 | docker scout cves sbom:// - ✔ Pulled image - ✔ Loaded image alpine:3.16.1 - ✔ Parsed image sha256:3d81c46cd8756ddb6db9ec36fa06a6fb71c287fb265232ba516739dc67a5f07d - ✔ Cataloged contents 274a317d88b54f9e67799244a1250cad3fe7080f45249fa9167d1f871218d35f - ├── ✔ Packages [14 packages] - ├── ✔ File digests [75 files] - ├── ✔ File metadata [75 locations] - └── ✔ Executables [16 executables] - ✗ Detected 2 vulnerable packages with a total of 11 vulnerabilities - - -## Overview - - │ Analyzed SBOM -────────────────────┼────────────────────────────── - Target │ <stdin> - digest │ 274a317d88b5 - platform │ linux/arm64 - vulnerabilities │ 1C 2H 8M 0L - packages │ 15 - - -## Packages and Vulnerabilities - - 1C 0H 0M 0L zlib 1.2.12-r1 -pkg:apk/alpine/zlib@1.2.12-r1?arch=aarch64&distro=alpine-3.16.1 - - ✗ CRITICAL CVE-2022-37434 - https://scout.docker.com/v/CVE-2022-37434 - Affected range : <1.2.12-r2 - Fixed version : 1.2.12-r2 - - ... - -11 vulnerabilities found in 2 packages - CRITICAL 1 - HIGH 2 - MEDIUM 8 - LOW 0 -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_docker-cli-plugin-hooks.md b/_vendor/github.com/docker/scout-cli/docs/scout_docker-cli-plugin-hooks.md deleted file mode 100644 index 8fbcd0420366..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_docker-cli-plugin-hooks.md +++ /dev/null @@ -1,8 +0,0 @@ -# docker scout docker-cli-plugin-hooks - -<!---MARKER_GEN_START--> -runs the plugins hooks - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_enroll.md b/_vendor/github.com/docker/scout-cli/docs/scout_enroll.md deleted file mode 100644 index b60fd3471f6e..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_enroll.md +++ /dev/null @@ -1,11 +0,0 @@ -# docker scout enroll - -<!---MARKER_GEN_START--> -Enroll an organization with Docker Scout - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout enroll` command enrolls an organization with Docker Scout. diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_environment.md b/_vendor/github.com/docker/scout-cli/docs/scout_environment.md deleted file mode 100644 index 4f019ff35cef..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_environment.md +++ /dev/null @@ -1,58 +0,0 @@ -# docker scout environment - -<!---MARKER_GEN_START--> -Manage environments (experimental) - -### Aliases - -`docker scout environment`, `docker scout env` - -### Options - -| Name | Type | Default | Description | -|:-----------------|:---------|:--------|:-------------------------------------| -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to record | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout environment` command lists the environments. -If you pass an image reference, the image is recorded to the specified environment. - -Once recorded, environments can be referred to by their name. For example, -you can refer to the `production` environment with the `docker scout compare` -command as follows: - -```console -$ docker scout compare --to-env production -``` - -## Examples - -### List existing environments - -```console -$ docker scout environment -prod -staging -``` - -### List images of an environment - -```console -$ docker scout environment staging -namespace/repo:tag@sha256:9a4df4fadc9bbd44c345e473e0688c2066a6583d4741679494ba9228cfd93e1b -namespace/other-repo:tag@sha256:0001d6ce124855b0a158569c584162097fe0ca8d72519067c2c8e3ce407c580f -``` - -### Record an image to an environment, for a specific platform - -```console -$ docker scout environment staging namespace/repo:stage-latest --platform linux/amd64 -✓ Pulled -✓ Successfully recorded namespace/repo:stage-latest in environment staging -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_help.md b/_vendor/github.com/docker/scout-cli/docs/scout_help.md deleted file mode 100644 index ec152c6aaf9f..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_help.md +++ /dev/null @@ -1,8 +0,0 @@ -# docker scout help - -<!---MARKER_GEN_START--> -Display information about the available commands - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_integration.md b/_vendor/github.com/docker/scout-cli/docs/scout_integration.md deleted file mode 100644 index 9a2def3a0b8f..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_integration.md +++ /dev/null @@ -1,17 +0,0 @@ -# docker scout integration - -<!---MARKER_GEN_START--> -Commands to list, configure, and delete Docker Scout integrations - -### Subcommands - -| Name | Description | -|:----------------------------------------------|:----------------------------------------------------| -| [`configure`](scout_integration_configure.md) | Configure or update a new integration configuration | -| [`delete`](scout_integration_delete.md) | Delete a new integration configuration | -| [`list`](scout_integration_list.md) | Integration Docker Scout | - - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_integration_configure.md b/_vendor/github.com/docker/scout-cli/docs/scout_integration_configure.md deleted file mode 100644 index 521193ae3bce..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_integration_configure.md +++ /dev/null @@ -1,16 +0,0 @@ -# docker scout integration configure - -<!---MARKER_GEN_START--> -Configure or update a new integration configuration - -### Options - -| Name | Type | Default | Description | -|:--------------|:--------------|:--------|:-------------------------------------------------------------| -| `--name` | `string` | | Name of integration configuration to create | -| `--org` | `string` | | Namespace of the Docker organization | -| `--parameter` | `stringSlice` | | Integration parameters in the form of --parameter NAME=VALUE | - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_integration_delete.md b/_vendor/github.com/docker/scout-cli/docs/scout_integration_delete.md deleted file mode 100644 index 0a68c8adcaf3..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_integration_delete.md +++ /dev/null @@ -1,15 +0,0 @@ -# docker scout integration delete - -<!---MARKER_GEN_START--> -Delete a new integration configuration - -### Options - -| Name | Type | Default | Description | -|:---------|:---------|:--------|:--------------------------------------------| -| `--name` | `string` | | Name of integration configuration to delete | -| `--org` | `string` | | Namespace of the Docker organization | - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_integration_list.md b/_vendor/github.com/docker/scout-cli/docs/scout_integration_list.md deleted file mode 100644 index 67b39c59fc57..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_integration_list.md +++ /dev/null @@ -1,15 +0,0 @@ -# docker scout integration list - -<!---MARKER_GEN_START--> -Integration Docker Scout - -### Options - -| Name | Type | Default | Description | -|:---------|:---------|:--------|:------------------------------------------| -| `--name` | `string` | | Name of integration configuration to list | -| `--org` | `string` | | Namespace of the Docker organization | - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_policy.md b/_vendor/github.com/docker/scout-cli/docs/scout_policy.md deleted file mode 100644 index 46735c018d74..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_policy.md +++ /dev/null @@ -1,52 +0,0 @@ -# docker scout policy - -<!---MARKER_GEN_START--> -Evaluate policies against an image and display the policy evaluation results (experimental) - -### Options - -| Name | Type | Default | Description | -|:--------------------|:--------------|:--------|:------------------------------------------------------------| -| `-e`, `--exit-code` | | | Return exit code '2' if policies are not met, '0' otherwise | -| `--only-policy` | `stringSlice` | | Comma separated list of policies to evaluate | -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to pull policy results from | -| `--to-env` | `string` | | Name of the environment to compare to | -| `--to-latest` | | | Latest image processed to compare to | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout policy` command evaluates policies against an image. -The image analysis is uploaded to Docker Scout where policies get evaluated. - -The policy evaluation results may take a few minutes to become available. - -## Examples - -### Evaluate policies against an image and display the results - -```console -$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 -``` - -### Evaluate policies against an image for a specific organization - -```console -$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --org dockerscoutpolicy -``` - -### Evaluate policies against an image with a specific platform - -```console -$ docker scout policy dockerscoutpolicy/customers-api-service:0.0.1 --platform linux/amd64 -``` - -### Compare policy results for a repository in a specific environment - -```console -$ docker scout policy dockerscoutpolicy/customers-api-service --to-env production -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_push.md b/_vendor/github.com/docker/scout-cli/docs/scout_push.md deleted file mode 100644 index 09e3397e5c76..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_push.md +++ /dev/null @@ -1,31 +0,0 @@ -# docker scout push - -<!---MARKER_GEN_START--> -Push an image or image index to Docker Scout - -### Options - -| Name | Type | Default | Description | -|:-----------------|:---------|:--------|:-------------------------------------------------------------------| -| `--author` | `string` | | Name of the author of the image | -| `--dry-run` | | | Do not push the image but process it | -| `--org` | `string` | | Namespace of the Docker organization to which image will be pushed | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to be pushed | -| `--sbom` | | | Create and upload SBOMs | -| `--timestamp` | `string` | | Timestamp of image or tag creation | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout push` command lets you push an image or analysis result to Docker Scout. - -## Examples - -### Push an image to Docker Scout - -```console -$ docker scout push --org my-org registry.example.com/repo:tag -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_quickview.md b/_vendor/github.com/docker/scout-cli/docs/scout_quickview.md deleted file mode 100644 index 3bf752a0cf9b..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_quickview.md +++ /dev/null @@ -1,101 +0,0 @@ -# docker scout quickview - -<!---MARKER_GEN_START--> -Quick overview of an image - -### Aliases - -`docker scout quickview`, `docker scout qv` - -### Options - -| Name | Type | Default | Description | -|:----------------------|:--------------|:--------|:--------------------------------------------------------------------------------------------------------| -| `--env` | `string` | | Name of the environment | -| `--ignore-suppressed` | | | Filter CVEs found in Scout exceptions based on the specified exception scope | -| `--latest` | | | Latest indexed image | -| `--only-policy` | `stringSlice` | | Comma separated list of policies to evaluate | -| `--only-vex-affected` | | | Filter CVEs by VEX statements with status not affected | -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to analyze | -| `--ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive | -| `--vex-author` | `stringSlice` | | List of VEX statement authors to accept | -| `--vex-location` | `stringSlice` | | File location of directory or file containing VEX statements | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout quickview` command displays a quick overview of an image. -It displays a summary of the vulnerabilities in the specified image -and vulnerabilities from the base image. -If available, it also displays base image refresh and update recommendations. - -If no image is specified, the most recently built image is used. - -The following artifact types are supported: - -- Images -- OCI layout directories -- Tarball archives, as created by `docker save` -- Local directory or file - -By default, the tool expects an image reference, such as: - -- `redis` -- `curlimages/curl:7.87.0` -- `mcr.microsoft.com/dotnet/runtime:7.0` - -If the artifact you want to analyze is an OCI directory, a tarball archive, a local file or directory, -or if you want to control from where the image will be resolved, you must prefix the reference with one of the following: - -- `image://` (default) use a local image, or fall back to a registry lookup -- `local://` use an image from the local image store (don't do a registry lookup) -- `registry://` use an image from a registry (don't use a local image) -- `oci-dir://` use an OCI layout directory -- `archive://` use a tarball archive, as created by `docker save` -- `fs://` use a local directory or file -- `sbom://` SPDX file or in-toto attestation file with SPDX predicate or `syft` json SBOM file - In case of `sbom://` prefix, if the file is not defined then it will try to read it from the standard input. - -## Examples - -### Quick overview of an image - -```console -$ docker scout quickview golang:1.19.4 - ...Pulling - ✓ Pulled - ✓ SBOM of image already cached, 278 packages indexed - - Your image golang:1.19.4 │ 5C 3H 6M 63L - Base image buildpack-deps:bullseye-scm │ 5C 1H 3M 48L 6? - Refreshed base image buildpack-deps:bullseye-scm │ 0C 0H 0M 42L - │ -5 -1 -3 -6 -6 - Updated base image buildpack-deps:sid-scm │ 0C 0H 1M 29L - │ -5 -1 -2 -19 -6 -``` - -### Quick overview of the most recently built image - -```console -$ docker scout qv -``` - -### Quick overview from an SPDX file - -```console -$ syft -o spdx-json alpine:3.16.1 | docker scout quickview sbom:// - ✔ Loaded image alpine:3.16.1 - ✔ Parsed image sha256:3d81c46cd8756ddb6db9ec36fa06a6fb71c287fb265232ba516739dc67a5f07d - ✔ Cataloged contents 274a317d88b54f9e67799244a1250cad3fe7080f45249fa9167d1f871218d35f - ├── ✔ Packages [14 packages] - ├── ✔ File digests [75 files] - ├── ✔ File metadata [75 locations] - └── ✔ Executables [16 executables] - - Target │ <stdin> │ 1C 2H 8M 0L - digest │ 274a317d88b5 │ -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_recommendations.md b/_vendor/github.com/docker/scout-cli/docs/scout_recommendations.md deleted file mode 100644 index f1ccdf64feeb..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_recommendations.md +++ /dev/null @@ -1,71 +0,0 @@ -# docker scout recommendations - -<!---MARKER_GEN_START--> -Display available base image updates and remediation recommendations - -### Options - -| Name | Type | Default | Description | -|:-----------------|:---------|:--------|:--------------------------------------------------------------------------------------------------------| -| `--only-refresh` | | | Only display base image refresh recommendations | -| `--only-update` | | | Only display base image update recommendations | -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to analyze | -| `--ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive | -| `--tag` | `string` | | Specify tag | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout recommendations` command display recommendations for base images updates. -It analyzes the image and display recommendations to refresh or update the base image. -For each recommendation it shows a list of benefits, such as -fewer vulnerabilities or smaller image size. - -If no image is specified, the most recently built image is used. - -The following artifact types are supported: - -- Images -- OCI layout directories -- Tarball archives, as created by `docker save` -- Local directory or file - -By default, the tool expects an image reference, such as: - -- `redis` -- `curlimages/curl:7.87.0` -- `mcr.microsoft.com/dotnet/runtime:7.0` - -If the artifact you want to analyze is an OCI directory, a tarball archive, a local file or directory, -or if you want to control from where the image will be resolved, you must prefix the reference with one of the following: - -- `image://` (default) use a local image, or fall back to a registry lookup -- `local://` use an image from the local image store (don't do a registry lookup) -- `registry://` use an image from a registry (don't use a local image) -- `oci-dir://` use an OCI layout directory -- `archive://` use a tarball archive, as created by `docker save` -- `fs://` use a local directory or file - -## Examples - -### Display base image update recommendations - -```console -$ docker scout recommendations golang:1.19.4 -``` - -### Display base image refresh only recommendations - -```console -$ docker scout recommendations --only-refresh golang:1.19.4 -``` - -### Display base image update only recommendations - -```console -$ docker scout recommendations --only-update golang:1.19.4 -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_repo.md b/_vendor/github.com/docker/scout-cli/docs/scout_repo.md deleted file mode 100644 index 1f2038ea757e..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_repo.md +++ /dev/null @@ -1,17 +0,0 @@ -# docker scout repo - -<!---MARKER_GEN_START--> -Commands to list, enable, and disable Docker Scout on repositories - -### Subcommands - -| Name | Description | -|:-----------------------------------|:-------------------------------| -| [`disable`](scout_repo_disable.md) | Disable Docker Scout | -| [`enable`](scout_repo_enable.md) | Enable Docker Scout | -| [`list`](scout_repo_list.md) | List Docker Scout repositories | - - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_repo_disable.md b/_vendor/github.com/docker/scout-cli/docs/scout_repo_disable.md deleted file mode 100644 index 24842906b813..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_repo_disable.md +++ /dev/null @@ -1,43 +0,0 @@ -# docker scout repo disable - -<!---MARKER_GEN_START--> -Disable Docker Scout - -### Options - -| Name | Type | Default | Description | -|:----------------|:---------|:--------|:-----------------------------------------------------------------------------| -| `--all` | | | Disable all repositories of the organization. Can not be used with --filter. | -| `--filter` | `string` | | Regular expression to filter repositories by name | -| `--integration` | `string` | | Name of the integration to use for enabling an image | -| `--org` | `string` | | Namespace of the Docker organization | -| `--registry` | `string` | | Container Registry | - - -<!---MARKER_GEN_END--> - -## Examples - -### Disable a specific repository - -```console -$ docker scout repo disable my/repository -``` - -### Disable all repositories of the organization - -```console -$ docker scout repo disable --all -``` - -### Disable some repositories based on a filter - -```console -$ docker scout repo disable --filter namespace/backend -``` - -### Disable a repository from a specific registry - -```console -$ docker scout repo disable my/repository --registry 123456.dkr.ecr.us-east-1.amazonaws.com -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_repo_enable.md b/_vendor/github.com/docker/scout-cli/docs/scout_repo_enable.md deleted file mode 100644 index 3065a68bccdd..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_repo_enable.md +++ /dev/null @@ -1,43 +0,0 @@ -# docker scout repo enable - -<!---MARKER_GEN_START--> -Enable Docker Scout - -### Options - -| Name | Type | Default | Description | -|:----------------|:---------|:--------|:----------------------------------------------------------------------------| -| `--all` | | | Enable all repositories of the organization. Can not be used with --filter. | -| `--filter` | `string` | | Regular expression to filter repositories by name | -| `--integration` | `string` | | Name of the integration to use for enabling an image | -| `--org` | `string` | | Namespace of the Docker organization | -| `--registry` | `string` | | Container Registry | - - -<!---MARKER_GEN_END--> - -## Examples - -### Enable a specific repository - -```console -$ docker scout repo enable my/repository -``` - -### Enable all repositories of the organization - -```console -$ docker scout repo enable --all -``` - -### Enable some repositories based on a filter - -```console -$ docker scout repo enable --filter namespace/backend -``` - -### Enable a repository from a specific registry - -```console -$ docker scout repo enable my/repository --registry 123456.dkr.ecr.us-east-1.amazonaws.com -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_repo_list.md b/_vendor/github.com/docker/scout-cli/docs/scout_repo_list.md deleted file mode 100644 index 1e2d740574e9..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_repo_list.md +++ /dev/null @@ -1,18 +0,0 @@ -# docker scout repo list - -<!---MARKER_GEN_START--> -List Docker Scout repositories - -### Options - -| Name | Type | Default | Description | -|:------------------|:---------|:--------|:---------------------------------------------------------------------------| -| `--filter` | `string` | | Regular expression to filter repositories by name | -| `--only-disabled` | | | Filter to disabled repositories only | -| `--only-enabled` | | | Filter to enabled repositories only | -| `--only-registry` | `string` | | Filter to a specific registry only:<br>- hub.docker.com<br>- ecr (AWS ECR) | -| `--org` | `string` | | Namespace of the Docker organization | - - -<!---MARKER_GEN_END--> - diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_sbom.md b/_vendor/github.com/docker/scout-cli/docs/scout_sbom.md deleted file mode 100644 index a335d5f83f2e..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_sbom.md +++ /dev/null @@ -1,83 +0,0 @@ -# docker scout sbom - -<!---MARKER_GEN_START--> -Generate or display SBOM of an image - -### Options - -| Name | Type | Default | Description | -|:----------------------|:--------------|:--------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `--format` | `string` | `json` | Output format:<br>- list: list of packages of the image<br>- json: json representation of the SBOM<br>- spdx: spdx representation of the SBOM<br>- cyclonedx: cyclone dx representation of the SBOM | -| `--only-package-type` | `stringSlice` | | Comma separated list of package types (like apk, deb, rpm, npm, pypi, golang, etc)<br>Can only be used with --format list | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to analyze | -| `--ref` | `string` | | Reference to use if the provided tarball contains multiple references.<br>Can only be used with archive | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout sbom` command analyzes a software artifact to generate a -Software Bill Of Materials (SBOM). - -The SBOM contains a list of all packages in the image. -You can use the `--format` flag to filter the output of the command -to display only packages of a specific type. - -If no image is specified, the most recently built image is used. - -The following artifact types are supported: - -- Images -- OCI layout directories -- Tarball archives, as created by `docker save` -- Local directory or file - -By default, the tool expects an image reference, such as: - -- `redis` -- `curlimages/curl:7.87.0` -- `mcr.microsoft.com/dotnet/runtime:7.0` - -If the artifact you want to analyze is an OCI directory, a tarball archive, a local file or directory, -or if you want to control from where the image will be resolved, you must prefix the reference with one of the following: - -- `image://` (default) use a local image, or fall back to a registry lookup -- `local://` use an image from the local image store (don't do a registry lookup) -- `registry://` use an image from a registry (don't use a local image) -- `oci-dir://` use an OCI layout directory -- `archive://` use a tarball archive, as created by `docker save` -- `fs://` use a local directory or file - -## Examples - -### Display the list of packages - -```console -$ docker scout sbom --format list alpine -``` - -### Only display packages of a specific type - -```console - $ docker scout sbom --format list --only-package-type apk alpine -``` - -### Display the full SBOM in JSON format - -```console -$ docker scout sbom alpine -``` - -### Display the full SBOM of the most recently built image - -```console -$ docker scout sbom -``` - -### Write SBOM to a file - -```console -$ docker scout sbom --output alpine.sbom alpine -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_stream.md b/_vendor/github.com/docker/scout-cli/docs/scout_stream.md deleted file mode 100644 index 886df3e6cf04..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_stream.md +++ /dev/null @@ -1,47 +0,0 @@ -# docker scout stream - -<!---MARKER_GEN_START--> -Manage streams (experimental) - -### Options - -| Name | Type | Default | Description | -|:-----------------|:---------|:--------|:-------------------------------------| -| `--org` | `string` | | Namespace of the Docker organization | -| `-o`, `--output` | `string` | | Write the report to a file | -| `--platform` | `string` | | Platform of image to record | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout stream` command lists the deployment streams and records an image to it. - -Once recorded, streams can be referred to by their name, eg. in the `docker scout compare` command using `--to-stream`. - -## Examples - -### List existing streams - -```console -$ %[1]s %[2]s -prod-cluster-123 -stage-cluster-234 -``` - -### List images of a stream - -```console -$ %[1]s %[2]s prod-cluster-123 -namespace/repo:tag@sha256:9a4df4fadc9bbd44c345e473e0688c2066a6583d4741679494ba9228cfd93e1b -namespace/other-repo:tag@sha256:0001d6ce124855b0a158569c584162097fe0ca8d72519067c2c8e3ce407c580f -``` - -### Record an image to a stream, for a specific platform - -```console -$ %[1]s %[2]s stage-cluster-234 namespace/repo:stage-latest --platform linux/amd64 -✓ Pulled -✓ Successfully recorded namespace/repo:stage-latest in stream stage-cluster-234 -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_version.md b/_vendor/github.com/docker/scout-cli/docs/scout_version.md deleted file mode 100644 index 5365123c05d8..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_version.md +++ /dev/null @@ -1,38 +0,0 @@ -# docker scout version - -``` -docker scout version -``` - -<!---MARKER_GEN_START--> -Show Docker Scout version information - - -<!---MARKER_GEN_END--> - -## Examples - -```console -$ docker scout version - - ⢀⢀⢀ ⣀⣀⡤⣔⢖⣖⢽⢝ - ⡠⡢⡣⡣⡣⡣⡣⡣⡢⡀ ⢀⣠⢴⡲⣫⡺⣜⢞⢮⡳⡵⡹⡅ - ⡜⡜⡜⡜⡜⡜⠜⠈⠈ ⠁⠙⠮⣺⡪⡯⣺⡪⡯⣺ - ⢘⢜⢜⢜⢜⠜ ⠈⠪⡳⡵⣹⡪⠇ - ⠨⡪⡪⡪⠂ ⢀⡤⣖⢽⡹⣝⡝⣖⢤⡀ ⠘⢝⢮⡚ _____ _ - ⠱⡱⠁ ⡴⡫⣞⢮⡳⣝⢮⡺⣪⡳⣝⢦ ⠘⡵⠁ / ____| Docker | | - ⠁ ⣸⢝⣕⢗⡵⣝⢮⡳⣝⢮⡺⣪⡳⣣ ⠁ | (___ ___ ___ _ _| |_ - ⣗⣝⢮⡳⣝⢮⡳⣝⢮⡳⣝⢮⢮⡳ \___ \ / __/ _ \| | | | __| - ⢀ ⢱⡳⡵⣹⡪⡳⣝⢮⡳⣝⢮⡳⡣⡏ ⡀ ____) | (_| (_) | |_| | |_ - ⢀⢾⠄ ⠫⣞⢮⡺⣝⢮⡳⣝⢮⡳⣝⠝ ⢠⢣⢂ |_____/ \___\___/ \__,_|\__| - ⡼⣕⢗⡄ ⠈⠓⠝⢮⡳⣝⠮⠳⠙ ⢠⢢⢣⢣ - ⢰⡫⡮⡳⣝⢦⡀ ⢀⢔⢕⢕⢕⢕⠅ - ⡯⣎⢯⡺⣪⡳⣝⢖⣄⣀ ⡀⡠⡢⡣⡣⡣⡣⡣⡃ -⢸⢝⢮⡳⣝⢮⡺⣪⡳⠕⠗⠉⠁ ⠘⠜⡜⡜⡜⡜⡜⡜⠜⠈ -⡯⡳⠳⠝⠊⠓⠉ ⠈⠈⠈⠈ - - - -version: v1.0.9 (go1.21.3 - darwin/arm64) -git commit: 8bf95bf60d084af341f70e8263342f71b0a3cd16 -``` diff --git a/_vendor/github.com/docker/scout-cli/docs/scout_watch.md b/_vendor/github.com/docker/scout-cli/docs/scout_watch.md deleted file mode 100644 index 2444ce3c430a..000000000000 --- a/_vendor/github.com/docker/scout-cli/docs/scout_watch.md +++ /dev/null @@ -1,53 +0,0 @@ -# docker scout watch - -<!---MARKER_GEN_START--> -Watch repositories in a registry and push images and indexes to Docker Scout (experimental) - -### Options - -| Name | Type | Default | Description | -|:---------------------|:--------------|:--------|:------------------------------------------------------------------------------------| -| `--all-images` | | | Push all images instead of only the ones pushed during the watch command is running | -| `--dry-run` | | | Watch images and prepare them, but do not push them | -| `--interval` | `int64` | `60` | Interval in seconds between checks | -| `--org` | `string` | | Namespace of the Docker organization to which image will be pushed | -| `--refresh-registry` | | | Refresh the list of repositories of a registry at every run. Only with --registry. | -| `--registry` | `string` | | Registry to watch | -| `--repository` | `stringSlice` | | Repository to watch | -| `--sbom` | | | Create and upload SBOMs | -| `--tag` | `stringSlice` | | Regular expression to match tags to watch | -| `--workers` | `int` | `3` | Number of concurrent workers | - - -<!---MARKER_GEN_END--> - -## Description - -The `docker scout watch` command watches repositories in a registry -and pushes images or analysis results to Docker Scout. - -## Examples - -### Watch for new images from two repositories and push them - -```console -$ docker scout watch --org my-org --repository registry-1.example.com/repo-1 --repository registry-2.example.com/repo-2 -``` - -### Only push images with a specific tag - -```console -$ docker scout watch --org my-org --repository registry.example.com/my-service --tag latest -``` - -### Watch all repositories of a registry - -```console -$ docker scout watch --org my-org --registry registry.example.com -``` - -### Push all images and not just the new ones - -```console -$ docker scout watch--org my-org --repository registry.example.com/my-service --all-images -``` diff --git a/_vendor/github.com/moby/buildkit/docs/attestations/attestation-storage.md b/_vendor/github.com/moby/buildkit/docs/attestations/attestation-storage.md index a42fab303a5e..bcc8a5f7ec0b 100644 --- a/_vendor/github.com/moby/buildkit/docs/attestations/attestation-storage.md +++ b/_vendor/github.com/moby/buildkit/docs/attestations/attestation-storage.md @@ -7,12 +7,12 @@ attestations can provide valuable information from the build process, including, but not limited to: [SBOMs](https://en.wikipedia.org/wiki/Software_supply_chain), [SLSA Provenance](https://slsa.dev/provenance), build logs, etc. -This document describes the current custom format used to store attestations, -which is designed to be compatible with current registry implementations today. -In the future, we may support exporting attestations in additional formats. +This document describes the formats used to store attestations. BuildKit stores +attestations as OCI artifacts when OCI media types are enabled. Set the image +exporter option `oci-artifact=false` to use the legacy attestation image +manifest format. -Attestations are stored as manifest objects in the image index, similar in -style to OCI artifacts. +Attestations are stored as manifest objects in the image index. ## Properties @@ -21,12 +21,18 @@ style to OCI artifacts. Attestation manifests are attached to the root image index object, under a separate [OCI image manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md). Each attestation manifest can contain multiple [attestation blobs](#attestation-blob), -with all the of the attestations in a manifest applying to a single platform +with all of the attestations in a manifest applying to a single platform manifest. All properties of standard OCI and Docker manifests continue to apply. -The image `config` descriptor will point to a valid [image config](https://github.com/opencontainers/image-spec/blob/main/config.md), -however, it will not contain attestation-specific details, and should be +When OCI artifact storage is enabled, the manifest `artifactType` is set to +`application/vnd.docker.attestation.manifest.v1+json`, the `subject` descriptor +points to the target image manifest, and the `config` descriptor uses the OCI +empty JSON descriptor. + +When `oci-artifact=false` is set, the image `config` descriptor will point to a +valid [image config](https://github.com/opencontainers/image-spec/blob/main/config.md). +The image config will not contain attestation-specific details, and should be ignored as it is only included for compatibility purposes. Each image layer in `layers` will contain a descriptor for a single @@ -62,7 +68,7 @@ The contents of each layer will be a blob dependent on its `mediaType`. ```json { - "_type": "https://in-toto.io/Statement/v0.1", + "_type": "https://in-toto.io/Statement/v1", "subject": [ { "name": "<NAME>", @@ -160,10 +166,12 @@ This attestation manifest contains one attestation that is an in-toto attestatio { "mediaType": "application/vnd.oci.image.manifest.v1+json", "schemaVersion": 2, + "artifactType": "application/vnd.docker.attestation.manifest.v1+json", "config": { - "mediaType": "application/vnd.oci.image.config.v1+json", - "digest": "sha256:a781560066f20ec9c28f2115a95a886e5e71c7c7aa9d8fd680678498b82f3ea3", - "size": 123 + "mediaType": "application/vnd.oci.empty.v1+json", + "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", + "size": 2, + "data": "e30=" }, "layers": [ { @@ -174,22 +182,11 @@ This attestation manifest contains one attestation that is an in-toto attestatio "in-toto.io/predicate-type": "https://spdx.dev/Document" } } - ] -} -``` - -#### Image config (`sha256:a781560066f20ec9c28f2115a95a886e5e71c7c7aa9d8fd680678498b82f3ea3`): - -```json -{ - "architecture": "unknown", - "os": "unknown", - "config": {}, - "rootfs": { - "type": "layers", - "diff_ids": [ - "sha256:133ae3f9bcc385295b66c2d83b28c25a9f294ce20954d5cf922dda860429734a" - ] + ], + "subject": { + "mediaType": "application/vnd.oci.image.manifest.v1+json", + "digest": "sha256:23678f31b3b3586c4fb318aecfe64a96a1f0916ba8faf9b2be2abee63fa9e827", + "size": 1234 } } ``` @@ -200,7 +197,7 @@ Attestation body containing the SBOM data listing the packages used during the b ```json { - "_type": "https://in-toto.io/Statement/v0.1", + "_type": "https://in-toto.io/Statement/v1", "predicateType": "https://spdx.dev/Document", "subject": [ { diff --git a/_vendor/github.com/moby/buildkit/docs/attestations/slsa-definitions.md b/_vendor/github.com/moby/buildkit/docs/attestations/slsa-definitions.md index 08b692df3d3b..0053e1e12d28 100644 --- a/_vendor/github.com/moby/buildkit/docs/attestations/slsa-definitions.md +++ b/_vendor/github.com/moby/buildkit/docs/attestations/slsa-definitions.md @@ -2,22 +2,436 @@ title: SLSA definitions --- -BuildKit supports the [creation of SLSA Provenance](./slsa-provenance.md) for builds that -it runs. +BuildKit supports the [creation of SLSA Provenance](./slsa-provenance.md) for +builds that it runs. The provenance format generated by BuildKit is defined by the -[SLSA Provenance format](https://slsa.dev/provenance/v0.2). +SLSA Provenance format (supports both [v0.2](https://slsa.dev/spec/v0.2/provenance) +and [v1](https://slsa.dev/spec/v1.1/provenance)). This page describes how BuildKit populate each field, and whether the field gets included when you generate attestations `mode=min` and `mode=max`. -## `builder.id` +## SLSA v1 -Corresponds to [SLSA `builder.id`](https://slsa.dev/provenance/v0.2#builder.id). +### `buildDefinition.buildType` + +* Ref: https://slsa.dev/spec/v1.1/provenance#buildType +* Included with `mode=min` and `mode=max`. + +The `buildDefinition.buildType` field is set to `https://github.com/moby/buildkit/blob/master/docs/attestations/slsa-definitions.md` +and can be used to determine the structure of the provenance content. + +```json + "buildDefinition": { + "buildType": "https://github.com/moby/buildkit/blob/master/docs/attestations/slsa-definitions.md", + ... + } +``` + +### `buildDefinition.externalParameters.configSource` + +* Ref: https://slsa.dev/spec/v1.1/provenance#externalParameters +* Included with `mode=min` and `mode=max`. + +Describes the config that initialized the build. + +```json + "buildDefinition": { + "externalParameters": { + "configSource": { + "uri": "https://github.com/moby/buildkit.git#refs/tags/v0.11.0", + "digest": { + "sha1": "4b220de5058abfd01ff619c9d2ff6b09a049bea0" + }, + "path": "Dockerfile" + }, + ... + }, + } +``` + +For builds initialized from a remote context, like a Git or HTTP URL, this +object defines the context URL and its immutable digest in the `uri` and +`digest` fields. For builds using a local frontend, such as a Dockerfile, the +`path` field defines the path for the frontend file that initialized the build +(`filename` frontend option). + +### `buildDefinition.externalParameters.request` + +* Ref: https://slsa.dev/spec/v1.1/provenance#externalParameters +* Partially included with `mode=min`. + +Describes build inputs passed to the build. + +```json + "buildDefinition": { + "externalParameters": { + "request": { + "frontend": "gateway.v0", + "args": { + "build-arg:BUILDKIT_CONTEXT_KEEP_GIT_DIR": "1", + "label:FOO": "bar", + "source": "docker/dockerfile-upstream:master", + "target": "release" + }, + "secrets": [ + { + "id": "GIT_AUTH_HEADER", + "optional": true + }, + ... + ], + "ssh": [], + "locals": [] + }, + ... + }, + } +``` + +The following fields are included with both `mode=min` and `mode=max`: + +- `locals` lists any local sources used in the build, including the build + context and frontend file. +- `frontend` defines type of BuildKit frontend used for the build. Currently, + this can be `dockerfile.v0` or `gateway.v0`. +- `args` defines the build arguments passed to the BuildKit frontend. + + The keys inside the `args` object reflect the options as BuildKit receives + them. For example, `build-arg` and `label` prefixes are used for build + arguments and labels, and `target` key defines the target stage that was + built. The `source` key defines the source image for the Gateway frontend, if + used. + +The following fields are only included with `mode=max`: + +- `secrets` defines secrets used during the build. Note that actual secret + values are not included. +- `ssh` defines the ssh forwards used during the build. + +### `buildDefinition.internalParameters.buildConfig` + +* Ref: https://slsa.dev/spec/v1.1/provenance#internalParameters +* Only included with `mode=max`. + +Defines the build steps performed during the build. + +BuildKit internally uses LLB definition to execute the build steps. The LLB +definition of the build steps is defined in the +`buildDefinition.internalParameters.buildConfig.llbDefinition` field. + +Each LLB step is the JSON definition of the +[LLB ProtoBuf API](https://github.com/moby/buildkit/blob/v0.10.0/solver/pb/ops.proto). +The dependencies for a vertex in the LLB graph can be found in the `inputs` +field for every step. + +```json + "buildDefinition": { + "internalParameters": { + "buildConfig": { + "llbDefinition": [ + { + "id": "step0", + "op": { + "Op": { + "exec": { + "meta": { + "args": [ + "/bin/sh", + "-c", + "go build ." + ], + "env": [ + "PATH=/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "GOPATH=/go", + "GOFLAGS=-mod=vendor", + ], + "cwd": "/src", + }, + "mounts": [...] + } + }, + "platform": {...}, + }, + "inputs": [ + "step8:0", + "step2:0", + ] + }, + ... + ] + }, + } + } +``` + +### `buildDefinition.internalParameters.builderPlatform` + +* Ref: https://slsa.dev/spec/v1.1/provenance#internalParameters +* Included with `mode=min` and `mode=max`. + +```json + "buildDefinition": { + "internalParameters": { + "builderPlatform": "linux/amd64" + ... + }, + } +``` + +BuildKit sets the `builderPlatform` of the build machine. Note that this is not +necessarily the platform of the build result that can be determined from the +`in-toto` subject field. + +### `buildDefinition.resolvedDependencies` + +* Ref: https://slsa.dev/spec/v1.1/provenance#resolvedDependencies +* Included with `mode=min` and `mode=max`. + +Defines all the external artifacts that were part of the build. The value +depends on the type of artifact: + +- The URL of Git repositories containing source code for the image +- HTTP URLs if you are building from a remote tarball, or that was included + using an `ADD` command in Dockerfile +- Any Docker images used during the build + +The URLs to the Docker images will be in +[Package URL](https://github.com/package-url/purl-spec) format. + +All the build materials will include the immutable checksum of the artifact. +When building from a mutable tag, you can use the digest information to +determine if the artifact has been updated compared to when the build ran. + +```json + "buildDefinition": { + "resolvedDependencies": [ + { + "uri": "pkg:docker/alpine@3.17?platform=linux%2Famd64", + "digest": { + "sha256": "8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" + } + }, + { + "uri": "https://github.com/moby/buildkit.git#refs/tags/v0.11.0", + "digest": { + "sha1": "4b220de5058abfd01ff619c9d2ff6b09a049bea0" + } + }, + ... + ], + ... + } +``` + +### `runDetails.builder.id` + +* Ref: https://slsa.dev/spec/v1.1/provenance#builder.id +* Included with `mode=min` and `mode=max`. + +The field is set to the URL of the build, if available. + +```json + "runDetails": { + "builder": { + "id": "https://github.com/docker/buildx/actions/runs/3709599520" + ... + }, + ... + } +``` + +> [!NOTE] +> This value can be set using the `builder-id` attestation parameter. + +### `runDetails.metadata.invocationID` + +* Ref: https://slsa.dev/spec/v1.1/provenance#invocationId +* Included with `mode=min` and `mode=max`. + +Unique identifier for the build invocation. When building a multi-platform image +with a single build request, this value will be the shared by all the platform +versions of the image. + +```json + "runDetails": { + "metadata": { + "invocationID": "rpv7a389uzil5lqmrgwhijwjz", + ... + }, + ... + } +``` + +### `runDetails.metadata.startedOn` + +* Ref: https://slsa.dev/spec/v1.1/provenance#startedOn +* Included with `mode=min` and `mode=max`. + +Timestamp when the build started. + +```json + "runDetails": { + "metadata": { + "startedOn": "2021-11-17T15:00:00Z", + ... + }, + ... + } +``` + +### `runDetails.metadata.finishedOn` + +* Ref: https://slsa.dev/spec/v1.1/provenance#finishedOn +* Included with `mode=min` and `mode=max`. + +Timestamp when the build finished. + +```json + "runDetails": { + "metadata": { + "finishedOn": "2021-11-17T15:01:00Z", + ... + }, + } +``` + +### `runDetails.metadata.buildkit_metadata` + +* Ref: https://slsa.dev/spec/v1.1/provenance#extension-fields +* Partially included with `mode=min`. + +This extension field defines BuildKit-specific additional metadata that is not +part of the SLSA provenance spec. + +```json + "runDetails": { + "metadata": { + "buildkit_metadata": { + "source": {...}, + "layers": {...}, + "vcs": {...}, + }, + ... + }, + } +``` + +#### `source` + +Only included with `mode=max`. + +Defines a source mapping of LLB build steps, defined in the +`buildDefinition.internalParameters.buildConfig.llbDefinition` field, to their +original source code (for example, Dockerfile commands). The `source.locations` +field contains the ranges of all the Dockerfile commands ran in an LLB step. +`source.infos` array contains the source code itself. This mapping is present +if the BuildKit frontend provided it when creating the LLB definition. + +#### `layers` + +Only included with `mode=max`. + +Defines the layer mapping of LLB build step mounts defined in +`buildDefinition.internalParameters.buildConfig.llbDefinition` to the OCI +descriptors of equivalent layers. This mapping is present if the layer data was +available, usually when attestation is for an image or if the build step pulled +in image data as part of the build. + +#### `vcs` Included with `mode=min` and `mode=max`. -The `builder.id` field is set to the URL of the build, if available. +Defines optional metadata for the version control system used for the build. If +a build uses a remote context from Git repository, BuildKit extracts the details +of the version control system automatically and displays it in the +`buildDefinition.externalParameters.configSource` field. But if the build uses +a source from a local directory, the VCS information is lost even if the +directory contained a Git repository. In this case, the build client can send +additional `vcs:source` and `vcs:revision` build options and BuildKit will add +them to the provenance attestations as extra metadata. Note that, contrary to +the `buildDefinition.externalParameters.configSource` field, BuildKit doesn't +verify the `vcs` values, and as such they can't be trusted and should only be +used as a metadata hint. + +### `runDetails.metadata.buildkit_hermetic` + +* Ref: https://slsa.dev/spec/v1.1/provenance#extension-fields +* Included with `mode=min` and `mode=max`. + +This extension field is set to true if the build was hermetic and did not access +the network. In Dockerfiles, a build is hermetic if it does not use `RUN` +commands or disables network with `--network=none` flag. + +```json + "runDetails": { + "metadata": { + "buildkit_hermetic": true, + ... + }, + } +``` + +### `runDetails.metadata.buildkit_completeness` + +* Ref: https://slsa.dev/spec/v1.1/provenance#extension-fields +* Included with `mode=min` and `mode=max`. + +This extension field defines if the provenance information is complete. It is +similar to `metadata.completeness` field in SLSA v0.2. + +`buildkit_completeness.request` is true if all the build arguments are included +in the `buildDefinition.externalParameters.request` field. When building with +`min` mode, the build arguments are not included in the provenance information +and request is not complete. Request is also not complete on direct LLB builds +that did not use a frontend. + +`buildkit_completeness.resolvedDependencies` is true if +`buildDefinition.resolvedDependencies` field includes all the dependencies of +the build. When building from un-tracked source in a local directory, the +dependencies are not complete, while when building from a remote Git repository +all dependencies can be tracked by BuildKit and +`buildkit_completeness.resolvedDependencies` is true. + +```json + "runDetails": { + "metadata": { + "buildkit_completeness": { + "request": true, + "resolvedDependencies": true + }, + ... + }, + } +``` + +### `runDetails.metadata.buildkit_reproducible` + +* Ref: https://slsa.dev/spec/v1.1/provenance#extension-fields +* Included with `mode=min` and `mode=max`. + +This extension field defines if the build result is supposed to be byte-by-byte +reproducible. It is similar to `metadata.reproducible` field in SLSA v0.2. This +value can be set by the user with the `reproducible=true` attestation parameter. + +```json + "runDetails": { + "metadata": { + "buildkit_reproducible": false, + ... + }, + } +``` + +## SLSA v0.2 + +### `builder.id` + +* Ref: https://slsa.dev/spec/v0.2/provenance#builder.id +* Included with `mode=min` and `mode=max`. + +The field is set to the URL of the build, if available. ```json "builder": { @@ -25,26 +439,25 @@ The `builder.id` field is set to the URL of the build, if available. }, ``` -This value can be set using the `builder-id` attestation parameter. - -## `buildType` +> [!NOTE] +> This value can be set using the `builder-id` attestation parameter. -Corresponds to [SLSA `buildType`](https://slsa.dev/provenance/v0.2#buildType). +### `buildType` -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#buildType +* Included with `mode=min` and `mode=max`. -The `buildType` field is set to `https://mobyproject.org/buildkit@v1` can be +The `buildType` field is set to `https://mobyproject.org/buildkit@v1` and can be used to determine the structure of the provenance content. ```json "buildType": "https://mobyproject.org/buildkit@v1", ``` -## `invocation.configSource` +### `invocation.configSource` -Corresponds to [SLSA `invocation.configSource`](https://slsa.dev/provenance/v0.2#invocation.configSource). - -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#invocation.configSource +* Included with `mode=min` and `mode=max`. Describes the config that initialized the build. @@ -62,15 +475,15 @@ Describes the config that initialized the build. ``` For builds initialized from a remote context, like a Git or HTTP URL, this -object defines the context URL and its immutable digest in the `uri` and `digest` fields. -For builds using a local frontend, such as a Dockerfile, the `entryPoint` field defines the path -for the frontend file that initialized the build (`filename` frontend option). +object defines the context URL and its immutable digest in the `uri` and +`digest` fields. For builds using a local frontend, such as a Dockerfile, the +`entryPoint` field defines the path for the frontend file that initialized the +build (`filename` frontend option). -## `invocation.parameters` +### `invocation.parameters` -Corresponds to [SLSA `invocation.parameters`](https://slsa.dev/provenance/v0.2#invocation.parameters). - -Partially included with `mode=min`. +* Ref: https://slsa.dev/spec/v0.2/provenance#invocation.parameters +* Partially included with `mode=min`. Describes build inputs passed to the build. @@ -118,11 +531,10 @@ The following fields are only included with `mode=max`: values are not included. - `ssh` defines the ssh forwards used during the build. -## `invocation.environment` +### `invocation.environment` -Corresponds to [SLSA `invocation.environment`](https://slsa.dev/provenance/v0.2#invocation.environment). - -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#invocation.environment +* Included with `mode=min` and `mode=max`. ```json "invocation": { @@ -137,11 +549,10 @@ The only value BuildKit currently sets is the `platform` of the current build machine. Note that this is not necessarily the platform of the build result that can be determined from the `in-toto` subject field. -## `materials` - -Corresponds to [SLSA `materials`](https://slsa.dev/provenance/v0.2#materials). +### `materials` -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#materials +* Included with `mode=min` and `mode=max`. Defines all the external artifacts that were part of the build. The value depends on the type of artifact: @@ -176,11 +587,10 @@ determine if the artifact has been updated compared to when the build ran. ], ``` -## `buildConfig` +### `buildConfig` -Corresponds to [SLSA `buildConfig`](https://slsa.dev/provenance/v0.2#buildConfig). - -Only included with `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#buildConfig +* Only included with `mode=max`. Defines the build steps performed during the build. @@ -228,11 +638,10 @@ field for every step. }, ``` -## `metadata.buildInvocationId` +### `metadata.buildInvocationId` -Corresponds to [SLSA `metadata.buildInvocationId`](https://slsa.dev/provenance/v0.2#metadata.buildIncocationId). - -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#buildInvocationId +* Included with `mode=min` and `mode=max`. Unique identifier for the build invocation. When building a multi-platform image with a single build request, this value will be the shared by all the platform @@ -245,11 +654,10 @@ versions of the image. }, ``` -## `metadata.buildStartedOn` +### `metadata.buildStartedOn` -Corresponds to [SLSA `metadata.buildStartedOn`](https://slsa.dev/provenance/v0.2#metadata.buildStartedOn). - -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#buildStartedOn +* Included with `mode=min` and `mode=max`. Timestamp when the build started. @@ -260,11 +668,10 @@ Timestamp when the build started. }, ``` -## `metadata.buildFinishedOn` - -Corresponds to [SLSA `metadata.buildFinishedOn`](https://slsa.dev/provenance/v0.2#metadata.buildFinishedOn). +### `metadata.buildFinishedOn` -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#buildFinishedOn +* Included with `mode=min` and `mode=max`. Timestamp when the build finished. @@ -275,19 +682,18 @@ Timestamp when the build finished. }, ``` -## `metadata.completeness` - -Corresponds to [SLSA `metadata.completeness`](https://slsa.dev/provenance/v0.2#metadata.completeness). +### `metadata.completeness` -Included with `mode=min` and `mode=max`. +* Ref: https://slsa.dev/spec/v0.2/provenance#metadata.completeness +* Included with `mode=min` and `mode=max`. Defines if the provenance information is complete. `completeness.parameters` is true if all the build arguments are included in the -`invocation.parameters` field. When building with `min` mode, the build -arguments are not included in the provenance information and parameters are not -complete. Parameters are also not complete on direct LLB builds that did not use -a frontend. +`parameters` field. When building with `min` mode, the build arguments are not +included in the provenance information and parameters are not complete. +Parameters are also not complete on direct LLB builds that did not use a +frontend. `completeness.environment` is always true for BuildKit builds. @@ -308,9 +714,10 @@ is true. }, ``` -## `metadata.reproducible` +### `metadata.reproducible` -Corresponds to [SLSA `metadata.reproducible`](https://slsa.dev/provenance/v0.2#metadata.reproducible). +* Ref: https://slsa.dev/spec/v0.2/provenance#metadata.reproducible +* Included with `mode=min` and `mode=max`. Defines if the build result is supposed to be byte-by-byte reproducible. This value can be set by the user with the `reproducible=true` attestation parameter. @@ -322,7 +729,7 @@ value can be set by the user with the `reproducible=true` attestation parameter. }, ``` -## `metadata.https://mobyproject.org/buildkit@v1#hermetic` +### `metadata.https://mobyproject.org/buildkit@v1#hermetic` Included with `mode=min` and `mode=max`. @@ -337,7 +744,7 @@ commands or disables network with `--network=none` flag. }, ``` -## `metadata.https://mobyproject.org/buildkit@v1#metadata` +### `metadata.https://mobyproject.org/buildkit@v1#metadata` Partially included with `mode=min`. @@ -355,7 +762,7 @@ part of the SLSA provenance spec. }, ``` -### `source` +#### `source` Only included with `mode=max`. @@ -366,7 +773,7 @@ the Dockerfile commands ran in an LLB step. `source.infos` array contains the source code itself. This mapping is present if the BuildKit frontend provided it when creating the LLB definition. -### `layers` +#### `layers` Only included with `mode=max`. @@ -375,7 +782,7 @@ Defines the layer mapping of LLB build step mounts defined in mapping is present if the layer data was available, usually when attestation is for an image or if the build step pulled in image data as part of the build. -### `vcs` +#### `vcs` Included with `mode=min` and `mode=max`. @@ -389,227 +796,3 @@ repository. In this case, the build client can send additional `vcs:source` and attestations as extra metadata. Note that, contrary to the `invocation.configSource` field, BuildKit doesn't verify the `vcs` values, and as such they can't be trusted and should only be used as a metadata hint. - -## Output - -To inspect the provenance that was generated and attached to a container image, -you can use the `docker buildx imagetools` command to inspect the image in a -registry. Inspecting the attestation displays the format described in the -[attestation storage specification](./attestation-storage.md). - -For example, inspecting a simple Docker image based on `alpine:latest` results -in a provenance attestation similar to the following, for a `mode=min` build: - -```json -{ - "_type": "https://in-toto.io/Statement/v0.1", - "predicateType": "https://slsa.dev/provenance/v0.2", - "subject": [ - { - "name": "pkg:docker/<registry>/<image>@<tag/digest>?platform=<platform>", - "digest": { - "sha256": "e8275b2b76280af67e26f068e5d585eb905f8dfd2f1918b3229db98133cb4862" - } - } - ], - "predicate": { - "builder": { - "id": "" - }, - "buildType": "https://mobyproject.org/buildkit@v1", - "materials": [ - { - "uri": "pkg:docker/alpine@latest?platform=linux%2Famd64", - "digest": { - "sha256": "8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" - } - } - ], - "invocation": { - "configSource": { - "entryPoint": "Dockerfile" - }, - "parameters": { - "frontend": "dockerfile.v0", - "args": {}, - "locals": [ - { - "name": "context" - }, - { - "name": "dockerfile" - } - ] - }, - "environment": { - "platform": "linux/amd64" - } - }, - "metadata": { - "buildInvocationID": "yirbp1aosi1vqjmi3z6bc75nb", - "buildStartedOn": "2022-12-08T11:48:59.466513707Z", - "buildFinishedOn": "2022-12-08T11:49:01.256820297Z", - "reproducible": false, - "completeness": { - "parameters": true, - "environment": true, - "materials": false - }, - "https://mobyproject.org/buildkit@v1#metadata": {} - } - } -} -``` - -For a similar build, but with `mode=max`: - -```json -{ - "_type": "https://in-toto.io/Statement/v0.1", - "predicateType": "https://slsa.dev/provenance/v0.2", - "subject": [ - { - "name": "pkg:docker/<registry>/<image>@<tag/digest>?platform=<platform>", - "digest": { - "sha256": "e8275b2b76280af67e26f068e5d585eb905f8dfd2f1918b3229db98133cb4862" - } - } - ], - "predicate": { - "builder": { - "id": "" - }, - "buildType": "https://mobyproject.org/buildkit@v1", - "materials": [ - { - "uri": "pkg:docker/alpine@latest?platform=linux%2Famd64", - "digest": { - "sha256": "8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" - } - } - ], - "invocation": { - "configSource": { - "entryPoint": "Dockerfile" - }, - "parameters": { - "frontend": "dockerfile.v0", - "args": {}, - "locals": [ - { - "name": "context" - }, - { - "name": "dockerfile" - } - ] - }, - "environment": { - "platform": "linux/amd64" - } - }, - "buildConfig": { - "llbDefinition": [ - { - "id": "step0", - "op": { - "Op": { - "source": { - "identifier": "docker-image://docker.io/library/alpine:latest@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4" - } - }, - "platform": { - "Architecture": "amd64", - "OS": "linux" - }, - "constraints": {} - } - }, - { - "id": "step1", - "op": { - "Op": null - }, - "inputs": ["step0:0"] - } - ] - }, - "metadata": { - "buildInvocationID": "46ue2x93k3xj5l463dektwldw", - "buildStartedOn": "2022-12-08T11:50:54.953375437Z", - "buildFinishedOn": "2022-12-08T11:50:55.447841328Z", - "reproducible": false, - "completeness": { - "parameters": true, - "environment": true, - "materials": false - }, - "https://mobyproject.org/buildkit@v1#metadata": { - "source": { - "locations": { - "step0": { - "locations": [ - { - "ranges": [ - { - "start": { - "line": 1 - }, - "end": { - "line": 1 - } - } - ] - } - ] - } - }, - "infos": [ - { - "filename": "Dockerfile", - "data": "RlJPTSBhbHBpbmU6bGF0ZXN0Cg==", - "llbDefinition": [ - { - "id": "step0", - "op": { - "Op": { - "source": { - "identifier": "local://dockerfile", - "attrs": { - "local.differ": "none", - "local.followpaths": "[\"Dockerfile\",\"Dockerfile.dockerignore\",\"dockerfile\"]", - "local.session": "q2jnwdkas0i0iu4knchd92jaz", - "local.sharedkeyhint": "dockerfile" - } - } - }, - "constraints": {} - } - }, - { - "id": "step1", - "op": { - "Op": null - }, - "inputs": ["step0:0"] - } - ] - } - ] - }, - "layers": { - "step0:0": [ - [ - { - "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip", - "digest": "sha256:c158987b05517b6f2c5913f3acef1f2182a32345a304fe357e3ace5fadcad715", - "size": 3370706 - } - ] - ] - } - } - } - } -} -``` diff --git a/_vendor/github.com/moby/buildkit/docs/buildkitd.toml.md b/_vendor/github.com/moby/buildkit/docs/buildkitd.toml.md index ec314b9f08ba..6f037544a693 100644 --- a/_vendor/github.com/moby/buildkit/docs/buildkitd.toml.md +++ b/_vendor/github.com/moby/buildkit/docs/buildkitd.toml.md @@ -13,19 +13,26 @@ The following is a complete `buildkitd.toml` configuration example. Note that some configuration options are only useful in edge cases. ```toml -# debug enables additional debug logging -debug = true -# trace enables additional trace logging (very verbose, with potential performance impacts) -trace = true # 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" ] +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"] @@ -69,7 +76,6 @@ insecure-entitlements = [ "network.host", "security.insecure" ] # 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 @@ -87,7 +93,6 @@ insecure-entitlements = [ "network.host", "security.insecure" ] # 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 = "" @@ -116,7 +121,6 @@ insecure-entitlements = [ "network.host", "security.insecure" ] # collector will attempt to leave - however, it will never be bought below # reservedSpace. minFreeSpace = "10GB" - # keepDuration can be an integer number of seconds (e.g. 172800), or a # string duration (e.g. "48h") keepDuration = "48h" @@ -148,7 +152,8 @@ insecure-entitlements = [ "network.host", "security.insecure" ] # collector will attempt to leave - however, it will never be bought below # reservedSpace. minFreeSpace = "20GB" - + # 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 @@ -176,8 +181,13 @@ insecure-entitlements = [ "network.host", "security.insecure" ] [registry."docker.io"] # mirror configuration to handle path in case a mirror registry requires a /project path rather than just a host:port mirrors = ["yourmirror.local:5000", "core.harbor.domain/proxy.docker.io"] + # Use plain HTTP to connect to the mirrors. http = true + # Use HTTPS with self-signed certificates. Do not enable this together with `http`. insecure = true + # If you use token auth with self-signed certificates, + # then buildctl also needs to trust the token provider CA (for example, certificates that are configured for registry) + # because buildctl pulls tokens directly without daemon process ca=["/etc/config/myca.pem"] [[registry."docker.io".keypair]] key="/etc/config/key.pem" @@ -193,7 +203,6 @@ insecure-entitlements = [ "network.host", "security.insecure" ] [frontend."gateway.v0"] enabled = true - # If allowedRepositories is empty, all gateway sources are allowed. # Otherwise, only the listed repositories are allowed as a gateway source. # @@ -206,5 +215,22 @@ insecure-entitlements = [ "network.host", "security.insecure" ] [system] # how often buildkit scans for changes in the supported emulated platforms platformsCacheMaxAge = "1h" - + # maxRegistryConcurrency sets the maximum number of concurrent connections + # per registry. If unset, the default concurrency limit is used. + maxRegistryConcurrency = 4 + + +# optional signed cache configuration for GitHub Actions backend +[ghacache.sign] +# command that signs the payload in stdin and outputs the signature to stdout. Normally you want cosign to produce the signature bytes. +cmd = "" +[ghacache.verify] +required = false +[ghacache.verify.policy] +timestampThreshold = 1 +tlogThreshold = 1 +# cetificate properties that need to match. Simple wildcards (*) are supported. +certificateIssuer = "" +subjectAlternativeName = "" +buildSignerURI = "" ``` diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/reference.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/reference.md index 0afa620e2cd2..5a366a1b90e9 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/reference.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/reference.md @@ -373,10 +373,16 @@ whitespace, like `${foo}_bar`. The `${variable_name}` syntax also supports a few of the standard `bash` modifiers as specified below: -- `${variable:-word}` indicates that if `variable` is set then the result - will be that value. If `variable` is not set then `word` will be the result. -- `${variable:+word}` indicates that if `variable` is set then `word` will be - the result, otherwise the result is the empty string. +- `${variable:-word}` indicates that if `variable` is set and non-empty then + the result will be that value. If `variable` is unset or empty then `word` + will be the result. +- `${variable-word}` indicates that if `variable` is set (even if empty) then + the result will be that value. If `variable` is unset then `word` will be + the result. +- `${variable:+word}` indicates that if `variable` is set and non-empty then + `word` will be the result, otherwise the result is the empty string. +- `${variable+word}` indicates that if `variable` is set (even if empty) then + `word` will be the result, otherwise the result is the empty string. The following variable replacements are supported in a pre-release version of Dockerfile syntax, when using the `# syntax=docker/dockerfile-upstream:master` syntax @@ -568,8 +574,8 @@ You can also use heredocs with the shell form to break up supported commands. ```dockerfile RUN <<EOF -source $HOME/.bashrc && \ -echo $HOME + source $HOME/.bashrc + echo $HOME EOF ``` @@ -621,6 +627,20 @@ The image can be any valid image. [`COPY --from=<name>`](#copy---from), and [`RUN --mount=type=bind,from=<name>`](#run---mounttypebind) instructions to refer to the image built in this stage. + + Using a previous build stage as the base for a subsequent stage is a common + pattern for sharing a common base environment: + + ```dockerfile + FROM ubuntu AS base + RUN apt-get update && apt-get install -y shared-tooling + + FROM base AS dev + RUN apt-get install -y dev-tooling + + FROM base AS prod + COPY --from=build /app /app + ``` - The `tag` or `digest` values are optional. If you omit either of them, the builder assumes a `latest` tag by default. The builder returns an error if it can't find the `tag` value. @@ -689,10 +709,11 @@ EOF The available `[OPTIONS]` for the `RUN` instruction are: | Option | Minimum Dockerfile version | -| ------------------------------- | -------------------------- | +|---------------------------------|----------------------------| +| [`--device`](#run---device) | 1.14-labs | | [`--mount`](#run---mount) | 1.2 | | [`--network`](#run---network) | 1.3 | -| [`--security`](#run---security) | 1.1.2-labs | +| [`--security`](#run---security) | 1.20 | ### Cache invalidation for RUN instructions @@ -707,6 +728,103 @@ guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practi The cache for `RUN` instructions can be invalidated by [`ADD`](#add) and [`COPY`](#copy) instructions. +### RUN --device + +> [!NOTE] +> Not yet available in stable syntax, use [`docker/dockerfile:1-labs`](#syntax) +> version. It also needs BuildKit 0.20.0 or later. + +```dockerfile +RUN --device=name,[required] +``` + +`RUN --device` allows build to request [CDI devices](https://github.com/moby/buildkit/blob/master/docs/cdi.md) +to be available to the build step. + +> [!WARNING] +> The use of `--device` is protected by the `device` entitlement, which needs +> to be enabled when starting the buildkitd daemon with +> `--allow-insecure-entitlement device` flag or in [buildkitd config](https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md), +> and for a build request with [`--allow device` flag](https://docs.docker.com/engine/reference/commandline/buildx_build/#allow). + +The device `name` is provided by the CDI specification registered in BuildKit. + +In the following example, multiple devices are registered in the CDI +specification for the `vendor1.com/device` vendor. + +```yaml +cdiVersion: "0.6.0" +kind: "vendor1.com/device" +devices: + - name: foo + containerEdits: + env: + - FOO=injected + - name: bar + annotations: + org.mobyproject.buildkit.device.class: class1 + containerEdits: + env: + - BAR=injected + - name: baz + annotations: + org.mobyproject.buildkit.device.class: class1 + containerEdits: + env: + - BAZ=injected + - name: qux + annotations: + org.mobyproject.buildkit.device.class: class2 + containerEdits: + env: + - QUX=injected +annotations: + org.mobyproject.buildkit.device.autoallow: true +``` + +The device name format is flexible and accepts various patterns to support +multiple device configurations: + +* `vendor1.com/device`: request the first device found for this vendor +* `vendor1.com/device=foo`: request a specific device +* `vendor1.com/device=*`: request all devices for this vendor +* `class1`: request devices by `org.mobyproject.buildkit.device.class` annotation + +> [!NOTE] +> Annotations are supported by the CDI specification since 0.6.0. + +> [!NOTE] +> To automatically allow all devices registered in the CDI specification, you +> can set the `org.mobyproject.buildkit.device.autoallow` annotation. You can +> also set this annotation for a specific device. + +#### Example: CUDA-Powered LLaMA Inference + +In this example we use the `--device` flag to run `llama.cpp` inference using +an NVIDIA GPU device through CDI: + +```dockerfile +# syntax=docker/dockerfile:1-labs + +FROM scratch AS model +ADD https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf /model.gguf + +FROM scratch AS prompt +COPY <<EOF prompt.txt +Q: Generate a list of 10 unique biggest countries by population in JSON with their estimated poulation in 1900 and 2024. Answer only newline formatted JSON with keys "country", "population_1900", "population_2024" with 10 items. +A: +[ + { + +EOF + +FROM ghcr.io/ggml-org/llama.cpp:full-cuda-b5124 +RUN --device=nvidia.com/gpu=all \ + --mount=from=model,target=/models \ + --mount=from=prompt,target=/tmp \ + ./llama-cli -m /models/model.gguf -no-cnv -ngl 99 -f /tmp/prompt.txt +``` + ### RUN --mount ```dockerfile @@ -735,12 +853,13 @@ The supported mount types are: This mount type allows binding files or directories to the build container. A bind mount is read-only by default. -| Option | Description | -| ---------------------------------- | ---------------------------------------------------------------------------------------------- | -| `target`, `dst`, `destination`[^1] | Mount path. | -| `source` | Source path in the `from`. Defaults to the root of the `from`. | -| `from` | Build stage, context, or image name for the root of the source. Defaults to the build context. | -| `rw`,`readwrite` | Allow writes on the mount. Written data will be discarded. | +| Option | Description | +| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `target`, `dst`, `destination`[^1] | Mount path. | +| `source` | Source path in the `from`. Defaults to the root of the `from`. | +| `from` | Build stage, context, or image name for the root of the source. Defaults to the build context. | +| `rw`,`readwrite` | Allow writes on the mount. Written data will be discarded after the `RUN` instruction completes and will not be committed to the image layer. | + ### RUN --mount=type=cache @@ -782,7 +901,7 @@ FROM ubuntu RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt update && apt-get --no-install-recommends install -y gcc + apt-get update && apt-get --no-install-recommends install -y gcc ``` Apt needs exclusive access to its data, so the caches use the option @@ -941,9 +1060,6 @@ The command is run in the host's network environment (similar to ### RUN --security -> [!NOTE] -> Not yet available in stable syntax, use [`docker/dockerfile:1-labs`](#syntax) version. - ```dockerfile RUN --security=<sandbox|insecure> ``` @@ -964,7 +1080,7 @@ Default sandbox mode can be activated via `--security=sandbox`, but that is no-o #### Example: check entitlements ```dockerfile -# syntax=docker/dockerfile:1-labs +# syntax=docker/dockerfile:1 FROM ubuntu RUN --security=insecure cat /proc/self/status | grep CapEff ``` @@ -1049,6 +1165,13 @@ Labels included in base images (images in the `FROM` line) are inherited by your image. If a label already exists but with a different value, the most-recently-applied value overrides any previously-set value. +In a multi-stage build, labels from intermediate stages are only present in +the final image if the final stage is directly or indirectly based on them +(via `FROM`). Labels from a stage that you only reference with +`COPY --from` or `RUN --mount=from=` are not included in the output image. +Labels from the base image specified in the final `FROM` instruction are +always inherited. + To view an image's labels, use the `docker image inspect` command. You can use the `--format` option to show just the labels; @@ -1227,10 +1350,11 @@ The available `[OPTIONS]` are: | --------------------------------------- | -------------------------- | | [`--keep-git-dir`](#add---keep-git-dir) | 1.1 | | [`--checksum`](#add---checksum) | 1.6 | -| [`--chown`](#add---chown---chmod) | | -| [`--chmod`](#add---chown---chmod) | 1.2 | +| [`--chmod`](#add---chmod) | 1.2 | +| [`--chown`](#add---chown) | | | [`--link`](#add---link) | 1.4 | -| [`--exclude`](#add---exclude) | 1.7-labs | +| [`--unpack`](#add---unpack) | 1.17 | +| [`--exclude`](#add---exclude) | 1.19 | The `ADD` instruction copies new files or directories from `<src>` and adds them to the filesystem of the image at the path `<dest>`. Files and directories @@ -1336,9 +1460,8 @@ ADD arr[[]0].txt /dest/ When using a local tar archive as the source for `ADD`, and the archive is in a recognized compression format (`gzip`, `bzip2` or `xz`, or uncompressed), the -archive is decompressed and extracted into the specified destination. Only -local tar archives are extracted. If the tar archive is a remote URL, the -archive is not extracted, but downloaded and placed at the destination. +archive is decompressed and extracted into the specified destination. Local tar +archives are extracted by default, see the [`ADD --unpack` flag]. When a directory is extracted, it has the same behavior as `tar -x`. The result is the union of: @@ -1363,6 +1486,9 @@ file. However, like any other file processed during an `ADD`, `mtime` isn't included in the determination of whether or not the file has changed and the cache should be updated. +If remote file is a tar archive, the archive is not extracted by default. To +download and extract the archive, use the [`ADD --unpack` flag]. + If the destination ends with a trailing slash, then the filename is inferred from the URL path. For example, `ADD http://example.com/foobar /` would create the file `/foobar`. The URL must have a nontrivial path so that an appropriate @@ -1376,6 +1502,12 @@ If your URL files are protected using authentication, you need to use `RUN wget` `RUN curl` or use another tool from within the container as the `ADD` instruction doesn't support authentication. +##### Secrets + +You can use the `HTTP_AUTH_HEADER_<host>` and `HTTP_AUTH_TOKEN_<host>` secrets +to set credentials for remote sources. For more information, see +[Build secrets](https://docs.docker.com/build/building/secrets/#http-authentication-for-add). + #### Adding files from a Git repository To use a Git repository as the source for `ADD`, you can reference the @@ -1475,24 +1607,51 @@ ADD --keep-git-dir=true https://github.com/moby/buildkit.git#v0.10.1 /buildkit ADD [--checksum=<hash>] <src> ... <dir> ``` -The `--checksum` flag lets you verify the checksum of a remote resource. The -checksum is formatted as `sha256:<hash>`. SHA-256 is the only supported hash -algorithm. +The `--checksum` flag lets you verify the checksum of a remote Git or HTTP +resource: + +- For Git sources, the checksum is the commit SHA. It can be the full commit + SHA or match on the prefix (1 or more characters). +- For HTTP sources, the checksum is the SHA-256 content digest, formatted as + `sha256:<hash>`. SHA-256 is the only supported hash algorithm. ```dockerfile +ADD --checksum=be1f38e https://github.com/moby/buildkit.git#v0.26.2 / ADD --checksum=sha256:24454f830cdb571e2c4ad15481119c43b3cafd48dd869a9b2945d1036d1dc68d https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/linux-0.01.tar.gz / ``` -The `--checksum` flag only supports HTTP(S) sources. +### ADD --chmod -### ADD --chown --chmod +See [`COPY --chmod`](#copy---chmod). -See [`COPY --chown --chmod`](#copy---chown---chmod). +### ADD --chown + +See [`COPY --chown`](#copy---chown). ### ADD --link See [`COPY --link`](#copy---link). +### ADD --unpack + +```dockerfile +ADD [--unpack=<bool>] <src> ... <dir> +``` + +The `--unpack` flag controls whether or not to automatically unpack tar +archives (including compressed formats like `gzip` or `bzip2`) when adding them +to the image. Local tar archives are unpacked by default, whereas remote tar +archives (where `src` is a URL) are downloaded without unpacking. + +```dockerfile +# syntax=docker/dockerfile:1 +FROM alpine +# Download and unpack archive.tar.gz into /download: +ADD --unpack=true https://example.com/archive.tar.gz /download +# Add local tar without unpacking: +ADD --unpack=false my-archive.tar.gz . +``` + ### ADD --exclude See [`COPY --exclude`](#copy---exclude). @@ -1512,11 +1671,11 @@ The available `[OPTIONS]` are: | Option | Minimum Dockerfile version | | ---------------------------------- | -------------------------- | | [`--from`](#copy---from) | | -| [`--chown`](#copy---chown---chmod) | | -| [`--chmod`](#copy---chown---chmod) | 1.2 | +| [`--chmod`](#copy---chmod) | 1.2 | +| [`--chown`](#copy---chown) | | | [`--link`](#copy---link) | 1.4 | -| [`--parents`](#copy---parents) | 1.7-labs | -| [`--exclude`](#copy---exclude) | 1.7-labs | +| [`--parents`](#copy---parents) | 1.20 | +| [`--exclude`](#copy---exclude) | 1.19 | The `COPY` instruction copies new files or directories from `<src>` and adds them to the filesystem of the image at the path `<dest>`. Files and directories @@ -1683,32 +1842,52 @@ COPY --from=nginx:latest /etc/nginx/nginx.conf /nginx.conf The source path of `COPY --from` is always resolved from filesystem root of the image or stage that you specify. -### COPY --chown --chmod +### COPY --chmod -> [!NOTE] -> Only octal notation is currently supported. Non-octal support is tracked in -> [moby/buildkit#1951](https://github.com/moby/buildkit/issues/1951). +```dockerfile +COPY [--chmod=<perms>] <src> ... <dest> +``` + +The `--chmod` flag supports octal notation (e.g., `755`, `644`) and symbolic +notation (e.g., `+x`, `g=u`). Symbolic notation (added in Dockerfile version 1.14) +is useful when octal isn't flexible enough. For example, `u=rwX,go=rX` sets +directories to 755 and files to 644, while preserving the executable bit on files +that already have it. (Capital `X` means "executable only if it's a directory or +already executable.") + +For more information about symbolic notation syntax, see the +[chmod(1) manual](https://man.freebsd.org/cgi/man.cgi?chmod). + +Examples using octal notation: + +```dockerfile +COPY --chmod=755 app.sh /app/ +COPY --chmod=644 file.txt /data/ +ARG MODE=440 +COPY --chmod=$MODE . . +``` + +Examples using symbolic notation: + +```dockerfile +COPY --chmod=+x script.sh /app/ +COPY --chmod=u=rwX,go=rX . /app/ +COPY --chmod=g=u config/ /config/ +``` + +The `--chmod` flag is not supported when building Windows containers. + +### COPY --chown ```dockerfile -COPY [--chown=<user>:<group>] [--chmod=<perms> ...] <src> ... <dest> +COPY [--chown=<user>:<group>] <src> ... <dest> ``` -The `--chown` and `--chmod` features are only supported on Dockerfiles used to build Linux containers, -and doesn't work on Windows containers. Since user and group ownership concepts do -not translate between Linux and Windows, the use of `/etc/passwd` and `/etc/group` for -translating user and group names to IDs restricts this feature to only be viable for -Linux OS-based containers. +Sets ownership of copied files. Without this flag, files are created with UID +and GID of 0. -All files and directories copied from the build context are created with a UID and GID of `0` unless the -optional `--chown` flag specifies a given username, groupname, or UID/GID -combination to request specific ownership of the copied content. The -format of the `--chown` flag allows for either username and groupname strings -or direct integer UID and GID in any combination. Providing a username without -groupname or a UID without GID will use the same numeric UID as the GID. If a -username or groupname is provided, the container's root filesystem -`/etc/passwd` and `/etc/group` files will be used to perform the translation -from name to integer UID or GID respectively. The following examples show -valid definitions for the `--chown` flag: +The flag accepts usernames, group names, UIDs, or GIDs in any combination. +If you specify only a user, the GID is set to the same numeric value as the UID. ```dockerfile COPY --chown=55:mygroup files* /somedir/ @@ -1718,22 +1897,12 @@ COPY --chown=10:11 files* /somedir/ COPY --chown=myuser:mygroup --chmod=644 files* /somedir/ ``` -If the container root filesystem doesn't contain either `/etc/passwd` or -`/etc/group` files and either user or group names are used in the `--chown` -flag, the build will fail on the `COPY` operation. Using numeric IDs requires -no lookup and does not depend on container root filesystem content. +When using names instead of numeric IDs, BuildKit resolves them using +`/etc/passwd` and `/etc/group` in the container's root filesystem. If these +files are missing or don't contain the specified names, the build fails. +Numeric IDs don't require this lookup. -With the Dockerfile syntax version 1.10.0 and later, -the `--chmod` flag supports variable interpolation, -which lets you define the permission bits using build arguments: - -```dockerfile -# syntax=docker/dockerfile:1.10 -FROM alpine -WORKDIR /src -ARG MODE=440 -COPY --chmod=$MODE . . -``` +The `--chown` flag is not supported when building Windows containers. ### COPY --link @@ -1804,10 +1973,14 @@ path, using `--link` is always recommended. The performance of `--link` is equivalent or better than the default behavior and, it creates much better conditions for cache reuse. -### COPY --parents +When copying a path into a subdirectory, `--link` will always copy from the +root of the filesystem. When copying a directory, the existing mode is +overridden with the new mode from the copied path. If you need a specific mode +for a directory, such as the more permissive `/tmp` directory, you may need to +either avoid using `--link`, unroll the copy into its base components, or use +`--chmod` to ensure the overwriting directory contains the same permissions. -> [!NOTE] -> Not yet available in stable syntax, use [`docker/dockerfile:1.7-labs`](#syntax) version. +### COPY --parents ```dockerfile COPY [--parents[=<boolean>]] <src> ... <dest> @@ -1816,7 +1989,7 @@ COPY [--parents[=<boolean>]] <src> ... <dest> The `--parents` flag preserves parent directories for `src` entries. This flag defaults to `false`. ```dockerfile -# syntax=docker/dockerfile:1-labs +# syntax=docker/dockerfile:1 FROM scratch COPY ./x/a.txt ./y/a.txt /no_parents/ @@ -1836,7 +2009,7 @@ directories after it will be preserved. This may be especially useful copies bet with `--from` where the source paths need to be absolute. ```dockerfile -# syntax=docker/dockerfile:1-labs +# syntax=docker/dockerfile:1 FROM scratch COPY --parents ./x/./y/*.txt /parents/ @@ -1850,6 +2023,26 @@ COPY --parents ./x/./y/*.txt /parents/ # /parents/y/b.txt ``` +The `**` wildcard matches any number of path components, including none, and +can be used to recursively match files across directory levels: + +```dockerfile +# syntax=docker/dockerfile:1 +FROM scratch + +COPY --parents ./src/**/*.txt /parents/ + +# Build context: +# ./src/a.txt +# ./src/x/b.txt +# ./src/x/y/c.txt +# +# Output: +# /parents/src/a.txt +# /parents/src/x/b.txt +# /parents/src/x/y/c.txt +``` + Note that, without the `--parents` flag specified, any filename collision will fail the Linux `cp` operation with an explicit error message (`cp: will not overwrite just-created './x/a.txt' with './y/a.txt'`), where the @@ -1863,9 +2056,6 @@ with the `--parents` flag, the Buildkit is capable of packing multiple ### COPY --exclude -> [!NOTE] -> Not yet available in stable syntax, use [`docker/dockerfile:1.7-labs`](#syntax) version. - ```dockerfile COPY [--exclude=<path> ...] <src> ... <dest> ``` @@ -1878,19 +2068,19 @@ supporting wildcards and matching using Go's For example, to add all files starting with "hom", excluding files with a `.txt` extension: ```dockerfile -# syntax=docker/dockerfile:1-labs +# syntax=docker/dockerfile:1 FROM scratch COPY --exclude=*.txt hom* /mydir/ ``` You can specify the `--exclude` option multiple times for a `COPY` instruction. -Multiple `--excludes` are files matching its patterns not to be copied, -even if the files paths match the pattern specified in `<src>`. +Files matching any of the specified `--exclude` patterns are not copied, +even if their paths match the pattern specified in `<src>`. To add all files starting with "hom", excluding files with either `.txt` or `.md` extensions: ```dockerfile -# syntax=docker/dockerfile:1-labs +# syntax=docker/dockerfile:1 FROM scratch COPY --exclude=*.txt --exclude=*.md hom* /mydir/ @@ -1931,8 +2121,8 @@ This allows arguments to be passed to the entry point, i.e., `docker run <image> -d` will pass the `-d` argument to the entry point. You can override the `ENTRYPOINT` instruction using the `docker run --entrypoint` flag. -The shell form of `ENTRYPOINT` prevents any `CMD` command line arguments from -being used. It also starts your `ENTRYPOINT` as a subcommand of `/bin/sh -c`, +The shell form of `ENTRYPOINT` ignores any `CMD` or `docker run` command line +arguments. It also starts your `ENTRYPOINT` as a subcommand of `/bin/sh -c`, which does not pass signals. This means that the executable will not be the container's `PID 1`, and will not receive Unix signals. In this case, your executable doesn't receive a `SIGTERM` from `docker stop <container>`. @@ -1942,8 +2132,14 @@ Only the last `ENTRYPOINT` instruction in the Dockerfile will have an effect. ### Exec form ENTRYPOINT example You can use the exec form of `ENTRYPOINT` to set fairly stable default commands -and arguments and then use either form of `CMD` to set additional defaults that -are more likely to be changed. +and arguments and then use `CMD` to set additional defaults that are more +likely to be changed. + +When combining exec form `ENTRYPOINT` with `CMD`, use the exec form of `CMD` +as well. Using the shell form of `CMD` causes it to be wrapped in +`/bin/sh -c`, which means the `ENTRYPOINT` receives a shell invocation as its +argument rather than the bare command and parameters. See +[Understand how CMD and ENTRYPOINT interact](#understand-how-cmd-and-entrypoint-interact). ```dockerfile FROM ubuntu @@ -2247,7 +2443,7 @@ USER <UID>[:<GID>] The `USER` instruction sets the user name (or UID) and optionally the user group (or GID) to use as the default user and group for the remainder of the current stage. The specified user is used for `RUN` instructions and at -runtime, runs the relevant `ENTRYPOINT` and `CMD` commands. +runtime runs the relevant `ENTRYPOINT` and `CMD` commands. > Note that when specifying a group for the user, the user will have _only_ the > specified group membership. Any other configured group memberships will be ignored. @@ -2315,9 +2511,15 @@ Therefore, to avoid unintended operations in unknown directories, it's best prac ARG <name>[=<default value>] [<name>[=<default value>]...] ``` -The `ARG` instruction defines a variable that users can pass at build-time to +The `ARG` instruction defines a variable that users can pass at build time to the builder with the `docker build` command using the `--build-arg <varname>=<value>` -flag. +flag. This variable can be used in subsequent instructions such as `FROM`, `ENV`, +`WORKDIR`, and others using the `${VAR}` or `$VAR` template syntax. +It is also passed to all subsequent `RUN` instructions as a build-time +environment variable. + +Unlike `ENV`, an `ARG` variable is not embedded in the image and is not available +in the final container. > [!WARNING] > It isn't recommended to use build arguments for passing secrets such as @@ -2526,15 +2728,16 @@ RUN echo "I'm building for $TARGETPLATFORM" ### BuildKit built-in build args -| Arg | Type | Description | -| ------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BUILDKIT_CACHE_MOUNT_NS` | String | Set optional cache ID namespace. | -| `BUILDKIT_CONTEXT_KEEP_GIT_DIR` | Bool | Trigger Git context to keep the `.git` directory. | -| `BUILDKIT_INLINE_CACHE`[^2] | Bool | Inline cache metadata to image config or not. | -| `BUILDKIT_MULTI_PLATFORM` | Bool | Opt into deterministic output regardless of multi-platform output or not. | -| `BUILDKIT_SANDBOX_HOSTNAME` | String | Set the hostname (default `buildkitsandbox`) | -| `BUILDKIT_SYNTAX` | String | Set frontend image | -| `SOURCE_DATE_EPOCH` | Int | Set the Unix timestamp for created image and layers. More info from [reproducible builds](https://reproducible-builds.org/docs/source-date-epoch/). Supported since Dockerfile 1.5, BuildKit 0.11 | +| Arg | Type | Description | +|---------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `BUILDKIT_BUILD_NAME` | String | Override the build name shown in [`buildx history` command](https://docs.docker.com/reference/cli/docker/buildx/history/) and [Docker Desktop Builds view](https://docs.docker.com/desktop/use-desktop/builds/). | +| `BUILDKIT_CACHE_MOUNT_NS` | String | Set optional cache ID namespace. | +| `BUILDKIT_CONTEXT_KEEP_GIT_DIR` | Bool | Trigger Git context to keep the `.git` directory. | +| `BUILDKIT_INLINE_CACHE`[^2] | Bool | Inline cache metadata to image config or not. | +| `BUILDKIT_MULTI_PLATFORM` | Bool | Opt into deterministic output regardless of multi-platform output or not. | +| `BUILDKIT_SANDBOX_HOSTNAME` | String | Set the hostname (default `buildkitsandbox`) | +| `BUILDKIT_SYNTAX` | String | Set frontend image. Set to `dockerfile.v0` to ignore the Dockerfile `# syntax=` directive and use the built-in frontend instead. | +| `SOURCE_DATE_EPOCH` | Int | Set the Unix timestamp for created image and layers. More info from [reproducible builds](https://reproducible-builds.org/docs/source-date-epoch/). Supported since Dockerfile 1.5, BuildKit 0.11 | #### Example: keep `.git` dir @@ -2700,6 +2903,11 @@ for instance `SIGKILL`, or an unsigned number that matches a position in the kernel's syscall table, for instance `9`. The default is `SIGTERM` if not defined. +`STOPSIGNAL` applies to the signal sent by `docker stop` (and by the Docker +daemon when stopping a container). It does not affect signals sent by keyboard +shortcuts such as Ctrl+C, which sends `SIGINT` directly to the process +regardless of the `STOPSIGNAL` setting. + The image's default stopsignal can be overridden per container, using the `--stop-signal` flag on `docker run` and `docker create`. @@ -2730,9 +2938,12 @@ The options that can appear before `CMD` are: The health check will first run **interval** seconds after the container is started, and then again **interval** seconds after each previous check completes. +During the **start period**, health checks run at **start interval** frequency +instead. If a single run of the check takes longer than **timeout** seconds then the check -is considered to have failed. +is considered to have failed. The process performing the check is abruptly stopped +with a `SIGKILL`. It takes **retries** consecutive failures of the health check for the container to be considered `unhealthy`. diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/_index.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/_index.md index 0938ace3dfe8..2060cc6db45e 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/_index.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/_index.md @@ -100,12 +100,20 @@ To learn more about how to use build checks, see <td>FROM --platform flag should not use a constant value</td> </tr> <tr> - <td><a href="./copy-ignored-file/">CopyIgnoredFile (experimental)</a></td> + <td><a href="./copy-ignored-file/">CopyIgnoredFile</a></td> <td>Attempting to Copy file that is excluded by .dockerignore</td> </tr> <tr> <td><a href="./invalid-definition-description/">InvalidDefinitionDescription (experimental)</a></td> <td>Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.</td> </tr> + <tr> + <td><a href="./expose-proto-casing/">ExposeProtoCasing</a></td> + <td>Protocol in EXPOSE instruction should be lowercase</td> + </tr> + <tr> + <td><a href="./expose-invalid-format/">ExposeInvalidFormat</a></td> + <td>IP address and host-port mapping should not be used in EXPOSE instruction. This will become an error in a future release</td> + </tr> </tbody> </table> diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/copy-ignored-file.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/copy-ignored-file.md index 3e8e57e8d4c5..535da0be6375 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/copy-ignored-file.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/copy-ignored-file.md @@ -6,10 +6,6 @@ aliases: - /go/dockerfile/rule/copy-ignored-file/ --- -> [!NOTE] -> This check is experimental and is not enabled by default. To enable it, see -> [Experimental checks](https://docs.docker.com/go/build-checks-experimental/). - ## Output ```text diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-invalid-format.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-invalid-format.md new file mode 100644 index 000000000000..9198178f3305 --- /dev/null +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-invalid-format.md @@ -0,0 +1,55 @@ +--- +title: ExposeInvalidFormat +description: >- + IP address and host-port mapping should not be used in EXPOSE instruction. This will become an error in a future release +aliases: + - /go/dockerfile/rule/expose-invalid-format/ +--- + +## Output + +```text +EXPOSE instruction should not define an IP address or host-port mapping, found '127.0.0.1:80:80' +``` + +## Description + +The [`EXPOSE`](https://docs.docker.com/reference/dockerfile/#expose) instruction +in a Dockerfile is used to indicate which ports the container listens on at +runtime. It should not include an IP address or host-port mapping, as this is +not the intended use of the `EXPOSE` instruction. Instead, it should only +specify the port number and optionally the protocol (TCP or UDP). + +> [!IMPORTANT] +> This will become an error in a future release. + +## Examples + +❌ Bad: IP address and host-port mapping used. + +```dockerfile +FROM alpine +EXPOSE 127.0.0.1:80:80 +``` + +✅ Good: only the port number is specified. + +```dockerfile +FROM alpine +EXPOSE 80 +``` + +❌ Bad: Host-port mapping used. + +```dockerfile +FROM alpine +EXPOSE 80:80 +``` + +✅ Good: only the port number is specified. + +```dockerfile +FROM alpine +EXPOSE 80 +``` + diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-proto-casing.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-proto-casing.md new file mode 100644 index 000000000000..cfde7fe322ec --- /dev/null +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/expose-proto-casing.md @@ -0,0 +1,37 @@ +--- +title: ExposeProtoCasing +description: >- + Protocol in EXPOSE instruction should be lowercase +aliases: + - /go/dockerfile/rule/expose-proto-casing/ +--- + +## Output + +```text +Defined protocol '80/TcP' in EXPOSE instruction should be lowercase +``` + +## Description + +Protocol names in the [`EXPOSE`](https://docs.docker.com/reference/dockerfile/#expose) +instruction should be specified in lowercase to maintain consistency and +readability. This rule checks for protocols that are not in lowercase and +reports them. + +## Examples + +❌ Bad: protocol is not in lowercase. + +```dockerfile +FROM alpine +EXPOSE 80/TcP +``` + +✅ Good: protocol is in lowercase. + +```dockerfile +FROM alpine +EXPOSE 80/tcp +``` + diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/legacy-key-value-format.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/legacy-key-value-format.md index dc43b53cb736..471b0d6ea4b5 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/legacy-key-value-format.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/legacy-key-value-format.md @@ -55,3 +55,18 @@ ENV DEPS="\ make" ``` +> [!NOTE] +> Be aware of leading whitespace when converting multi-line legacy syntax to +> the modern `key=value` format. In the legacy format, leading whitespace on +> continuation lines is included in the value. In the modern format with +> quoted values, leading whitespace inside the quotes is also preserved. If +> you don't want leading whitespace in the value, make sure to remove it when +> rewriting to the new format: +> +> ```dockerfile +> ENV DEPS="\ +> curl \ +> git \ +> make" +> ``` + diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md index db9d1caae671..1184d089eb52 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/secrets-used-in-arg-or-env.md @@ -28,10 +28,27 @@ See [Build secrets](https://docs.docker.com/build/building/secrets/). ## Examples -❌ Bad: `AWS_SECRET_ACCESS_KEY` is a secret value. +❌ Bad: using ARG to pass AWS credentials. ```dockerfile -FROM scratch +ARG AWS_ACCESS_KEY_ID ARG AWS_SECRET_ACCESS_KEY +RUN aws s3 cp s3://my-bucket/file . +``` + +✅ Good: using secret mounts with environment variables. + +```dockerfile +RUN --mount=type=secret,id=aws_key_id,env=AWS_ACCESS_KEY_ID \ + --mount=type=secret,id=aws_secret_key,env=AWS_SECRET_ACCESS_KEY \ + aws s3 cp s3://my-bucket/file . +``` + +To build with these secrets: + +```console +$ docker buildx build \ + --secret id=aws_key_id,env=AWS_ACCESS_KEY_ID \ + --secret id=aws_secret_key,env=AWS_SECRET_ACCESS_KEY . ``` diff --git a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/workdir-relative-path.md b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/workdir-relative-path.md index 06043ea15a09..396be3e27134 100644 --- a/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/workdir-relative-path.md +++ b/_vendor/github.com/moby/buildkit/frontend/dockerfile/docs/rules/workdir-relative-path.md @@ -28,6 +28,12 @@ image built externally is prone to breaking, since working directory may change upstream without warning, resulting in a completely different directory hierarchy for your build. +> [!NOTE] +> +> `WORKDIR` does not perform shell expansion. Paths beginning with `~` or +> `~username` are treated as literal directory names and are not resolved to a +> user's home directory. + ## Examples ❌ Bad: this assumes that `WORKDIR` in the base image is `/` diff --git a/_vendor/github.com/moby/moby/api/docs/CHANGELOG.md b/_vendor/github.com/moby/moby/api/docs/CHANGELOG.md new file mode 100644 index 000000000000..b6d1ec5d5992 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/CHANGELOG.md @@ -0,0 +1,1317 @@ +--- +title: "Engine API version history" +description: "Documentation of changes that have been made to Engine API." +keywords: "API, Docker, rcli, REST, documentation" +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## v1.55 API changes + +* `GET /images/{name}/attestations` is a new endpoint that returns the in-toto + attestation statements attached to an image. The `platform` query parameter + selects the image variant (defaults to the daemon's host platform); it is + declared as a repeatable parameter for forward compatibility, but only one + value is currently accepted. The `type` query parameter may be repeated to + filter the returned statements by in-toto predicate type URI; if omitted, + all statements are returned. The `statement` query parameter (default + `false`) controls whether the verbatim statement body is included; when + omitted or `false`, each entry contains only the descriptor and predicate + type, and statement blobs are not read. The response is a JSON array of + `AttestationStatement` objects. +* `POST /containers/{id}/update` now supports per-device blkio resource + settings through the `BlkioWeightDevice`, `BlkioDeviceReadBps`, + `BlkioDeviceWriteBps`, `BlkioDeviceReadIOps`, and `BlkioDeviceWriteIOps` + fields. These fields were previously present in the request schema but were + ignored by the daemon. Omit a field or set it to `null` to leave the current + per-device rules unchanged. Set it to an empty array to clear the current + per-device rules for that resource type. + +## v1.54 API changes + +* `GET /images/json` now supports an `identity` query parameter. When set, + the response includes manifest summaries and may include an `Identity` field + for each manifest with trusted identity and origin information. +* `POST /networks/{id}/connect` now correctly applies the `MacAddress` field in + `EndpointSettings`. This field was added in API v1.44, but was previously ignored. + +## v1.53 API changes + +* `GET /info` now includes an `NRI` field. If the Node Resource Interface (NRI) + is enabled, this field contains information describing it. +* `GET /events` now also supports [`application/jsonl`](https://jsonlines.org/) + when negotiating content-type. +* `GET /images/{name}/json` now includes an `Identity` field with trusted + identity and origin information for the image. +* Deprecated: The `POST /grpc` and `POST /session` endpoints are deprecated and + will be removed in a future version. + +## v1.52 API changes + +* `GET /images/{name}/get` now accepts multiple `platform` query-arguments + to allow selecting which platform(s) of a multi-platform image must be + saved. +* `POST /images/load` now accepts multiple `platform` query-arguments + to allow selecting which platform(s) of a multi-platform image to load. +* `GET /events` no longer includes the deprecated `status`, `id`, and `from` + fields. These fields were removed in API v1.22, but still included + in the response. +* `GET /networks/{id}` now includes a `Status` field, providing statistics + about IPAM allocations for the subnets assigned to the network. +* Deprecated: the Engine was automatically backfilling empty `PortBindings` lists with + a PortBinding with an empty HostIP and HostPort when calling `POST /containers/{id}/start`. + This behavior is now deprecated, and a warning is returned by `POST /containers/create`. + A future API version will drop empty `PortBindings` list altogether. +* `GET /images/{name}/json` now omits the following `Config` fields when + not set, to closer align with the implementation of the [OCI Image Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/specs-go/v1/config.go#L23-L62) + `Cmd`, `Entrypoint`, `Env`, `Labels`, `OnBuild`, `User`, `Volumes`, and `WorkingDir`. +* `GET /images/{name}/json` now omits the following fields if their value + is empty: `Parent`, `Comment`, `DockerVersion`, `Author`. The `Parent` + and `DockerVersion` fields were set by the legacy builder, and are no + longer set when using BuildKit. The `Author` field is set through the + `MAINTAINER` Dockerfile instruction, which is deprecated, and the `Comment` + field is option, and may not be set depending on how the image was created. +* `GET /container/{id}/json` now omits `Config.OnBuild` if its value is empty. +* `GET /containers/{id}/json`: the `NetworkSettings` no longer returns the deprecated + `Bridge`, `HairpinMode`, `LinkLocalIPv6Address`, `LinkLocalIPv6PrefixLen`, + `SecondaryIPAddresses`, `SecondaryIPv6Addresses`, `EndpointID`, `Gateway`, + `GlobalIPv6Address`, `GlobalIPv6PrefixLen`, `IPAddress`, `IPPrefixLen`, + `IPv6Gateway`, and `MacAddress` fields. These fields were deprecated in + API v1.21 (docker v1.9.0) but kept around for backward compatibility. +* Removed the `KernelMemoryTCP` field from the `POST /containers/{id}/update` and + `GET /containers/{id}/json` endpoints, any value it is set to will be ignored + on API version `v1.52` and up. Older API versions still accept this field, but + may take no effect, depending on the kernel version and OCI runtime in use. +* Removed the `KernelMemoryTCP` field from the `GET /info` endpoint. +* `GET /events` supports content-type negotiation and can produce either `application/x-ndjson` + (Newline delimited JSON object stream) or `application/json-seq` (RFC7464). +* `POST /containers/create` no longer supports configuring a container-wide MAC address + via the container's `Config.MacAddress` field. A container's MAC address can now only + be configured via endpoint settings when connecting to a network. +* `GET /services` now returns `SwapBytes` and `MemorySwappiness` fields as part + of the `Resource` requirements. +* `GET /services/{id}` now returns `SwapBytes` and `MemorySwappiness` fields as + part of the `Resource` requirements. +* `POST /services/create` now accepts `SwapBytes` and `MemorySwappiness` fields + as part of the `Resource` requirements. +* `POST /services/{id}/update` now accepts `SwapBytes` and `MemorySwappiness` + fields as part of the `Resource` requirements. +* `GET /tasks` now returns `SwapBytes` and `MemorySwappiness` fields as part + of the `Resource` requirements. +* `GET /tasks/{id}` now returns `SwapBytes` and `MemorySwappiness` fields as + part of the `Resource` requirements. +* `GET /containers/{id}/stats` now returns an `os_type` field to allow platform- + specific handling of the stats. +* `GET /system/df` returns `ImagesUsage`, `ContainersUsage`, `VolumesUsage`, and + `BuildCacheUsage` fields with brief system disk usage data for each system object type. + The endpoint supports the `?verbose=1` query to return verbose system disk usage information. +* Deprecated: `GET /system/df` response fields `LayersSize`, `Images`, `Containers`, + `Volumes`, and `BuildCache` have been removed in favor of the-type specific usage fields. + API v1.52 returns both the legacy and current fields to help existing integrations + to transition to the new response. The legacy fields are not populated if the + `verbose` query parameter is used. Starting with API v1.53, the legacy fields + will no longer be returned. + +## v1.51 API changes + +* `GET /images/json` now sets the value of `Containers` field for all images + to the count of containers using the image. + This field was previously always -1. +* Deprecated: The field `NetworkSettings.Bridge` returned by `GET /containers/{id}/json` + is deprecated and will be removed in the next API version. +* Deprecated: The field `KernelMemoryTCP` as part of `POST /containers/{id}/update` + and returned by `GET /containers/{id}/json` is deprecated and will be removed + in the next API version. +* Deprecated: The field `KernelMemoryTCP` as part of `GET /info` is deprecated + and will be removed in the next API version. +* Deprecated: the `Parent` and `DockerVersion` fields returned by the + `GET /images/{name}/json` endpoint are deprecated. These fields are set by + the legacy builder, and are no longer set when using BuildKit. The API + continues returning these fields when set for informational purposes, but + they should not be depended on as they will be omitted once the legacy builder + is removed. +* Deprecated: the `Config.DockerVersion` field returned by the `GET /plugins` + and `GET /images/{name}/json` endpoints is deprecated. The field is no + longer set, and is omitted when empty. + +## v1.50 API changes + +* `GET /info` now includes a `DiscoveredDevices` field. This is an array of + `DeviceInfo` objects, each providing details about a device discovered by a + device driver. + Currently only the CDI device driver is supported. +* `DELETE /images/{name}` now supports a `platforms` query parameter. It accepts + an array of JSON-encoded OCI Platform objects, allowing for selecting specific + platforms to delete content for. +* Deprecated: The `BridgeNfIptables` and `BridgeNfIp6tables` fields in the + `GET /info` response were deprecated in API v1.48, and are now omitted + in API v1.50. +* Deprecated: `GET /images/{name}/json` no longer returns the following `Config` + fields; `Hostname`, `Domainname`, `AttachStdin`, `AttachStdout`, `AttachStderr` + `Tty`, `OpenStdin`, `StdinOnce`, `Image`, `NetworkDisabled` (already omitted unless set), + `MacAddress` (already omitted unless set), `StopTimeout` (already omitted unless set). + These additional fields were included in the response due to an implementation + detail but not part of the image's Configuration. These fields were marked + deprecated in API v1.46, and are now omitted. Older versions of the API still + return these fields, but they are always empty. + +## v1.49 API changes + +* `GET /images/{name}/json` now supports a `platform` parameter (JSON + encoded OCI Platform type) allowing to specify a platform of the multi-platform + image to inspect. + This option is mutually exclusive with the `manifests` option. +* `GET /info` now returns a `FirewallBackend` containing information about + the daemon's firewalling configuration. +* Deprecated: The `AllowNondistributableArtifactsCIDRs` and `AllowNondistributableArtifactsHostnames` + fields in the `RegistryConfig` struct in the `GET /info` response are omitted + in API v1.49. +* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and + `InitCommit.Expected` fields in the `GET /info` endpoint were deprecated + in API v1.48, and are now omitted in API v1.49. + +## v1.48 API changes + +* Deprecated: The "error" and "progress" fields in streaming responses for + endpoints that return a JSON progress response, such as `POST /images/create`, + `POST /images/{name}/push`, and `POST /build` are deprecated. These fields + were marked deprecated in API v1.4 (docker v0.6.0) and API v1.8 (docker v0.7.1) + respectively, but still returned. These fields will be left empty or will + be omitted in a future API version. Users should use the information in the + `errorDetail` and `progressDetail` fields instead. +* Deprecated: The "allow-nondistributable-artifacts" daemon configuration is + deprecated and enabled by default. The `AllowNondistributableArtifactsCIDRs` + and `AllowNondistributableArtifactsHostnames` fields in the `RegistryConfig` + struct in the `GET /info` response will now always be `null` and will be + omitted in API v1.49. +* Deprecated: The `BridgeNfIptables` and `BridgeNfIp6tables` fields in the + `GET /info` response are now always be `false` and will be omitted in API + v1.49. The netfilter module is now loaded on-demand, and no longer during + daemon startup, making these fields obsolete. +* Deprecated: The `POST /build/prune` `keep-storage` query parameter has been + renamed to `reserved-space`. `keep-storage` support will be removed in API v1.52. +* `GET /images/{name}/history` now supports a `platform` parameter (JSON + encoded OCI Platform type) that allows to specify a platform to show the + history of. +* `POST /images/{name}/load` and `GET /images/{name}/get` now support a + `platform` parameter (JSON encoded OCI Platform type) that allows to specify + a platform to load/save. Not passing this parameter will result in + loading/saving the full multi-platform image. +* `POST /containers/create` now includes a warning in the response when setting + the container-wide `Config.VolumeDriver` option in combination with volumes + defined through `Mounts` because the `VolumeDriver` option has no effect on + those volumes. This warning was previously generated by the CLI, but now + moved to the daemon so that other clients can also get this warning. +* `POST /containers/create` now supports `Mount` of type `image` for mounting + an image inside a container. +* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and + `InitCommit.Expected` fields in the `GET /info` endpoint are deprecated + and will be omitted in API v1.49. +* `Sysctls` in `HostConfig` (top level `--sysctl` settings) for `eth0` are + no longer migrated to `DriverOpts`, as described in the changes for v1.46. +* `GET /images/json` and `GET /images/{name}/json` responses now include + `Descriptor` field, which contains an OCI descriptor of the image target. + The new field will only be populated if the daemon provides a multi-platform + image store. + WARNING: This is experimental and may change at any time without any backward + compatibility. +* `GET /images/{name}/json` response now will return the `Manifests` field + containing information about the sub-manifests contained in the image index. + This includes things like platform-specific manifests and build attestations. + The new field will only be populated if the request also sets the `manifests` + query parameter to `true`. + This acts the same as in the `GET /images/json` endpoint. + WARNING: This is experimental and may change at any time without any backward compatibility. +* `GET /containers/{name}/json` now returns an `ImageManifestDescriptor` field + containing the OCI descriptor of the platform-specific image manifest of the + image that was used to create the container. + This field is only populated if the daemon provides a multi-platform image + store. +* `POST /networks/create` now has an `EnableIPv4` field. Setting it to `false` + disables IPv4 IPAM for the network. It can only be set to `false` if the + daemon has experimental features enabled. +* `GET /networks/{id}` now returns an `EnableIPv4` field showing whether the + network has IPv4 IPAM enabled. +* `POST /networks/{id}/connect` and `POST /containers/create` now accept a + `GwPriority` field in `EndpointsConfig`. This value is used to determine which + network endpoint provides the default gateway for the container. The endpoint + with the highest priority is selected. If multiple endpoints have the same + priority, endpoints are sorted lexicographically by their network name, and + the one that sorts first is picked. +* `GET /containers/json` now returns a `GwPriority` field in `NetworkSettings` + for each network endpoint. +* API debug endpoints (`GET /debug/vars`, `GET /debug/pprof/`, `GET /debug/pprof/cmdline`, + `GET /debug/pprof/profile`, `GET /debug/pprof/symbol`, `GET /debug/pprof/trace`, + `GET /debug/pprof/{name}`) are now also accessible through the versioned-API + paths (`/v<API-version>/<endpoint>`). +* `POST /build/prune` renames `keep-storage` to `reserved-space` and now supports + additional prune parameters `max-used-space` and `min-free-space`. +* `GET /containers/json` now returns an `ImageManifestDescriptor` field + matching the same field in `/containers/{name}/json`. + This field is only populated if the daemon provides a multi-platform image + store. + +## v1.47 API changes + +* `GET /images/json` response now includes `Manifests` field, which contains + information about the sub-manifests included in the image index. This + includes things like platform-specific manifests and build attestations. + The new field will only be populated if the request also sets the `manifests` + query parameter to `true`. + WARNING: This is experimental and may change at any time without any backward + compatibility. +* `GET /info` no longer includes warnings when `bridge-nf-call-iptables` or + `bridge-nf-call-ip6tables` are disabled when the daemon was started. The + `br_netfilter` module is now attempted to be loaded when needed, making those + warnings inaccurate. This change is not versioned, and affects all API versions + if the daemon has this patch. + +## v1.46 API changes + +* `GET /info` now includes a `Containerd` field containing information about + the location of the containerd API socket and containerd namespaces used + by the daemon to run containers and plugins. +* `POST /containers/create` field `NetworkingConfig.EndpointsConfig.DriverOpts`, + and `POST /networks/{id}/connect` field `EndpointsConfig.DriverOpts`, now + support label `com.docker.network.endpoint.sysctls` for setting per-interface + sysctls. The value is a comma separated list of sysctl assignments, the + interface name must be "IFNAME". For example, to set + `net.ipv4.config.eth0.log_martians=1`, use + `net.ipv4.config.IFNAME.log_martians=1`. In API versions up-to 1.46, top level + `--sysctl` settings for `eth0` will be migrated to `DriverOpts` when possible. + This automatic migration will be removed in a future release. +* `GET /containers/json` now returns the annotations of containers. +* `POST /images/{name}/push` now supports a `platform` parameter (JSON encoded + OCI Platform type) that allows selecting a specific platform manifest from + the multi-platform image. +* `POST /containers/create` now takes `Options` as part of `HostConfig.Mounts.TmpfsOptions` to set options for tmpfs mounts. +* `POST /services/create` now takes `Options` as part of `ContainerSpec.Mounts.TmpfsOptions`, to set options for tmpfs mounts. +* `GET /events` now supports image `create` event that is emitted when a new + image is built regardless if it was tagged or not. + +#### Deprecated Config fields in `GET /images/{name}/json` response + +The `Config` field returned by this endpoint (used for "image inspect") returns +additional fields that are not part of the image's configuration and not part of +the [Docker Image Spec] and the [OCI Image Spec]. + +These additional fields are included in the response, due to an +implementation detail, where the [api/types.ImageInspec] type used +for the response is using the [container.Config] type. + +The [container.Config] type is a superset of the image config, and while the +image's Config is used as a _template_ for containers created from the image, +the additional fields are set at runtime (from options passed when creating +the container) and not taken from the image Config. + +These fields are never set (and always return the default value for the type), +but are not omitted in the response when left empty. As these fields were not +intended to be part of the image configuration response, they are deprecated, +and will be removed from the API. + +The following fields are currently included in the API response, but +are not part of the underlying image's Config, and deprecated: + +- `Hostname` +- `Domainname` +- `AttachStdin` +- `AttachStdout` +- `AttachStderr` +- `Tty` +- `OpenStdin` +- `StdinOnce` +- `Image` +- `NetworkDisabled` (already omitted unless set) +- `MacAddress` (already omitted unless set) +- `StopTimeout` (already omitted unless set) + +[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 +[OCI Image Spec]: https://github.com/opencontainers/image-spec/blob/v1.1.0/specs-go/v1/config.go#L24-L62 +[api/types.ImageInspec]: https://github.com/moby/moby/blob/v26.1.4/api/types/types.go#L87-L104 +[container.Config]: https://github.com/moby/moby/blob/v26.1.4/api/types/container/config.go#L47-L82 + +* `POST /services/create` and `POST /services/{id}/update` now support OomScoreAdj + +## v1.45 API changes + +* `POST /containers/create` now supports `VolumeOptions.Subpath` which allows a + subpath of a named volume to be mounted. +* `POST /images/search` will always assume a `false` value for the `is-automated` + field. Consequently, searching for `is-automated=true` will yield no results, + while `is-automated=false` will be a no-op. +* `GET /images/{name}/json` no longer includes the `Container` and + `ContainerConfig` fields. To access image configuration, use `Config` field + instead. +* The `Aliases` field returned in calls to `GET /containers/{name:.*}/json` no + longer contains the short container ID, but instead will reflect exactly the + values originally submitted to the `POST /containers/create` endpoint. The + newly introduced `DNSNames` should now be used instead when short container + IDs are needed. + +## v1.44 API changes + +* GET `/images/json` now accepts an `until` filter. This accepts a timestamp and + lists all images created before it. The `<timestamp>` can be Unix timestamps, + date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) + computed relative to the daemon machine’s time. This change is not versioned, + and affects all API versions if the daemon has this patch. +* The `VirtualSize` field in the `GET /images/{name}/json`, `GET /images/json`, + and `GET /system/df` responses is now omitted. Use the `Size` field instead, + which contains the same information. +* Deprecated: The `is_automated` field in the `GET /images/search` response has + been deprecated and will always be set to false in the future because Docker + Hub is deprecating the `is_automated` field in its search API. The deprecation + is not versioned, and applies to all API versions. +* Deprecated: The `is-automated` filter for the `GET /images/search` endpoint. + The `is_automated` field has been deprecated by Docker Hub's search API. + Consequently, searching for `is-automated=true` will yield no results. The + deprecation is not versioned, and applies to all API versions. +* Read-only bind mounts are now made recursively read-only on kernel >= 5.12 + with runtimes which support the feature. + `POST /containers/create`, `GET /containers/{id}/json`, and `GET /containers/json` now supports + `BindOptions.ReadOnlyNonRecursive` and `BindOptions.ReadOnlyForceRecursive` to customize the behavior. +* `POST /containers/create` now accepts a `HealthConfig.StartInterval` to set the + interval for health checks during the start period. +* `GET /info` now includes a `CDISpecDirs` field indicating the configured CDI + specifications directories. The use of the applied setting requires the daemon + to have experimental enabled, and for non-experimental daemons an empty list is + always returned. +* `POST /networks/create` now returns a 400 if the `IPAMConfig` has invalid + values. Note that this change is _unversioned_ and applied to all API + versions on daemon that support version 1.44. +* `POST /networks/create` with a duplicated name now fails systematically. As + such, the `CheckDuplicate` field is now deprecated. Note that this change is + _unversioned_ and applied to all API versions on daemon that support version + 1.44. +* `POST /containers/create` now accepts multiple `EndpointSettings` in + `NetworkingConfig.EndpointSettings`. +* `POST /containers/create` and `POST /networks/{id}/connect` will now catch + validation errors that were previously only returned during `POST /containers/{id}/start`. + These endpoints will also return the full set of validation errors they find, + instead of returning only the first one. + Note that this change is _unversioned_ and applies to all API versions. +* `POST /services/create` and `POST /services/{id}/update` now accept `Seccomp` + and `AppArmor` fields in the `ContainerSpec.Privileges` object. This allows + some configuration of Seccomp and AppArmor in Swarm services. +* A new endpoint-specific `MacAddress` field has been added to `NetworkSettings.EndpointSettings` + on `POST /containers/create`, and to `EndpointConfig` on `POST /networks/{id}/connect`. + The container-wide `MacAddress` field in `Config`, on `POST /containers/create`, is now deprecated. +* The field `Networks` in the `POST /services/create` and `POST /services/{id}/update` + requests is now deprecated. You should instead use the field `TaskTemplate.Networks`. +* The `Container` and `ContainerConfig` fields in the `GET /images/{name}/json` + response are deprecated and will no longer be included in API v1.45. +* `GET /info` now includes `status` properties in `Runtimes`. +* A new field named `DNSNames` and containing all non-fully qualified DNS names + a container takes on a specific network has been added to `GET /containers/{name:.*}/json`. +* The `Aliases` field returned in calls to `GET /containers/{name:.*}/json` in v1.44 and older + versions contains the short container ID. This will change in the next API version, v1.45. + Starting with that API version, this specific value will be removed from the `Aliases` field + such that this field will reflect exactly the values originally submitted to the + `POST /containers/create` endpoint. The newly introduced `DNSNames` should now be used instead. +* The fields `HairpinMode`, `LinkLocalIPv6Address`, `LinkLocalIPv6PrefixLen`, `SecondaryIPAddresses`, + `SecondaryIPv6Addresses` available in `NetworkSettings` when calling `GET /containers/{id}/json` are + deprecated and will be removed in a future release. You should instead look for the default network in + `NetworkSettings.Networks`. +* `GET /images/{id}/json` omits the `Created` field (previously it was `0001-01-01T00:00:00Z`) + if the `Created` field is missing from the image config. + +## v1.43 API changes + +* `POST /containers/create` now accepts `Annotations` as part of `HostConfig`. + Can be used to attach arbitrary metadata to the container, which will also be + passed to the runtime when the container is started. +* `GET /images/json` no longer includes hardcoded `<none>:<none>` and + `<none>@<none>` in `RepoTags` and`RepoDigests` for untagged images. + In such cases, empty arrays will be produced instead. +* The `VirtualSize` field in the `GET /images/{name}/json`, `GET /images/json`, + and `GET /system/df` responses is deprecated and will no longer be included + in API v1.44. Use the `Size` field instead, which contains the same information. +* `GET /info` now includes `no-new-privileges` in the `SecurityOptions` string + list when this option is enabled globally. This change is not versioned, and + affects all API versions if the daemon has this patch. + +## v1.42 API changes + +* Removed the `BuilderSize` field on the `GET /system/df` endpoint. This field + was introduced in API 1.31 as part of an experimental feature, and no longer + used since API 1.40. + Use field `BuildCache` instead to track storage used by the builder component. +* `POST /containers/{id}/stop` and `POST /containers/{id}/restart` now accept a + `signal` query parameter, which allows overriding the container's default stop- + signal. +* `GET /images/json` now accepts query parameter `shared-size`. When set `true`, + images returned will include `SharedSize`, which provides the size on disk shared + with other images present on the system. +* `GET /system/df` now accepts query parameter `type`. When set, + computes and returns data only for the specified object type. + The parameter can be specified multiple times to select several object types. + Supported values are: `container`, `image`, `volume`, `build-cache`. +* `GET /system/df` can now be used concurrently. If a request is made while a + previous request is still being processed, the request will receive the result + of the already running calculation, once completed. Previously, an error + (`a disk usage operation is already running`) would be returned in this + situation. This change is not versioned, and affects all API versions if the + daemon has this patch. +* The `POST /images/create` now supports both the operating system and architecture + that is passed through the `platform` query parameter when using the `fromSrc` + option to import an image from an archive. Previously, only the operating system + was used and the architecture was ignored. If no `platform` option is set, the + host's operating system and architecture as used as default. This change is not + versioned, and affects all API versions if the daemon has this patch. +* The `POST /containers/{id}/wait` endpoint now returns a `400` status code if an + invalid `condition` is provided (on API 1.30 and up). +* Removed the `KernelMemory` field from the `POST /containers/create` and + `POST /containers/{id}/update` endpoints, any value it is set to will be ignored + on API version `v1.42` and up. Older API versions still accept this field, but + may take no effect, depending on the kernel version and OCI runtime in use. +* `GET /containers/{id}/json` now omits the `KernelMemory` and `KernelMemoryTCP` + if they are not set. +* `GET /info` now omits the `KernelMemory` and `KernelMemoryTCP` if they are not + supported by the host or host's configuration (if cgroups v2 are in use). +* `GET /_ping` and `HEAD /_ping` now return `Builder-Version` by default. + This header contains the default builder to use, and is a recommendation as + advertised by the daemon. However, it is up to the client to choose which builder + to use. + + The default value on Linux is version "2" (BuildKit), but the daemon can be + configured to recommend version "1" (classic Builder). Windows does not yet + support BuildKit for native Windows images, and uses "1" (classic builder) as + a default. + + This change is not versioned, and affects all API versions if the daemon has + this patch. +* `GET /_ping` and `HEAD /_ping` now return a `Swarm` header, which allows a + client to detect if Swarm is enabled on the daemon, without having to call + additional endpoints. + This change is not versioned, and affects all API versions if the daemon has + this patch. Clients must consider this header "optional", and fall back to + using other endpoints to get this information if the header is not present. + + The `Swarm` header can contain one of the following values: + + - "inactive" + - "pending" + - "error" + - "locked" + - "active/worker" + - "active/manager" +* `POST /containers/create` for Windows containers now accepts a new syntax in + `HostConfig.Resources.Devices.PathOnHost`. As well as the existing `class/<GUID>` + syntax, `<IDType>://<ID>` is now recognised. Support for specific `<IDType>` values + depends on the underlying implementation and Windows version. This change is not + versioned, and affects all API versions if the daemon has this patch. +* `GET /containers/{id}/attach`, `GET /exec/{id}/start`, `GET /containers/{id}/logs` + `GET /services/{id}/logs` and `GET /tasks/{id}/logs` now set Content-Type header + to `application/vnd.docker.multiplexed-stream` when a multiplexed stdout/stderr + stream is sent to client, `application/vnd.docker.raw-stream` otherwise. +* `POST /volumes/create` now accepts a new `ClusterVolumeSpec` to create a cluster + volume (CNI). This option can only be used if the daemon is a Swarm manager. + The Volume response on creation now also can contain a `ClusterVolume` field + with information about the created volume. +* The `BuildCache.Parent` field, as returned by `GET /system/df` is deprecated + and is now omitted. API versions before v1.42 continue to include this field. +* `GET /system/df` now includes a new `Parents` field, for "build-cache" records, + which contains a list of parent IDs for the build-cache record. +* Volume information returned by `GET /volumes/{name}`, `GET /volumes` and + `GET /system/df` can now contain a `ClusterVolume` if the volume is a cluster + volume (requires the daemon to be a Swarm manager). +* The `Volume` type, as returned by `Added new `ClusterVolume` fields +* Added a new `PUT /volumes{name}` endpoint to update cluster volumes (CNI). + Cluster volumes are only supported if the daemon is a Swarm manager. +* `GET /containers/{name}/attach/ws` endpoint now accepts `stdin`, `stdout` and + `stderr` query parameters to only attach to configured streams. + + NOTE: These parameters were documented before in older API versions, but not + actually supported. API versions before v1.42 continue to ignore these parameters + and default to attaching to all streams. To preserve the pre-v1.42 behavior, + set all three query parameters (`?stdin=1,stdout=1,stderr=1`). +* `POST /containers/create` on Linux now respects the `HostConfig.ConsoleSize` property. + Container is immediately created with the desired terminal size and clients no longer + need to set the desired size on their own. +* `POST /containers/create` allow to set `CreateMountpoint` for host path to be + created if missing. This brings parity with `Binds` +* `POST /containers/create` rejects request if BindOptions|VolumeOptions|TmpfsOptions + is set with a non-matching mount Type. +* `POST /containers/{id}/exec` now accepts an optional `ConsoleSize` parameter. + It allows to set the console size of the executed process immediately when it's created. +* `POST /volumes/prune` will now only prune "anonymous" volumes (volumes which were not given a name) by default. A new filter parameter `all` can be set to a truth-y value (`true`, `1`) to get the old behavior. + +## v1.41 API changes + +* `GET /events` now returns `prune` events after pruning resources have completed. + Prune events are returned for `container`, `network`, `volume`, `image`, and + `builder`, and have a `reclaimed` attribute, indicating the amount of space + reclaimed (in bytes). +* `GET /info` now returns a `CgroupVersion` field, containing the cgroup version. +* `GET /info` now returns a `DefaultAddressPools` field, containing a list of + custom default address pools for local networks, which can be specified in the + `daemon.json` file or `--default-address-pool` dockerd option. +* `POST /services/create` and `POST /services/{id}/update` now supports `BindOptions.NonRecursive`. +* The `ClusterStore` and `ClusterAdvertise` fields in `GET /info` are deprecated + and are now omitted if they contain an empty value. This change is not versioned, + and affects all API versions if the daemon has this patch. +* The `filter` (singular) query parameter, which was deprecated in favor of the + `filters` option in Docker 1.13, has now been removed from the `GET /images/json` + endpoint. The parameter remains available when using API version 1.40 or below. +* `GET /services` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `GET /services/{id}` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `POST /services/create` now accepts `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `POST /services/{id}/update` now accepts `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `GET /tasks` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `GET /tasks/{id}` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. +* `GET /services` now returns `Pids` in `TaskTemplate.Resources.Limits`. +* `GET /services/{id}` now returns `Pids` in `TaskTemplate.Resources.Limits`. +* `POST /services/create` now accepts `Pids` in `TaskTemplate.Resources.Limits`. +* `POST /services/{id}/update` now accepts `Pids` in `TaskTemplate.Resources.Limits` + to limit the maximum number of PIDs. +* `GET /tasks` now returns `Pids` in `TaskTemplate.Resources.Limits`. +* `GET /tasks/{id}` now returns `Pids` in `TaskTemplate.Resources.Limits`. +* `POST /containers/create` now accepts a `platform` query parameter in the format + `os[/arch[/variant]]`. + + When set, the daemon checks if the requested image is present in the local image + cache with the given OS and Architecture, and otherwise returns a `404` status. + + If the option is _not_ set, the host's native OS and Architecture are used to + look up the image in the image cache. However, if no platform is passed and the + given image _does_ exist in the local image cache, but its OS or architecture + do not match, the container is created with the available image, and a warning + is added to the `Warnings` field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + +* `POST /containers/create` on Linux now accepts the `HostConfig.CgroupnsMode` property. + Set the property to `host` to create the container in the daemon's cgroup namespace, or + `private` to create the container in its own private cgroup namespace. The per-daemon + default is `host`, and can be changed by using the`CgroupNamespaceMode` daemon configuration + parameter. +* `GET /info` now returns an `OSVersion` field, containing the operating system's + version. This change is not versioned, and affects all API versions if the daemon + has this patch. +* `GET /info` no longer returns the `SystemStatus` field if it does not have a + value set. This change is not versioned, and affects all API versions if the + daemon has this patch. +* `GET /services` now accepts query parameter `status`. When set `true`, + services returned will include `ServiceStatus`, which provides Desired, + Running, and Completed task counts for the service. +* `GET /services` may now include `ReplicatedJob` or `GlobalJob` as the `Mode` + in a `ServiceSpec`. +* `GET /services/{id}` may now include `ReplicatedJob` or `GlobalJob` as the + `Mode` in a `ServiceSpec`. +* `POST /services/create` now accepts `ReplicatedJob or `GlobalJob` as the `Mode` + in the `ServiceSpec. +* `POST /services/{id}/update` accepts updating the fields of the + `ReplicatedJob` object in the `ServiceSpec.Mode`. The service mode still + cannot be changed, however. +* `GET /services` now includes `JobStatus` on Services with mode + `ReplicatedJob` or `GlobalJob`. +* `GET /services/{id}` now includes `JobStatus` on Services with mode + `ReplicatedJob` or `GlobalJob`. +* `GET /tasks` now includes `JobIteration` on Tasks spawned from a job-mode + service. +* `GET /tasks/{id}` now includes `JobIteration` on the task if spawned from a + job-mode service. +* `GET /containers/{id}/stats` now accepts a query param (`one-shot`) which, when used with `stream=false` fetches a + single set of stats instead of waiting for two collection cycles to have 2 CPU stats over a 1 second period. +* The `KernelMemory` field in `HostConfig.Resources` is now deprecated. +* The `KernelMemory` field in `Info` is now deprecated. +* `GET /services` now returns `Ulimits` as part of `ContainerSpec`. +* `GET /services/{id}` now returns `Ulimits` as part of `ContainerSpec`. +* `POST /services/create` now accepts `Ulimits` as part of `ContainerSpec`. +* `POST /services/{id}/update` now accepts `Ulimits` as part of `ContainerSpec`. + +## v1.40 API changes + +* The `/_ping` endpoint can now be accessed both using `GET` or `HEAD` requests. + when accessed using a `HEAD` request, all headers are returned, but the body + is empty (`Content-Length: 0`). This change is not versioned, and affects all + API versions if the daemon has this patch. Clients are recommended to try + using `HEAD`, but fallback to `GET` if the `HEAD` requests fails. +* `GET /_ping` and `HEAD /_ping` now set `Cache-Control` and `Pragma` headers to + prevent the result from being cached. This change is not versioned, and affects + all API versions if the daemon has this patch. +* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`. +* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`. +* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`. +* `POST /services/create` now accepts `Config` as part of `ContainerSpec.Privileges.CredentialSpec`. +* `POST /services/{id}/update` now accepts `Config` as part of `ContainerSpec.Privileges.CredentialSpec`. +* `POST /services/create` now includes `Runtime` as an option in `ContainerSpec.Configs` +* `POST /services/{id}/update` now includes `Runtime` as an option in `ContainerSpec.Configs` +* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`. +* `GET /networks` now supports a `dangling` filter type. When set to `true` (or + `1`), the endpoint returns all networks that are not in use by a container. When + set to `false` (or `0`), only networks that are in use by one or more containers + are returned. +* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based + on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>` + to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>` + to return those without the specified labels. +* `POST /containers/create` now accepts a `fluentd-async` option in `HostConfig.LogConfig.Config` + when using the Fluentd logging driver. This option deprecates the `fluentd-async-connect` + option, which remains functional, but will be removed in a future release. Users + are encouraged to use the `fluentd-async` option going forward. This change is + not versioned, and affects all API versions if the daemon has this patch. +* `POST /containers/create` now accepts a `fluentd-request-ack` option in + `HostConfig.LogConfig.Config` when using the Fluentd logging driver. If enabled, + the Fluentd logging driver sends the chunk option with a unique ID. The server + will respond with an acknowledgement. This option improves the reliability of + the message transmission. This change is not versioned, and affects all API + versions if the daemon has this patch. +* `POST /containers/create`, `GET /containers/{id}/json`, and `GET /containers/json` now supports + `BindOptions.NonRecursive`. +* `POST /swarm/init` now accepts a `DataPathPort` property to set data path port number. +* `GET /info` now returns information about `DataPathPort` that is currently used in swarm +* `GET /info` now returns `PidsLimit` boolean to indicate if the host kernel has + PID limit support enabled. +* `GET /info` now includes `name=rootless` in `SecurityOptions` when the daemon is running in + rootless mode. This change is not versioned, and affects all API versions if the daemon has + this patch. +* `GET /info` now returns `none` as `CgroupDriver` when the daemon is running in rootless mode. + This change is not versioned, and affects all API versions if the daemon has this patch. +* `POST /containers/create` now accepts `DeviceRequests` as part of `HostConfig`. + Can be used to set Nvidia GPUs. +* `GET /swarm` endpoint now returns DataPathPort info +* `POST /containers/create` now takes `KernelMemoryTCP` field to set hard limit for kernel TCP buffer memory. +* `GET /service` now returns `MaxReplicas` as part of the `Placement`. +* `GET /service/{id}` now returns `MaxReplicas` as part of the `Placement`. +* `POST /service/create` and `POST /services/(id or name)/update` now take the field `MaxReplicas` + as part of the service `Placement`, allowing to specify maximum replicas per node for the service. +* `POST /containers/create` on Linux now creates a container with `HostConfig.IpcMode=private` + by default, if IpcMode is not explicitly specified. The per-daemon default can be changed + back to `shareable` by using `DefaultIpcMode` daemon configuration parameter. +* `POST /containers/{id}/update` now accepts a `PidsLimit` field to tune a container's + PID limit. Set `0` or `-1` for unlimited. Leave `null` to not change the current value. +* `POST /build` now accepts `outputs` key for configuring build outputs when using BuildKit mode. + +## V1.39 API changes + +* `GET /info` now returns an empty string, instead of `<unknown>` for `KernelVersion` + and `OperatingSystem` if the daemon was unable to obtain this information. +* `GET /info` now returns information about the product license, if a license + has been applied to the daemon. +* `GET /info` now returns a `Warnings` field, containing warnings and informational + messages about missing features, or issues related to the daemon configuration. +* `POST /swarm/init` now accepts a `DefaultAddrPool` property to set global scope default address pool +* `POST /swarm/init` now accepts a `SubnetSize` property to set global scope networks by giving the + length of the subnet masks for every such network +* `POST /session` (added in [V1.31](#v131-api-changes) is no longer experimental. + This endpoint can be used to run interactive long-running protocols between the + client and the daemon. + +## V1.38 API changes + +* `GET /tasks` and `GET /tasks/{id}` now return a `NetworkAttachmentSpec` field, + containing the `ContainerID` for non-service containers connected to "attachable" + swarm-scoped networks. + +## v1.37 API changes + +* `POST /containers/create` and `POST /services/create` now supports exposing SCTP ports. +* `POST /configs/create` and `POST /configs/{id}/create` now accept a `Templating` driver. +* `GET /configs` and `GET /configs/{id}` now return the `Templating` driver of the config. +* `POST /secrets/create` and `POST /secrets/{id}/create` now accept a `Templating` driver. +* `GET /secrets` and `GET /secrets/{id}` now return the `Templating` driver of the secret. + +## v1.36 API changes + +* `Get /events` now return `exec_die` event when an exec process terminates. + + +## v1.35 API changes + +* `POST /services/create` and `POST /services/(id)/update` now accepts an + `Isolation` field on container spec to set the Isolation technology of the + containers running the service (`default`, `process`, or `hyperv`). This + configuration is only used for Windows containers. +* `GET /containers/(name)/logs` now supports an additional query parameter: `until`, + which returns log lines that occurred before the specified timestamp. +* `POST /containers/{id}/exec` now accepts a `WorkingDir` property to set the + work-dir for the exec process, independent of the container's work-dir. +* `Get /version` now returns a `Platform.Name` field, which can be used by products + using Moby as a foundation to return information about the platform. +* `Get /version` now returns a `Components` field, which can be used to return + information about the components used. Information about the engine itself is + now included as a "Component" version, and contains all information from the + top-level `Version`, `GitCommit`, `APIVersion`, `MinAPIVersion`, `GoVersion`, + `Os`, `Arch`, `BuildTime`, `KernelVersion`, and `Experimental` fields. Going + forward, the information from the `Components` section is preferred over their + top-level counterparts. + + +## v1.34 API changes + +* `POST /containers/(name)/wait?condition=removed` now also also returns + in case of container removal failure. A pointer to a structure named + `Error` added to the response JSON in order to indicate a failure. + If `Error` is `null`, container removal has succeeded, otherwise + the test of an error message indicating why container removal has failed + is available from `Error.Message` field. + +## v1.33 API changes + +* `GET /events` now supports filtering 4 more kinds of events: `config`, `node`, +`secret` and `service`. + +## v1.32 API changes + +* `POST /images/create` now accepts a `platform` parameter in the form of `os[/arch[/variant]]`. +* `POST /containers/create` now accepts additional values for the + `HostConfig.IpcMode` property. New values are `private`, `shareable`, + and `none`. +* `DELETE /networks/{id or name}` fixed issue where a `name` equal to another + network's name was able to mask that `id`. If both a network with the given + _name_ exists, and a network with the given _id_, the network with the given + _id_ is now deleted. This change is not versioned, and affects all API versions + if the daemon has this patch. + +## v1.31 API changes + +* `DELETE /secrets/(name)` now returns status code 404 instead of 500 when the secret does not exist. +* `POST /secrets/create` now returns status code 409 instead of 500 when creating an already existing secret. +* `POST /secrets/create` now accepts a `Driver` struct, allowing the + `Name` and driver-specific `Options` to be passed to store a secrets + in an external secrets store. The `Driver` property can be omitted + if the default (internal) secrets store is used. +* `GET /secrets/(id)` and `GET /secrets` now return a `Driver` struct, + containing the `Name` and driver-specific `Options` of the external + secrets store used to store the secret. The `Driver` property is + omitted if no external store is used. +* `POST /secrets/(name)/update` now returns status code 400 instead of 500 when updating a secret's content which is not the labels. +* `POST /nodes/(name)/update` now returns status code 400 instead of 500 when demoting last node fails. +* `GET /networks/(id or name)` now takes an optional query parameter `scope` that will filter the network based on the scope (`local`, `swarm`, or `global`). +* `POST /session` is a new endpoint that can be used for running interactive long-running protocols between client and + the daemon. This endpoint is experimental and only available if the daemon is started with experimental features + enabled. +* `GET /images/(name)/get` now includes an `ImageMetadata` field which contains image metadata that is local to the engine and not part of the image config. +* `POST /services/create` now accepts a `PluginSpec` when `TaskTemplate.Runtime` is set to `plugin` +* `GET /events` now supports config events `create`, `update` and `remove` that are emitted when users create, update or remove a config +* `GET /volumes/` and `GET /volumes/{name}` now return a `CreatedAt` field, + containing the date/time the volume was created. This field is omitted if the + creation date/time for the volume is unknown. For volumes with scope "global", + this field represents the creation date/time of the local _instance_ of the + volume, which may differ from instances of the same volume on different nodes. +* `GET /system/df` now returns a `CreatedAt` field for `Volumes`. Refer to the + `/volumes/` endpoint for a description of this field. + +## v1.30 API changes + +* `GET /info` now returns the list of supported logging drivers, including plugins. +* `GET /info` and `GET /swarm` now returns the cluster-wide swarm CA info if the node is in a swarm: the cluster root CA certificate, and the cluster TLS + leaf certificate issuer's subject and public key. It also displays the desired CA signing certificate, if any was provided as part of the spec. +* `POST /build/` now (when not silent) produces an `Aux` message in the JSON output stream with payload `types.BuildResult` for each image produced. The final such message will reference the image resulting from the build. +* `GET /nodes` and `GET /nodes/{id}` now returns additional information about swarm TLS info if the node is part of a swarm: the trusted root CA, and the + issuer's subject and public key. +* `GET /distribution/(name)/json` is a new endpoint that returns a JSON output stream with payload `types.DistributionInspect` for an image name. It includes a descriptor with the digest, and supported platforms retrieved from directly contacting the registry. +* `POST /swarm/update` now accepts 3 additional parameters as part of the swarm spec's CA configuration; the desired CA certificate for + the swarm, the desired CA key for the swarm (if not using an external certificate), and an optional parameter to force swarm to + generate and rotate to a new CA certificate/key pair. +* `POST /service/create` and `POST /services/(id or name)/update` now take the field `Platforms` as part of the service `Placement`, allowing to specify platforms supported by the service. +* `POST /containers/(name)/wait` now accepts a `condition` query parameter to indicate which state change condition to wait for. Also, response headers are now returned immediately to acknowledge that the server has registered a wait callback for the client. +* `POST /swarm/init` now accepts a `DataPathAddr` property to set the IP-address or network interface to use for data traffic +* `POST /swarm/join` now accepts a `DataPathAddr` property to set the IP-address or network interface to use for data traffic +* `GET /events` now supports service, node and secret events which are emitted when users create, update and remove service, node and secret +* `GET /events` now supports network remove event which is emitted when users remove a swarm scoped network +* `GET /events` now supports a filter type `scope` in which supported value could be swarm and local +* `PUT /containers/(name)/archive` now accepts a `copyUIDGID` parameter to allow copy UID/GID maps to dest file or dir. + +## v1.29 API changes + +* `DELETE /networks/(name)` now allows to remove the ingress network, the one used to provide the routing-mesh. +* `POST /networks/create` now supports creating the ingress network, by specifying an `Ingress` boolean field. As of now this is supported only when using the overlay network driver. +* `GET /networks/(name)` now returns an `Ingress` field showing whether the network is the ingress one. +* `GET /networks/` now supports a `scope` filter to filter networks based on the network mode (`swarm`, `global`, or `local`). +* `POST /containers/create`, `POST /service/create` and `POST /services/(id or name)/update` now takes the field `StartPeriod` as a part of the `HealthConfig` allowing for specification of a period during which the container should not be considered unhealthy even if health checks do not pass. +* `GET /services/(id)` now accepts an `insertDefaults` query-parameter to merge default values into the service inspect output. +* `POST /containers/prune`, `POST /images/prune`, `POST /volumes/prune`, and `POST /networks/prune` now support a `label` filter to filter containers, images, volumes, or networks based on the label. The format of the label filter could be `label=<key>`/`label=<key>=<value>` to remove those with the specified labels, or `label!=<key>`/`label!=<key>=<value>` to remove those without the specified labels. +* `POST /services/create` now accepts `Privileges` as part of `ContainerSpec`. Privileges currently include + `CredentialSpec` and `SELinuxContext`. + +## v1.28 API changes + +* `POST /containers/create` now includes a `Consistency` field to specify the consistency level for each `Mount`, with possible values `default`, `consistent`, `cached`, or `delegated`. +* `GET /containers/create` now takes a `DeviceCgroupRules` field in `HostConfig` allowing to set custom device cgroup rules for the created container. +* Optional query parameter `verbose` for `GET /networks/(id or name)` will now list all services with all the tasks, including the non-local tasks on the given network. +* `GET /containers/(id or name)/attach/ws` now returns WebSocket in binary frame format for API version >= v1.28, and returns WebSocket in text frame format for API version< v1.28, for the purpose of backward-compatibility. +* `GET /networks` is optimised only to return list of all networks and network specific information. List of all containers attached to a specific network is removed from this API and is only available using the network specific `GET /networks/{network-id}`. +* `GET /containers/json` now supports `publish` and `expose` filters to filter containers that expose or publish certain ports. +* `POST /services/create` and `POST /services/(id or name)/update` now accept the `ReadOnly` parameter, which mounts the container's root filesystem as read only. +* `POST /build` now accepts `extrahosts` parameter to specify a host to ip mapping to use during the build. +* `POST /services/create` and `POST /services/(id or name)/update` now accept a `rollback` value for `FailureAction`. +* `POST /services/create` and `POST /services/(id or name)/update` now accept an optional `RollbackConfig` object which specifies rollback options. +* `GET /services` now supports a `mode` filter to filter services based on the service mode (either `global` or `replicated`). +* `POST /containers/(name)/update` now supports updating `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs. +* `POST /plugins/{name}/disable` now accepts a `force` query-parameter to disable a plugin even if still in use. + +## v1.27 API changes + +* `GET /containers/(id or name)/stats` now includes an `online_cpus` field in both `precpu_stats` and `cpu_stats`. If this field is `nil` then for compatibility with older daemons the length of the corresponding `cpu_usage.percpu_usage` array should be used. + +## v1.26 API changes + +* `POST /plugins/(plugin name)/upgrade` upgrade a plugin. + +## v1.25 API changes + +* The API version is now required in all API calls. Instead of just requesting, for example, the URL `/containers/json`, you must now request `/v1.25/containers/json`. +* `GET /version` now returns `MinAPIVersion`. +* `POST /build` accepts `networkmode` parameter to specify network used during build. +* `GET /images/(name)/json` now returns `OsVersion` if populated +* `GET /images/(name)/json` no longer contains the `RootFS.BaseLayer` field. This + field was used for Windows images that used a base-image that was pre-installed + on the host (`RootFS.Type` `layers+base`), which is no longer supported, and + the `RootFS.BaseLayer` field has been removed. +* `GET /info` now returns `Isolation`. +* `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits. +* `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status. +* `GET /containers/json` now accepts `removing` as a valid value for the `status` filter. +* `GET /containers/json` now supports filtering containers by `health` status. +* `DELETE /volumes/(name)` now accepts a `force` query parameter to force removal of volumes that were already removed out of band by the volume driver plugin. +* `POST /containers/create/` and `POST /containers/(name)/update` now validates restart policies. +* `POST /containers/create` now validates IPAMConfig in NetworkingConfig, and returns error for invalid IPv4 and IPv6 addresses (`--ip` and `--ip6` in `docker create/run`). +* `POST /containers/create` now takes a `Mounts` field in `HostConfig` which replaces `Binds`, `Volumes`, and `Tmpfs`. *note*: `Binds`, `Volumes`, and `Tmpfs` are still available and can be combined with `Mounts`. +* `POST /build` now performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. Note that this change is _unversioned_ and applied to all API versions. +* `POST /build` accepts `cachefrom` parameter to specify images used for build cache. +* `GET /networks/` endpoint now correctly returns a list of *all* networks, + instead of the default network if a trailing slash is provided, but no `name` + or `id`. +* `DELETE /containers/(name)` endpoint now returns an error of `removal of container name is already in progress` with status code of 400, when container name is in a state of removal in progress. +* `GET /containers/json` now supports a `is-task` filter to filter + containers that are tasks (part of a service in swarm mode). +* `POST /containers/create` now takes `StopTimeout` field. +* `POST /services/create` and `POST /services/(id or name)/update` now accept `Monitor` and `MaxFailureRatio` parameters, which control the response to failures during service updates. +* `POST /services/(id or name)/update` now accepts a `ForceUpdate` parameter inside the `TaskTemplate`, which causes the service to be updated even if there are no changes which would ordinarily trigger an update. +* `POST /services/create` and `POST /services/(id or name)/update` now return a `Warnings` array. +* `GET /networks/(name)` now returns field `Created` in response to show network created time. +* `POST /containers/(id or name)/exec` now accepts an `Env` field, which holds a list of environment variables to be set in the context of the command execution. +* `GET /volumes`, `GET /volumes/(name)`, and `POST /volumes/create` now return the `Options` field which holds the driver specific options to use for when creating the volume. +* `GET /exec/(id)/json` now returns `Pid`, which is the system pid for the exec'd process. +* `POST /containers/prune` prunes stopped containers. +* `POST /images/prune` prunes unused images. +* `POST /volumes/prune` prunes unused volumes. +* `POST /networks/prune` prunes unused networks. +* Every API response now includes a `Docker-Experimental` header specifying if experimental features are enabled (value can be `true` or `false`). +* Every API response now includes a `API-Version` header specifying the default API version of the server. +* The `hostConfig` option now accepts the fields `CpuRealtimePeriod` and `CpuRtRuntime` to allocate cpu runtime to rt tasks when `CONFIG_RT_GROUP_SCHED` is enabled in the kernel. +* The `SecurityOptions` field within the `GET /info` response now includes `userns` if user namespaces are enabled in the daemon. +* `GET /nodes` and `GET /node/(id or name)` now return `Addr` as part of a node's `Status`, which is the address that that node connects to the manager from. +* The `HostConfig` field now includes `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs. +* `GET /info` now returns more structured information about security options. +* The `HostConfig` field now includes `CpuCount` that represents the number of CPUs available for execution by the container. Windows daemon only. +* `POST /services/create` and `POST /services/(id or name)/update` now accept the `TTY` parameter, which allocate a pseudo-TTY in container. +* `POST /services/create` and `POST /services/(id or name)/update` now accept the `DNSConfig` parameter, which specifies DNS related configurations in resolver configuration file (resolv.conf) through `Nameservers`, `Search`, and `Options`. +* `POST /services/create` and `POST /services/(id or name)/update` now support + `node.platform.arch` and `node.platform.os` constraints in the services + `TaskSpec.Placement.Constraints` field. +* `GET /networks/(id or name)` now includes IP and name of all peers nodes for swarm mode overlay networks. +* `GET /plugins` list plugins. +* `POST /plugins/pull?name=<plugin name>` pulls a plugin. +* `GET /plugins/(plugin name)` inspect a plugin. +* `POST /plugins/(plugin name)/set` configure a plugin. +* `POST /plugins/(plugin name)/enable` enable a plugin. +* `POST /plugins/(plugin name)/disable` disable a plugin. +* `POST /plugins/(plugin name)/push` push a plugin. +* `POST /plugins/create?name=(plugin name)` create a plugin. +* `DELETE /plugins/(plugin name)` delete a plugin. +* `POST /node/(id or name)/update` now accepts both `id` or `name` to identify the node to update. +* `GET /images/json` now support a `reference` filter. +* `GET /secrets` returns information on the secrets. +* `POST /secrets/create` creates a secret. +* `DELETE /secrets/{id}` removes the secret `id`. +* `GET /secrets/{id}` returns information on the secret `id`. +* `POST /secrets/{id}/update` updates the secret `id`. +* `POST /services/(id or name)/update` now accepts service name or prefix of service id as a parameter. +* `POST /containers/create` added 2 built-in log-opts that work on all logging drivers, + `mode` (`blocking`|`non-blocking`), and `max-buffer-size` (e.g. `2m`) which enables a non-blocking log buffer. +* `POST /containers/create` now takes `HostConfig.Init` field to run an init + inside the container that forwards signals and reaps processes. + +## v1.24 API changes + +* `POST /containers/create` now takes `StorageOpt` field. +* `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported. +* `GET /info` no longer returns the `ExecutionDriver` property. This property was no longer used after integration + with ContainerD in Docker 1.11. +* `GET /networks` now supports filtering by `label` and `driver`. +* `GET /containers/json` now supports filtering containers by `network` name or id. +* `POST /containers/create` now takes `IOMaximumBandwidth` and `IOMaximumIOps` fields. Windows daemon only. +* `POST /containers/create` now returns an HTTP 400 "bad parameter" message + if no command is specified (instead of an HTTP 500 "server error") +* `GET /images/search` now takes a `filters` query parameter. +* `GET /events` now supports a `reload` event that is emitted when the daemon configuration is reloaded. +* `GET /events` now supports filtering by daemon name or ID. +* `GET /events` now supports a `detach` event that is emitted on detaching from container process. +* `GET /events` now supports an `exec_detach ` event that is emitted on detaching from exec process. +* `GET /images/json` now supports filters `since` and `before`. +* `POST /containers/(id or name)/start` no longer accepts a `HostConfig`. +* `POST /images/(name)/tag` no longer has a `force` query parameter. +* `GET /images/search` now supports maximum returned search results `limit`. +* `POST /containers/{name:.*}/copy` is now removed and errors out starting from this API version. +* API errors are now returned as JSON instead of plain text. +* `POST /containers/create` and `POST /containers/(id)/start` allow you to configure kernel parameters (sysctls) for use in the container. +* `POST /containers/<container ID>/exec` and `POST /exec/<exec ID>/start` + no longer expects a "Container" field to be present. This property was not used + and is no longer sent by the docker client. +* `POST /containers/create/` now validates the hostname (should be a valid RFC 1123 hostname). +* `POST /containers/create/` `HostConfig.PidMode` field now accepts `container:<name|id>`, + to have the container join the PID namespace of an existing container. + +## v1.23 API changes + +* `GET /containers/json` returns the state of the container, one of `created`, `restarting`, `running`, `paused`, `exited` or `dead`. +* `GET /containers/json` returns the mount points for the container. +* `GET /networks/(name)` now returns an `Internal` field showing whether the network is internal or not. +* `GET /networks/(name)` now returns an `EnableIPv6` field showing whether the network has ipv6 enabled or not. +* `POST /containers/(name)/update` now supports updating container's restart policy. +* `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work). +* `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`. +* `GET /info` now returns `KernelMemory` field, showing if "kernel memory limit" is supported. +* `POST /containers/create` now takes `PidsLimit` field, if the kernel is >= 4.3 and the pids cgroup is supported. +* `GET /containers/(id or name)/stats` now returns `pids_stats`, if the kernel is >= 4.3 and the pids cgroup is supported. +* `POST /containers/create` now allows you to override usernamespaces remapping and use privileged options for the container. +* `POST /containers/create` now allows specifying `nocopy` for named volumes, which disables automatic copying from the container path to the volume. +* `POST /auth` now returns an `IdentityToken` when supported by a registry. +* `POST /containers/create` with both `Hostname` and `Domainname` fields specified will result in the container's hostname being set to `Hostname`, rather than `Hostname.Domainname`. +* `GET /volumes` now supports more filters, new added filters are `name` and `driver`. +* `GET /containers/(id or name)/logs` now accepts a `details` query parameter to stream the extra attributes that were provided to the containers `LogOpts`, such as environment variables and labels, with the logs. +* `POST /images/load` now returns progress information as a JSON stream, and has a `quiet` query parameter to suppress progress details. + +## v1.22 API changes + +* The `HostConfig.LxcConf` field has been removed, and is no longer available on + `POST /containers/create` and `GET /containers/(id)/json`. +* `POST /container/(name)/update` updates the resources of a container. +* `GET /containers/json` supports filter `isolation` on Windows. +* `GET /containers/json` now returns the list of networks of containers. +* `GET /info` Now returns `Architecture` and `OSType` fields, providing information + about the host architecture and operating system type that the daemon runs on. +* `GET /networks/(name)` now returns a `Name` field for each container attached to the network. +* `GET /version` now returns the `BuildTime` field in RFC3339Nano format to make it + consistent with other date/time values returned by the API. +* `AuthConfig` now supports a `registrytoken` for token based authentication +* `POST /containers/create` now has a 4M minimum value limit for `HostConfig.KernelMemory` +* Pushes initiated with `POST /images/(name)/push` and pulls initiated with `POST /images/create` + will be cancelled if the HTTP connection making the API request is closed before + the push or pull completes. +* `POST /containers/create` now allows you to set a read/write rate limit for a + device (in bytes per second or IO per second). +* `GET /networks` now supports filtering by `name`, `id` and `type`. +* `POST /containers/create` now allows you to set the static IPv4 and/or IPv6 address for the container. +* `POST /networks/(id)/connect` now allows you to set the static IPv4 and/or IPv6 address for the container. +* `GET /info` now includes the number of containers running, stopped, and paused. +* `POST /networks/create` now supports restricting external access to the network by setting the `Internal` field. +* `POST /networks/(id)/disconnect` now includes a `Force` option to forcefully disconnect a container from network +* `GET /containers/(id)/json` now returns the `NetworkID` of containers. +* `POST /networks/create` Now supports an options field in the IPAM config that provides options + for custom IPAM plugins. +* `GET /networks/{network-id}` Now returns IPAM config options for custom IPAM plugins if any + are available. +* `GET /networks/<network-id>` now returns subnets info for user-defined networks. +* `GET /info` can now return a `SystemStatus` field useful for returning additional information about applications + that are built on top of engine. + +## v1.21 API changes + +* `GET /volumes` lists volumes from all volume drivers. +* `POST /volumes/create` to create a volume. +* `GET /volumes/(name)` get low-level information about a volume. +* `DELETE /volumes/(name)` remove a volume with the specified name. +* `VolumeDriver` was moved from `config` to `HostConfig` to make the configuration portable. +* `GET /images/(name)/json` now returns information about an image's `RepoTags` and `RepoDigests`. +* The `config` option now accepts the field `StopSignal`, which specifies the signal to use to kill a container. +* `GET /containers/(id)/stats` will return networking information respectively for each interface. +* The `HostConfig` option now includes the `DnsOptions` field to configure the container's DNS options. +* `POST /build` now optionally takes a serialized map of build-time variables. +* `GET /events` now includes a `timenano` field, in addition to the existing `time` field. +* `GET /events` now supports filtering by image and container labels. +* `GET /info` now lists engine version information and return the information of `CPUShares` and `Cpuset`. +* `GET /containers/json` will return `ImageID` of the image used by container. +* `POST /exec/(name)/start` will now return an HTTP 409 when the container is either stopped or paused. +* `POST /containers/create` now takes `KernelMemory` in HostConfig to specify kernel memory limit. +* `GET /containers/(name)/json` now accepts a `size` parameter. Setting this parameter to '1' returns container size information in the `SizeRw` and `SizeRootFs` fields. +* `GET /containers/(name)/json` now returns a `NetworkSettings.Networks` field, + detailing network settings per network. This field deprecates the + `NetworkSettings.EndpointID`, `NetworkSettings.Gateway`, `NetworkSettings.GlobalIPv6Address`, + `NetworkSettings.GlobalIPv6PrefixLen` `NetworkSettings.IPAddress`, `NetworkSettings.IPPrefixLen`, + `NetworkSettings.IPv6Gateway`, `NetworkSettings.MacAddress` fields, which are + still returned for backward-compatibility, but will be removed in a future version. +* `GET /exec/(id)/json` now returns a `NetworkSettings.Networks` field, + detailing networksettings per network. This field deprecates the + `NetworkSettings.Gateway`, `NetworkSettings.IPAddress`, + `NetworkSettings.IPPrefixLen`, and `NetworkSettings.MacAddress` fields, which + are still returned for backward-compatibility, but will be removed in a future version. +* The `HostConfig` option now includes the `OomScoreAdj` field for adjusting the + badness heuristic. This heuristic selects which processes the OOM killer kills + under out-of-memory conditions. + +## v1.20 API changes + +* `GET /containers/(id)/archive` get an archive of filesystem content from a container. +* `PUT /containers/(id)/archive` upload an archive of content to be extracted to +an existing directory inside a container's filesystem. +* `POST /containers/(id)/copy` is deprecated in favor of the above `archive` +endpoint which can be used to download files and directories from a container. +* The `hostConfig` option now accepts the field `GroupAdd`, which specifies a +list of additional groups that the container process will run as. + +## v1.19 API changes + +* When the daemon detects a version mismatch with the client, usually when +the client is newer than the daemon, an HTTP 400 is now returned instead +of a 404. +* `GET /containers/(id)/stats` now accepts `stream` bool to get only one set of stats and disconnect. +* `GET /containers/(id)/logs` now accepts a `since` timestamp parameter. +* `GET /info` The fields `Debug`, `IPv4Forwarding`, `MemoryLimit`, and +`SwapLimit` are now returned as boolean instead of as an int. In addition, the +end point now returns the new boolean fields `CpuCfsPeriod`, `CpuCfsQuota`, and +`OomKillDisable`. +* The `hostConfig` option now accepts the fields `CpuPeriod` and `CpuQuota` +* `POST /build` accepts `cpuperiod` and `cpuquota` options + +## v1.18 API changes + +* `GET /version` now returns `Os`, `Arch` and `KernelVersion`. +* `POST /containers/create` and `POST /containers/(id)/start`allow you to set ulimit settings for use in the container. +* `GET /info` now returns `SystemTime`, `HttpProxy`,`HttpsProxy` and `NoProxy`. +* `GET /images/json` added a `RepoDigests` field to include image digest information. +* `POST /build` can now set resource constraints for all containers created for the build. +* `CgroupParent` can be passed in the host config to setup container cgroups under a specific cgroup. +* `POST /build` closing the HTTP request cancels the build +* `POST /containers/(id)/exec` includes `Warnings` field to response. + +### v1.17 API changes + +* The build supports `LABEL` command. Use this to add metadata to an image. For + example you could add data describing the content of an image. `LABEL +"com.example.vendor"="ACME Incorporated"` +* `POST /containers/(id)/attach` and `POST /exec/(id)/start` +* The Docker client now hints potential proxies about connection hijacking using HTTP Upgrade headers. +* `POST /containers/create` sets labels on container create describing the container. +* `GET /containers/json` returns the labels associated with the containers (`Labels`). +* `GET /containers/(id)/json` returns the list current execs associated with the + container (`ExecIDs`). This endpoint now returns the container labels + (`Config.Labels`). +* `POST /containers/(id)/rename` renames a container `id` to a new name.* +* `POST /containers/create` and `POST /containers/(id)/start` callers can pass + `ReadonlyRootfs` in the host config to mount the container's root filesystem as + read only. +* `GET /containers/(id)/stats` returns a live stream of a container's resource usage statistics. +* `GET /images/json` returns the labels associated with each image (`Labels`). + + +### v1.16 API changes + +* `GET /info` returns the number of CPUs available on the machine (`NCPU`), + total memory available (`MemTotal`), a user-friendly name describing the running Docker daemon (`Name`), a unique ID identifying the daemon (`ID`), and + a list of daemon labels (`Labels`). +* `POST /containers/create` callers can set the new container's MAC address explicitly. +* Volumes are now initialized when the container is created. +* `POST /containers/(id)/copy` copies data which is contained in a volume. + +### v1.15 API changes + +* `POST /containers/create` can now set a container's `HostConfig` when creating a + container. Previously this was only available when starting a container. + +### v1.14 API changes + +* `DELETE /containers/(id)` when using `force`, the container will be immediately killed with SIGKILL. +* `POST /containers/(id)/start` the `HostConfig` option accepts the field `CapAdd`, which specifies a list of capabilities + to add, and the field `CapDrop`, which specifies a list of capabilities to drop. +* `POST /images/create` th `fromImage` and `repo` parameters support the + `repo:tag` format. Consequently, the `tag` parameter is now obsolete. Using the + new format and the `tag` parameter at the same time will return an error. + +## v1.13 API changes + +* `GET /containers/(name)/json` + +**New!** +The `HostConfig.Links` field is now filled correctly + +**New!** +`Sockets` parameter added to the `/info` endpoint listing all the sockets the +daemon is configured to listen on. + +`POST /containers/(name)/start` +`POST /containers/(name)/stop` + +**New!** +`start` and `stop` will now return 304 if the container's status is not modified + +`POST /commit` + +**New!** +Added a `pause` parameter (default `true`) to pause the container during commit + +## v1.12 API changes + +- `POST /build` now supports a `forcerm` parameter to always remove containers. +- `GET /containers/(name)/json`,`GET /images/(name)/json`: JSON keys are now in CamelCase. +- `GET /images/search`: Trusted builds are now Automated Builds, and the `is_trusted` + field was renamed to `is_automated`. +- The `POST /images/(name)/insert` endpoint has been removed. + +## v1.11 API changes + +### What's new + +- Add new `GET /_ping` endpoint to check if the API server is ready to accept connections. +- `GET /events` now supports an `until` parameter to close connection after the given timestamp. +- `GET /containers/(id)/logs` is now the preferred method for getting container logs. + +## v1.10 API changes + +- `DELETE /images/(name)` now provides a `force` parameter to force delete of an + image, even if it's tagged in multiple repositories. +- `DELETE /images/(name)` now provides a `noprune` parameter to prevent the + deletion of parent images. +- `DELETE /containers/(id)` now provides a `force` parameter to force deleting + a container, even if it is currently running. + +## v1.9 API changes + +- `POST /build` now takes a serialized ConfigFile which it uses to resolve the + proper registry auth credentials for pulling the base image. Clients which + previously implemented the version accepting an AuthConfig object must be + updated. + +## v1.8 API changes + +- `POST /build` now returns build status as JSON stream. In case of a build error, + it returns the exit status of the failed command. +- `GET /containers/(id)/json` now returns the host config for the container. +- `POST /images/create`, `POST /images/(name)/insert` and `POST /images/(name)/push` + now include a `progressDetail` object in the JSON. It's now possible to get the + current value and the total of the progress without having to parse the string. + +## v1.7 API changes + +- The `GET /images/viz` endpoint was removed. The `images --viz` output is now + generated in the client, using the `GET /images/json` endpoint. +- The `GET /images/json` response now returns a single entry per image with a + nested attribute indicating the repo/tags that apply to that image. + +Instead of: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "VirtualSize": 131506275, + "Size": 131506275, + "Created": 1365714795, + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Tag": "12.04", + "Repository": "ubuntu" + }, + { + "VirtualSize": 131506275, + "Size": 131506275, + "Created": 1365714795, + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Tag": "latest", + "Repository": "ubuntu" + } + ] + +The returned json looks like this: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + } + ] + +## v1.6 API changes + +### What's new + +- `POST /containers/(id)/attach` now provides a multiplexed response to allow + splitting stderr from stdout. This is done by prefixing a header to each + transmission. See the `POST /containers/(id)/attach` endpoint. The WebSocket + attach is unchanged. Note that attach calls on the previous API version didn't + change. Stdout and stderr are merged. + +## v1.5 API changes + +- `POST /images/create` now accepts registry credentials via an AuthConfig object + sent through the `X-Registry-Auth` header. +- `POST /images/(name)/push` now requires the `AuthConfig` object to be passed + through the `X-Registry-Auth` instead of the request body. +- `GET /containers/json` changed the format of the Ports entry to a list of dicts, + each containing PublicPort, PrivatePort and Type describing a port mapping. + +## v1.4 API changes + +- `POST /images/create` now downloads all images in parallel when pulling a repo. +- `GET /containers/(id)/top` now accepts `ps` args, which is used by `docker top`, + for example, `docker top <container_id> aux`. +- `GET /events` now includes the image's name. + +## v1.3 API changes + +- Add `GET /containers/(id)/top` endpoint to list the processes running inside + the container. +- Add `GET /events` endpoint to monitor docker's events via streaming or via polling. +- `GET /containers/json` now provides a `size=1` option to get the size of the containers. +- `POST /containers/<id>/start` now accepts host-specific configuration (e.g., bind + mounts) in the POST body for start calls. +- `POST /build`: + - Simplify the upload of the build context + - Simply stream a tarball instead of multipart upload with 4 + intermediary buffers + - Simpler, less memory usage, less disk usage and faster + +> **Warning**: +> The `POST /build` improvements are not reverse-compatible. Pre 1.3 clients will +> break on `POST /build`. + +## v1.2 API changes + +- The auth configuration is now handled by the client, and clients must send + authConfig as body on `POST /images/(name)/push`. +- `GET /auth` is now deprecated. +- `POST /auth` now only checks the configuration but doesn't store it on the server +- `POST /images/<name>/delete` now only untags the image if it has children and + removes all the untagged parents if has any. +- `POST /images/<name>/delete` now returns a JSON structure with the list of + images deleted/untagged. + +## v1.1 API changes + +`POST /images/create`, `POST /images/(name)/insert`, and `POST /images/(name)/push` +now use a JSON stream instead of HTML hijack, it looks like this: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +## v1.0 API changes + +Initial version (docker [v0.3.3](https://github.com/docker/docker/commit/822056094aa31c224e78cd568e02fe5458a0eecc)) diff --git a/_vendor/github.com/moby/moby/api/docs/README.md b/_vendor/github.com/moby/moby/api/docs/README.md new file mode 100644 index 000000000000..46bf79bdbef3 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/README.md @@ -0,0 +1,26 @@ +# API Documentation + +This directory contains versioned documents for each version of the API +specification supported by this module. While this module provides support +for older API versions, support should be considered "best-effort", especially +for very old versions. Users are recommended to use the latest API versions, +and only rely on older API versions for compatibility with older clients. + +Newer API versions tend to be backward-compatible with older versions, +with some exceptions where features were deprecated. For an overview +of changes for each version, refer to [CHANGELOG.md](CHANGELOG.md). + +The latest version of the API specification can be found [at the root directory +of this module](../swagger.yaml) which may contain unreleased changes. + +For API version v1.24, documentation is only available in markdown +format, for later versions [Swagger (OpenAPI) v2.0](https://swagger.io/specification/v2/) +specifications can be found in this directory. The Moby project itself +primarily uses these swagger files to produce the API documentation; +while we attempt to make these files match the actual implementation, +the OpenAPI 2.0 specification has limitations that prevent us from +expressing all options provided. There may be discrepancies (for which +we welcome contributions). If you find bugs, or discrepancies, please +open a ticket (or pull request). + + diff --git a/_vendor/github.com/moby/moby/api/docs/v1.0.md b/_vendor/github.com/moby/moby/api/docs/v1.0.md new file mode 100644 index 000000000000..0ae774edd023 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.0.md @@ -0,0 +1,993 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.0" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.0 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0" + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0" + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0" + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0" + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + + {{ TAR STREAM }} + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"" + } + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + + > **Example request**: + > + > POST /images/test/push HTTP/1.1 + > + > **Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such image +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + +Query Parameters: + +- **t** – repository name to be applied to the resulting image in + case of success + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get default username and email + +`GET /auth` + +Get the default username and email + +**Example request**: + + GET /auth HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "username":"hannibal", + "email":"hannibal@a-team.com" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration and store i + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":"hannibal", + "password:"xxxx", + "email":"hannibal@a-team.com" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + > + > **Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's + +## 3.2 Hijacking + +In this first version of the API, some of the endpoints, like /attach, +/pull or /push uses hijacking to transport stdin, stdout and stderr on +the same socket. This might change in the future. diff --git a/_vendor/github.com/moby/moby/api/docs/v1.1.md b/_vendor/github.com/moby/moby/api/docs/v1.1.md new file mode 100644 index 000000000000..6f416de5d5e2 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.1.md @@ -0,0 +1,1005 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.1" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.1 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0" + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0" + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0" + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0" + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"" + } + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + + > **Example request**: + > + > POST /images/test/push HTTP/1.1 + > + > **Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such image +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + +Query Parameters: + +   + +- **t** – tag to be applied to the resulting image in case of + success + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get default username and email + +`GET /auth` + +Get the default username and email + +**Example request**: + + GET /auth HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "username":"hannibal", + "email":"hannibal@a-team.com" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration and store i + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":"hannibal", + "password:"xxxx", + "email":"hannibal@a-team.com" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's + +## 3.2 Hijacking + +In this version of the API, /attach uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. diff --git a/_vendor/github.com/moby/moby/api/docs/v1.10.md b/_vendor/github.com/moby/moby/api/docs/v1.10.md new file mode 100644 index 000000000000..0119a51d258e --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.10.md @@ -0,0 +1,1354 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.10" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.10 + +## 1. Brief introduction + + - The Remote API has replaced rcli + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout, stdin` + and `stderr` + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Image":"ubuntu", + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "NetworkDisabled": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Query Parameters: + +   + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Image": "ubuntu", + "Volumes": {}, + "WorkingDir":"" + + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": null, + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +   + +- **ps\_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id` 's filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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"] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` +](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns + the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + + `DELETE /containers/(id*) +: Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** – 1/True/true or 0/False/false, Removes the container + even if it was running. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing + i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image + `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)", "progressDetail":{"current":1}} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"] + "Image":"ubuntu", + "Volumes":null, + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + + `DELETE /images/(name*) +: Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#add)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "NetworkDisabled": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + + +Json Parameters: + + + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository + specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.11.md b/_vendor/github.com/moby/moby/api/docs/v1.11.md new file mode 100644 index 000000000000..903bf5d0671c --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.11.md @@ -0,0 +1,1385 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.11" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.11 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, `STDIN` + and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Image":"ubuntu", + "Volumes":{ + "/tmp": {} + }, + "VolumesFrom":"", + "WorkingDir":"", + "DisableNetwork": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Query Parameters: + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": null, + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +   + +- **follow** – 1/True/true or 0/False/false, return stream. + Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, if logs=true, prin + timestamps for every log line. Default false + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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"] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** – 1/True/true or 0/False/false, Removes the container + even if it was running. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"ubuntu", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Images": 16, + "Driver": "btrfs", + "ExecutionDriver": "native-0.1", + "KernelVersion": "3.12.0-1-amd64" + "Debug": false, + "NFd": 11, + "NGoroutines": 21, + "NEventsListener": 0, + "InitPath": "/usr/bin/docker", + "IndexServerAddress": ["https://index.docker.io/v1/"], + "MemoryLimit": true, + "SwapLimit": false, + "IPv4Forwarding": true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "DisableNetwork": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.12.md b/_vendor/github.com/moby/moby/api/docs/v1.12.md new file mode 100644 index 000000000000..9272346b136e --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.12.md @@ -0,0 +1,1450 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.12" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.12 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../articles/basics.md#bind-docker-to-another-hostport-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** – a JSON encoded value of the filters (a map[string][]string) + to process on the images list. + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "Domainname": "", + "User":"", + "Memory":0, + "MemorySwap":0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Image":"ubuntu", + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "NetworkDisabled": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Query Parameters: + +   + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": null, + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +   + +- **follow** – 1/True/true or 0/False/false, return stream. + Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, if logs=true, prin + timestamps for every log line. Default false + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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"] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Pause a container + +`POST /containers/(id)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. + Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** – 1/True/true or 0/False/false, Removes the container + even if it was running. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + + + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Images": 16, + "Driver": "btrfs", + "ExecutionDriver": "native-0.1", + "KernelVersion": "3.12.0-1-amd64" + "Debug": false, + "NFd": 11, + "NGoroutines": 21, + "NEventsListener": 0, + "InitPath": "/usr/bin/docker", + "IndexServerAddress": ["https://index.docker.io/v1/"], + "MemoryLimit": true, + "SwapLimit": false, + "IPv4Forwarding": true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.13.md b/_vendor/github.com/moby/moby/api/docs/v1.13.md new file mode 100644 index 000000000000..a9b519d1897c --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.13.md @@ -0,0 +1,1440 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.13" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.13 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../articles/basics.md#bind-docker-to-another-hostport-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "Domainname": "", + "User":"", + "Memory":0, + "MemorySwap":0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Image":"ubuntu", + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "NetworkDisabled": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Query Parameters: + +   + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": ["/name:alias"], + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for every + log line. Default false +- **tail** – Output specified number of lines at the end of logs: `all` or + `<number>`. Default all + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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"] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Pause a container + +`POST /containers/(id)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. + Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** – 1/True/true or 0/False/false, Removes the container + even if it was running. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + +### Create an image + +`POST /images/create` + +Create an image, either by pulling it from the registry or by importing it + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Images": 16, + "Driver": "btrfs", + "ExecutionDriver": "native-0.1", + "KernelVersion": "3.12.0-1-amd64" + "Debug": false, + "NFd": 11, + "NGoroutines": 21, + "NEventsListener": 0, + "InitPath": "/usr/bin/docker", + "IndexServerAddress": ["https://index.docker.io/v1/"], + "MemoryLimit": true, + "SwapLimit": false, + "IPv4Forwarding": true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.14.md b/_vendor/github.com/moby/moby/api/docs/v1.14.md new file mode 100644 index 000000000000..673ed844377b --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.14.md @@ -0,0 +1,1469 @@ +<!--[metadata]> ++++ +title = "Remote API v1.14" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "engine_remoteapi" +weight = 7 ++++ +<![end-metadata]--> + +# Docker Remote API v1.14 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes +- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters: + - exited=<int> -- containers with exit code of <int> + - status=(restarting|running|paused|exited) + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "Domainname": "", + "User":"", + "Memory":0, + "MemorySwap":0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd":[ + "date" + ], + "Image":"ubuntu", + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "NetworkDisabled": false, + "ExposedPorts":{ + "22/tcp": {} + }, + "RestartPolicy": { "Name": "always" } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. +- **config** – the container's configuration + +Query Parameters: + +- **name** – Assign the specified name to the container. Must match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": ["/name:alias"], + "PublishAllPorts": false, + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"] + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +Query Parameters: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id or name)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for every + log line. Default false +- **tail** – Output specified number of lines at the end of logs: `all` or + `<number>`. Default all + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +**Example request**: + + 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"] + } + +**Example response**: + + HTTP/1.1 204 No Content + +Json Parameters: + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach to stdin. + Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create`](#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + +### Create an image + +`POST /images/create` + +Create an image, either by pulling it from the registry or by importing it + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Images": 16, + "Driver": "btrfs", + "ExecutionDriver": "native-0.1", + "KernelVersion": "3.12.0-1-amd64" + "Debug": false, + "NFd": 11, + "NGoroutines": 21, + "NEventsListener": 0, + "InitPath": "/usr/bin/docker", + "IndexServerAddress": ["https://index.docker.io/v1/"], + "MemoryLimit": true, + "SwapLimit": false, + "IPv4Forwarding": true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.15.md b/_vendor/github.com/moby/moby/api/docs/v1.15.md new file mode 100644 index 000000000000..e5f3ca6348dd --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.15.md @@ -0,0 +1,1763 @@ +<!--[metadata]> ++++ +title = "Remote API v1.15" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "engine_remoteapi" +weight = 6 ++++ +<![end-metadata]--> + +# Docker Remote API v1.15 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters: + - exited=<int> -- containers with exit code of <int> + - status=(restarting|running|paused|exited) + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": "", + "Image": "ubuntu", + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "SecurityOpt": [], + "HostConfig": { + "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": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [] + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f91ddc4b01e079c4481a8340bbbeca4dbd33d6e4a10662e499f8eacbb5bf252b" + "Warnings": [] + } + +Json Parameters: + +- **Hostname** - A string value containing the desired hostname to use for the + container. +- **Domainname** - A string value containing the desired domain name to use + for the container. +- **User** - A string value containing the user to use inside the container. +- **Memory** - Memory limit in bytes. +- **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. +- **CpuShares** - An integer value containing the CPU Shares for container + (ie. the relative weight vs other containers). + **CpuSet** - String value containing the cgroups Cpuset to use. +- **AttachStdin** - Boolean value, attaches to stdin. +- **AttachStdout** - Boolean value, attaches to stdout. +- **AttachStderr** - Boolean value, attaches to stderr. +- **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed. +- **OpenStdin** - Boolean value, opens stdin, +- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entrypoint for the container a string or an array + of strings +- **Image** - String value containing the image name to use for the container +- **Volumes** – An object mapping mountpoint paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string value containing the working dir for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume + binding is a string of the form `container_path` (to create a new + volume for the container), `host_path:container_path` (to bind-mount + a host path into the container), or `host_path:container_path:ro` + (to make the bind-mount read-only inside the container). + - **Links** - A list of links for the container. Each link entry should be + in the form of "container_name:alias". + - **LxcConf** - LXC specific configurations. These configurations will only + work when using the `lxc` execution driver. + - **PortBindings** - A map of exposed container ports and the host port they + should map to. It should be specified in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates a random host port for all of a container's + exposed ports. Specified as a boolean value. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **Dns** - A list of dns servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to be added to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + +Query Parameters: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": ["/name:alias"], + "PublishAllPorts": false, + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"] + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +Query Parameters: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id or name)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default false +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Resize a container TTY + +`GET /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +Status Codes: + +- **200** – no error +- **404** – No such container +- **500** – bad file descriptor + +### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +**Example request**: + + 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": [] + } + +**Example response**: + + HTTP/1.1 204 No Content + +Json Parameters: + +- **Binds** – A list of volume bindings for this container. Each volume + binding is a string of the form `container_path` (to create a new + volume for the container), `host_path:container_path` (to bind-mount + a host path into the container), or `host_path:container_path:ro` + (to make the bind-mount read-only inside the container). +- **Links** - A list of links for the container. Each link entry should be of + of the form "container_name:alias". +- **LxcConf** - LXC specific configurations. These configurations will only + work when using the `lxc` execution driver. +- **PortBindings** - A map of exposed container ports and the host port they + should map to. It should be specified in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. +- **PublishAllPorts** - Allocates a random host port for all of a container's + exposed ports. Specified as a boolean value. +- **Privileged** - Gives the container full access to the host. Specified as + a boolean value. +- **Dns** - A list of dns servers for the container to use. +- **DnsSearch** - A list of DNS search domains +- **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` +- **CapAdd** - A list of kernel capabilities to add to the container. +- **Capdrop** - A list of kernel capabilities to drop from the container. +- **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. +- **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` +- **Devices** - A list of devices to add to the container specified in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + +Status Codes: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will waits for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create`](#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + +### Create an image + +`POST /images/create` + +Create an image, either by pulling it from the registry or by importing it + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – repository +- **tag** – tag + + Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Images": 16, + "Driver": "btrfs", + "ExecutionDriver": "native-0.1", + "KernelVersion": "3.12.0-1-amd64" + "Debug": false, + "NFd": 11, + "NGoroutines": 21, + "NEventsListener": 0, + "InitPath": "/usr/bin/docker", + "IndexServerAddress": ["https://index.docker.io/v1/"], + "MemoryLimit": true, + "SwapLimit": false, + "IPv4Forwarding": true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images. + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +ubuntu:latest), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + + { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "Cmd": [ + "date" + ], + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806" + } + +Json Parameters: + +- **AttachStdin** - Boolean value, attaches to stdin of the exec command. +- **AttachStdout** - Boolean value, attaches to stdout of the exec command. +- **AttachStderr** - Boolean value, attaches to stderr of the exec command. +- **Tty** - Boolean value to allocate a pseudo-TTY +- **Cmd** - Command to run specified as a string or an array of strings. + + +Status Codes: + +- **201** – no error +- **404** – no such container + +### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up exec instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + + { + "Detach": false, + "Tty": false, + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Json Parameters: + +- **Detach** - Detach from the exec command +- **Tty** - Boolean value to allocate a pseudo-TTY + +Status Codes: + +- **200** – no error +- **404** – no such exec instance + + **Stream details**: + Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the tty session used by the exec command `id`. +This API is valid only if `tty` was specified as part of creating and starting the exec command. + +**Example request**: + + POST /exec/e90e34656806/resize HTTP/1.1 + Content-Type: plain/text + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: plain/text + +Query Parameters: + +- **h** – height of tty session +- **w** – width + +Status Codes: + +- **201** – no error +- **404** – no such exec instance + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: +- Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: +- Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.16.md b/_vendor/github.com/moby/moby/api/docs/v1.16.md new file mode 100644 index 000000000000..f6e768ce0c41 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.16.md @@ -0,0 +1,1833 @@ +<!--[metadata]> ++++ +title = "Remote API v1.16" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "engine_remoteapi" +weight = 5 ++++ +<![end-metadata]--> + +# Docker Remote API v1.16 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleep_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters: + - exited=<int> -- containers with exit code of <int> + - status=(restarting|running|paused|exited) + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": "", + "Image": "ubuntu", + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "SecurityOpt": [], + "HostConfig": { + "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": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [] + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **Hostname** - A string value containing the desired hostname to use for the + container. +- **Domainname** - A string value containing the desired domain name to use + for the container. +- **User** - A string value containing the user to use inside the container. +- **Memory** - Memory limit in bytes. +- **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. +- **CpuShares** - An integer value containing the CPU Shares for container + (ie. the relative weight vs other containers). + **CpuSet** - String value containing the cgroups Cpuset to use. +- **AttachStdin** - Boolean value, attaches to stdin. +- **AttachStdout** - Boolean value, attaches to stdout. +- **AttachStderr** - Boolean value, attaches to stderr. +- **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed. +- **OpenStdin** - Boolean value, opens stdin, +- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entrypoint for the container a string or an array + of strings +- **Image** - String value containing the image name to use for the container +- **Volumes** – An object mapping mountpoint paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string value containing the working dir for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume + binding is a string of the form `container_path` (to create a new + volume for the container), `host_path:container_path` (to bind-mount + a host path into the container), or `host_path:container_path:ro` + (to make the bind-mount read-only inside the container). + - **Links** - A list of links for the container. Each link entry should be + in the form of "container_name:alias". + - **LxcConf** - LXC specific configurations. These configurations will only + work when using the `lxc` execution driver. + - **PortBindings** - A map of exposed container ports and the host port they + should map to. It should be specified in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates a random host port for all of a container's + exposed ports. Specified as a boolean value. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **Dns** - A list of dns servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to be added to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + +Query Parameters: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": ["/name:alias"], + "PublishAllPorts": false, + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"] + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +Query Parameters: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id or name)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default false +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Resize a container TTY + +`POST /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY for container with `id`. The container must be restarted for the resize to take effect. + +**Example request**: + + POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +Status Codes: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will waits for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + +### Create an image + +`POST /images/create` + +Create an image, either by pulling it from the registry or by importing it + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – repository +- **tag** – tag + + Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **pull** - attempt to pull the image even if an older image exists locally +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/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", + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - event=<string> -- event to filter + - image=<string> -- image to filter + - container=<string> -- container to filter + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images. + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +ubuntu:latest), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + + { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "Cmd": [ + "date" + ], + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806" + } + +Json Parameters: + +- **AttachStdin** - Boolean value, attaches to stdin of the exec command. +- **AttachStdout** - Boolean value, attaches to stdout of the exec command. +- **AttachStderr** - Boolean value, attaches to stderr of the exec command. +- **Tty** - Boolean value to allocate a pseudo-TTY +- **Cmd** - Command to run specified as a string or an array of strings. + + +Status Codes: + +- **201** – no error +- **404** – no such container + +### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up exec instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + + { + "Detach": false, + "Tty": false, + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Json Parameters: + +- **Detach** - Detach from the exec command +- **Tty** - Boolean value to allocate a pseudo-TTY + +Status Codes: + +- **200** – no error +- **404** – no such exec instance + + **Stream details**: + Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the tty session used by the exec command `id`. +This API is valid only if `tty` was specified as part of creating and starting the exec command. + +**Example request**: + + POST /exec/e90e34656806/resize HTTP/1.1 + Content-Type: plain/text + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: plain/text + +Query Parameters: + +- **h** – height of tty session +- **w** – width + +Status Codes: + +- **201** – no error +- **404** – no such exec instance + +### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the exec command `id`. + +**Example request**: + + GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "Memory" : 0, + "MemorySwap" : 0, + "CpuShares" : 0, + "Cpuset" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "PortSpecs" : null, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "IPAddress" : "172.17.0.2", + "IPPrefixLen" : 16, + "MacAddress" : "02:42:ac:11:00:02", + "Gateway" : "172.17.42.1", + "Bridge" : "docker0", + "PortMapping" : null, + "Ports" : {} + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Volumes" : {}, + "VolumesRW" : {} + } + } + +Status Codes: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: +- Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: +- Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.17.md b/_vendor/github.com/moby/moby/api/docs/v1.17.md new file mode 100644 index 000000000000..147b05f89f64 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.17.md @@ -0,0 +1,2007 @@ +<!--[metadata]> ++++ +title = "Remote API v1.17" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "engine_remoteapi" +weight = 4 ++++ +<![end-metadata]--> + +# Docker Remote API v1.17 + +## 1. Brief introduction + + - The Remote API has replaced `rcli`. + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](../../quickstart.md#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `STDOUT`, + `STDIN` and `STDERR`. + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a json encoded value of the filters (a map[string][]string) to process on the containers list. Available filters: + - exited=<int> -- containers with exit code of <int> + - status=(restarting|running|paused|exited) + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": "", + "Image": "ubuntu", + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Links": ["redis3:redis"], + "LxcConf": {"lxc.utsname":"docker"}, + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "SecurityOpt": [] + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +Json Parameters: + +- **Hostname** - A string value containing the desired hostname to use for the + container. +- **Domainname** - A string value containing the desired domain name to use + for the container. +- **User** - A string value containing the user to use inside the container. +- **Memory** - Memory limit in bytes. +- **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. +- **CpuShares** - An integer value containing the CPU Shares for container + (ie. the relative weight vs other containers). + **CpuSet** - String value containing the cgroups Cpuset to use. +- **AttachStdin** - Boolean value, attaches to stdin. +- **AttachStdout** - Boolean value, attaches to stdout. +- **AttachStderr** - Boolean value, attaches to stderr. +- **Tty** - Boolean value, Attach standard streams to a tty, including stdin if it is not closed. +- **OpenStdin** - Boolean value, opens stdin, +- **StdinOnce** - Boolean value, close stdin after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value"[,"VAR2=value2"]]` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entrypoint for the container a string or an array + of strings +- **Image** - String value containing the image name to use for the container +- **Volumes** – An object mapping mountpoint paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string value containing the working dir for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume + binding is a string of the form `container_path` (to create a new + volume for the container), `host_path:container_path` (to bind-mount + a host path into the container), or `host_path:container_path:ro` + (to make the bind-mount read-only inside the container). + - **Links** - A list of links for the container. Each link entry should be + in the form of "container_name:alias". + - **LxcConf** - LXC specific configurations. These configurations will only + work when using the `lxc` execution driver. + - **PortBindings** - A map of exposed container ports and the host port they + should map to. It should be specified in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates a random host port for all of a container's + exposed ports. Specified as a boolean value. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of dns servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to be added to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + +Query Parameters: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "CpuShares": 0, + "Cpuset": "", + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "MacAddress": "", + "Memory": 0, + "MemorySwap": 0, + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "PortSpecs": null, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": null, + "WorkingDir": "" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "devicemapper", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LxcConf": [], + "NetworkMode": "bridge", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "SecurityOpt": null, + "VolumesFrom": null + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "MacAddress": "", + "PortMapping": null, + "Ports": null + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": false, + "StartedAt": "2015-01-06T15:47:32.072697474Z" + }, + "Volumes": {}, + "VolumesRW": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +Query Parameters: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container logs + +`GET /containers/(id or name)/logs` + +Get stdout and stderr logs from the container ``id`` + +**Example request**: + + GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {{ STREAM }} + +Query Parameters: + +- **follow** – 1/True/true or 0/False/false, return stream. Default false +- **stdout** – 1/True/true or 0/False/false, show stdout log. Default false +- **stderr** – 1/True/true or 0/False/false, show stderr log. Default false +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default false +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all + +Status Codes: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "network" : { + "rx_dropped" : 0, + "rx_bytes" : 648, + "rx_errors" : 0, + "tx_packets" : 8, + "tx_dropped" : 0, + "rx_packets" : 8, + "tx_errors" : 0, + "tx_bytes" : 648 + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 16970827, + 1839451, + 7107380, + 10571290 + ], + "usage_in_usermode" : 10000000, + "total_usage" : 36488948, + "usage_in_kernelmode" : 20000000 + }, + "system_cpu_usage" : 20091722000000000, + "throttling_data" : {} + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Resize a container TTY + +`POST /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY for container with `id`. The container must be restarted for the resize to take effect. + +**Example request**: + + POST /containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +Status Codes: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will waits for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **name** – new name for the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1 + +### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - dangling=true +- **filter** - only return images with the specified name + +### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a tar archive compressed with one of the +following algorithms: identity (no compression), gzip, bzip2, xz. + +The archive must include a build instructions file, typically called +`Dockerfile` at the root of the archive. The `dockerfile` parameter may be +used to specify a different build instructions file by having its value be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which will be accessible in the build context (See the [*ADD build +command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **dockerfile** - path within the build context to the Dockerfile +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – git or HTTP/HTTPS URI build source +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **pull** - attempt to pull the image even if an older image exists locally +- **rm** - remove intermediate containers after a successful build (default behavior) +- **forcerm** - always remove intermediate containers (includes rm) + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pulling it from the registry or by importing it + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – repository +- **tag** – tag + + Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + + + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": + { + "Hostname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "PortSpecs": null, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + If you wish to push an image on to a private registry, that image must already have been tagged + into a repository which references that registry host name and port. This repository name should + then be used in the URL. This mirrors the flow of the CLI. + +**Example request**: + + POST /images/registry.acme.com:5000/test/push HTTP/1.1 + + +Query Parameters: + +- **tag** – the tag to associate with the image on the registry, optional + +Request Headers: + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Query Parameters: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/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", + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ApiVersion": "1.12", + "Version": "0.2.2", + "GitCommit": "5a2a5cc+CHANGES", + "GoVersion": "go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +Status Codes: + +- **200** - no error +- **500** - server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname": "", + "Domainname": "", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "Cpuset": "0,1", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get container events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, exec_create, exec_start, export, kill, oom, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling +- **until** – timestamp used for polling +- **filters** – a json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - event=<string> -- event to filter + - image=<string> -- image to filter + - container=<string> -- container to filter + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images. + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +ubuntu:latest), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + + { + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "Cmd": [ + "date" + ], + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806" + } + +Json Parameters: + +- **AttachStdin** - Boolean value, attaches to stdin of the exec command. +- **AttachStdout** - Boolean value, attaches to stdout of the exec command. +- **AttachStderr** - Boolean value, attaches to stderr of the exec command. +- **Tty** - Boolean value to allocate a pseudo-TTY +- **Cmd** - Command to run specified as a string or an array of strings. + + +Status Codes: + +- **201** – no error +- **404** – no such container + +### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up exec instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + + { + "Detach": false, + "Tty": false, + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Json Parameters: + +- **Detach** - Detach from the exec command +- **Tty** - Boolean value to allocate a pseudo-TTY + +Status Codes: + +- **200** – no error +- **404** – no such exec instance + + **Stream details**: + Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the tty session used by the exec command `id`. +This API is valid only if `tty` was specified as part of creating and starting the exec command. + +**Example request**: + + POST /exec/e90e34656806/resize HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +Query Parameters: + +- **h** – height of tty session +- **w** – width + +Status Codes: + +- **201** – no error +- **404** – no such exec instance + +### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the exec command `id`. + +**Example request**: + + GET /exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "Memory" : 0, + "MemorySwap" : 0, + "CpuShares" : 0, + "Cpuset" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "PortSpecs" : null, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "IPAddress" : "172.17.0.2", + "IPPrefixLen" : 16, + "MacAddress" : "02:42:ac:11:00:02", + "Gateway" : "172.17.42.1", + "Bridge" : "docker0", + "PortMapping" : null, + "Ports" : {} + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Volumes" : {}, + "VolumesRW" : {} + } + } + +Status Codes: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +# 3. Going further + +## 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: +- Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: +- Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it will switch its status code +from **200 OK** to **101 UPGRADED** and resend the same headers. + +This might change in the future. + +## 3.3 CORS Requests + +To set cross origin requests to the remote api, please add flag "--api-enable-cors" +when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.18.md b/_vendor/github.com/moby/moby/api/docs/v1.18.md new file mode 100644 index 000000000000..650c562037d1 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.18.md @@ -0,0 +1,2173 @@ +--- +title: "Engine API v1.18" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.18/ +- /reference/api/docker_remote_api_v1.18/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.18/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`restarting`|`running`|`paused`|`exited`) + - `label=key` or `label="key=value"` of a container label + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.18/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Links": ["redis3:redis"], + "LxcConf": {"lxc.utsname":"docker"}, + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "CpusetCpus": "0,1", + "PidMode": "", + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "" + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **HostConfig** + - **Binds** – A list of bind mounts for this container. Each item is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **LxcConf** - LXC specific configurations. These configurations only + work when using the `lxc` execution driver. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `none`. + `json-file` logging driver. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "PortSpecs": null, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": null, + "WorkingDir": "" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpuShares": 0, + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}] + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "MacAddress": "", + "PortMapping": null, + "Ports": null + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z" + }, + "Volumes": {}, + "VolumesRW": {} + } + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.18/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.18/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "network" : { + "rx_dropped" : 0, + "rx_bytes" : 648, + "rx_errors" : 0, + "tx_packets" : 8, + "tx_dropped" : 0, + "rx_packets" : 8, + "tx_errors" : 0, + "tx_bytes" : 648 + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 16970827, + 1839451, + 7107380, + 10571290 + ], + "usage_in_usermode" : 10000000, + "total_usage" : 36488948, + "usage_in_kernelmode" : 20000000 + }, + "system_cpu_usage" : 20091722000000000, + "throttling_data" : {} + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY for container with `id`. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.18/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.18/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.18/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.18/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.18/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.18/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.18/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /v1.18/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.18/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +**Example request, with digest information**: + + GET /v1.18/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728 + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.18/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the Dockerfile. This is + ignored if `remote` is specified and points to an individual filename. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. +- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the + URI points to a single text file, the file's contents are placed into + a file called `Dockerfile` and the image is built from that file. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.18/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – Repository name. +- **tag** – Tag. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.18/images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": { + "Hostname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.18/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.18/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +**Example request**: + + POST /v1.18/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object. + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.18/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.18/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.18/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "star_count": 12, + "is_official": false, + "name": "wma55/u1210sshd", + "is_automated": false, + "description": "" + }, + { + "star_count": 10, + "is_official": false, + "name": "jdswinbank/sshd", + "is_automated": false, + "description": "" + }, + { + "star_count": 18, + "is_official": false, + "name": "vgauthier/sshd", + "is_automated": false, + "description": "" + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /v1.18/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.18/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "Debug": 0, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": 1, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": 1, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OperatingSystem": "Boot2Docker", + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "SwapLimit": 0, + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.18/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.5.0", + "Os": "linux", + "KernelVersion": "3.18.5-tinycore64", + "GoVersion": "go1.4.1", + "GitCommit": "a8a31ef", + "Arch": "amd64", + "ApiVersion": "1.18" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.18/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.18/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + create, destroy, die, exec_create, exec_start, export, kill, oom, pause, restart, start, stop, unpause + +Docker images report the following events: + + untag, delete + +**Example request**: + + GET /v1.18/events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.18/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.18/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.18/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.18/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "Tty": true + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. + + +**Status codes**: + +- **201** – no error +- **404** – no such container + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.18/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.18/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.18/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "PortSpecs": null, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "IPAddress" : "172.17.0.2", + "IPPrefixLen" : 16, + "MacAddress" : "02:42:ac:11:00:02", + "Gateway" : "172.17.42.1", + "Bridge" : "docker0", + "PortMapping" : null, + "Ports" : {} + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Volumes" : {}, + "VolumesRW" : {} + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + +This might change in the future. + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.19.md b/_vendor/github.com/moby/moby/api/docs/v1.19.md new file mode 100644 index 000000000000..8523f548066d --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.19.md @@ -0,0 +1,2253 @@ +--- +title: "Engine API v1.19" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.19/ +- /reference/api/docker_remote_api_v1.19/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST. However, for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.19/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`restarting`|`running`|`paused`|`exited`) + - `label=key` or `label="key=value"` of a container label + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.19/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Links": ["redis3:redis"], + "LxcConf": {"lxc.utsname":"docker"}, + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "OomKillDisable": false, + "PidMode": "", + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "" + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **HostConfig** + - **Binds** – A list of bind mounts for this container. Each item is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **LxcConf** - LXC specific configurations. These configurations only + work when using the `lxc` execution driver. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpuPeriod** - The length of a CPU period in microseconds. + - **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + - **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000. + - **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `none`. + `syslog` available options are: `address`. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "PortSpecs": null, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": null, + "WorkingDir": "" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "BlkioWeight": 0, + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuShares": 0, + "CpuPeriod": 100000, + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "OomKillDisable": false, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}] + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "MacAddress": "", + "PortMapping": null, + "Ports": null + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z" + }, + "Volumes": {}, + "VolumesRW": {} + } + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp + will only output log-entries since that timestamp. Default: 0 (unfiltered) +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.19/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.19/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "network" : { + "rx_dropped" : 0, + "rx_bytes" : 648, + "rx_errors" : 0, + "tx_packets" : 8, + "tx_dropped" : 0, + "rx_packets" : 8, + "tx_errors" : 0, + "tx_bytes" : 648 + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100215355, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 739306590000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + }, + "precpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100093996, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 9492140000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + } + } + +The `precpu_stats` is the cpu statistic of *previous* read, which is used for calculating the cpu usage percent. It is not the exact copy of the `cpu_stats` field. + +**Query parameters**: + +- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY for container with `id`. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.19/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.19/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.19/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.19/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.19/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.19/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.19/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /v1.19/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.19/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275, + "Labels": {} + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135, + "Labels": { + "com.example.version": "v1" + } + } + ] + +**Example request, with digest information**: + + GET /v1.19/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728, + "Labels": {} + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.19/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the Dockerfile. This is + ignored if `remote` is specified and points to an individual filename. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. +- **remote** – A Git repository URI or HTTP/HTTPS URI build source. If the + URI specifies a filename, the file's contents are placed into a file + called `Dockerfile`. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.19/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – Repository name. +- **tag** – Tag. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.19/images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": { + "Hostname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.19/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": null, + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.19/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +**Example request**: + + POST /v1.19/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object. + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.19/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.19/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). This API +returns both `is_trusted` and `is_automated` images. Currently, they +are considered identical. In the future, the `is_trusted` property will +be deprecated and replaced by the `is_automated` property. + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.19/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "star_count": 12, + "is_official": false, + "name": "wma55/u1210sshd", + "is_trusted": false, + "is_automated": false, + "description": "" + }, + { + "star_count": 10, + "is_official": false, + "name": "jdswinbank/sshd", + "is_trusted": false, + "is_automated": false, + "description": "" + }, + { + "star_count": 18, + "is_official": false, + "name": "vgauthier/sshd", + "is_trusted": false, + "is_automated": false, + "description": "" + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /v1.19/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.19/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OperatingSystem": "Boot2Docker", + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "SwapLimit": false, + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.19/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.5.0", + "Os": "linux", + "KernelVersion": "3.18.5-tinycore64", + "GoVersion": "go1.4.1", + "GitCommit": "a8a31ef", + "Arch": "amd64", + "ApiVersion": "1.19" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.19/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.19/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Volumes": { + "/tmp": {} + }, + "Labels": { + "key1": "value1", + "key2": "value2" + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause + +Docker images report the following events: + + untag, delete + +**Example request**: + + GET /v1.19/events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.19/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.19/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.19/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.19/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "Tty": true, + "User": "123:456" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. +- **User** - A string value specifying the user, and optionally, group to run + the exec process inside the container. Format is one of: `"user"`, + `"user:group"`, `"uid"`, or `"uid:gid"`. + +**Status codes**: + +- **201** – no error +- **404** – no such container + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.19/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.19/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.19/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "PortSpecs": null, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "IPAddress" : "172.17.0.2", + "IPPrefixLen" : 16, + "MacAddress" : "02:42:ac:11:00:02", + "Gateway" : "172.17.42.1", + "Bridge" : "docker0", + "PortMapping" : null, + "Ports" : {} + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Volumes" : {}, + "VolumesRW" : {} + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ docker -d -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.2.md b/_vendor/github.com/moby/moby/api/docs/v1.2.md new file mode 100644 index 000000000000..678853eae10e --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.2.md @@ -0,0 +1,1024 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.2" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent = "smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.2 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id":"b750fe79269d", + "Tag":["ubuntu:latest"], + "Created":1364102658, + "CreatedBy":"/bin/bash" + }, + { + "Id":"27cf78414709", + "Created":1364068391, + "CreatedBy":"" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + + > **Example request**: + > + > POST /images/test/push HTTP/1.1 + > {{ authConfig }} + > + > **Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **204** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + {{ STREAM }} + +Query Parameters: + +- **t** – repository name to be applied to the resulting image in + case of success +- **remote** – resource to fetch, as URI + +Status Codes: + +- **200** – no error +- **500** – server error + +{{ STREAM }} is the raw text output of the build command. It uses the +HTTP Hijack method in order to stream. + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":"hannibal", + "password:"xxxx", + "email":"hannibal@a-team.com" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Status": "Login Succeeded" + } + +Status Codes: + +- **200** – no error +- **204** – no error +- **401** – unauthorized +- **403** – forbidden +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + +> docker -d -H="[tcp://192.168.1.9:2375](tcp://192.168.1.9:2375)" +> -api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.20.md b/_vendor/github.com/moby/moby/api/docs/v1.20.md new file mode 100644 index 000000000000..55a099f3296c --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.20.md @@ -0,0 +1,2408 @@ +--- +title: "Engine API v1.20" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.20/ +- /reference/api/docker_remote_api_v1.20/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST. However, for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.20/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`created`|`restarting`|`running`|`paused`|`exited`) + - `label=key` or `label="key=value"` of a container label + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.20/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Links": ["redis3:redis"], + "LxcConf": {"lxc.utsname":"docker"}, + "Memory": 0, + "MemorySwap": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "MemorySwappiness": 60, + "OomKillDisable": false, + "PidMode": "", + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "GroupAdd": ["newgroup"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "" + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **HostConfig** + - **Binds** – A list of bind mounts for this container. Each item is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **LxcConf** - LXC specific configurations. These configurations only + work when using the `lxc` execution driver. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpuPeriod** - The length of a CPU period in microseconds. + - **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + - **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000. + - **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + - **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **GroupAdd** - A list of additional groups that the container process will run as + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + values are: `bridge`, `host`, `none`, and `container:<name|id>` + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `gelf`, `none`. + `json-file` logging driver. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": null, + "WorkingDir": "" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "BlkioWeight": 0, + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuShares": 0, + "CpuPeriod": 100000, + "Devices": [], + "Dns": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "OomKillDisable": false, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}] + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "MacAddress": "", + "PortMapping": null, + "Ports": null + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z" + }, + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ] + } + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp + will only output log-entries since that timestamp. Default: 0 (unfiltered) +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.20/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.20/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "network" : { + "rx_dropped" : 0, + "rx_bytes" : 648, + "rx_errors" : 0, + "tx_packets" : 8, + "tx_dropped" : 0, + "rx_packets" : 8, + "tx_errors" : 0, + "tx_bytes" : 648 + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100215355, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 739306590000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + }, + "precpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100093996, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 9492140000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + } + } + +The `precpu_stats` is the cpu statistic of *previous* read, which is used for calculating the cpu usage percent. It is not the exact copy of the `cpu_stats` field. + +**Query parameters**: + +- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize?h=<height>&w=<width>` + +Resize the TTY for container with `id`. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.20/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.20/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.20/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.20/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.20/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.20/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.20/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Deprecated** in favor of the `archive` endpoint below. + +**Example request**: + + POST /v1.20/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Retrieving information about files and folders in a container + +`HEAD /containers/(id or name)/archive` + +See the description of the `X-Docker-Container-Path-Stat` header in the +following section. + +#### Get an archive of a filesystem resource in a container + +`GET /containers/(id or name)/archive` + +Get a tar archive of a resource in the filesystem of container `id`. + +**Query parameters**: + +- **path** - resource in the container's filesystem to archive. Required. + + If not an absolute path, it is relative to the container's root directory. + The resource specified by **path** must exist. To assert that the resource + is expected to be a directory, **path** should end in `/` or `/.` + (assuming a path separator of `/`). If **path** ends in `/.` then this + indicates that only the contents of the **path** directory should be + copied. A symlink is always resolved to its target. + + > **Note**: It is not possible to copy certain system files such as resources + > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the + > container. + +**Example request**: + + GET /v1.20/containers/8cce319429b2/archive?path=/root HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +On success, a response header `X-Docker-Container-Path-Stat` will be set to a +base64-encoded JSON object containing some filesystem header information about +the archived resource. The above example value would decode to the following +JSON object (whitespace added for readability): + +```json +{ + "name": "root", + "size": 4096, + "mode": 2147484096, + "mtime": "2014-02-27T20:51:23Z", + "linkTarget": "" +} +``` + +A `HEAD` request can also be made to this endpoint if only this information is +desired. + +**Status codes**: + +- **200** - success, returns archive of copied resource +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** was asserted to be a directory but exists as a + file) +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** does not exist) +- **500** - server error + +#### Extract an archive of files or folders to a directory in a container + +`PUT /containers/(id or name)/archive` + +Upload a tar archive to be extracted to a path in the filesystem of container +`id`. + +**Query parameters**: + +- **path** - path to a directory in the container + to extract the archive's contents into. Required. + + If not an absolute path, it is relative to the container's root directory. + The **path** resource must exist. +- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error + if unpacking the given content would cause an existing directory to be + replaced with a non-directory and vice versa. + +**Example request**: + + PUT /v1.20/containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – the content was extracted successfully +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** should be a directory but exists as a file) + - unable to overwrite existing directory with non-directory + (if **noOverwriteDirNonDir**) + - unable to overwrite existing non-directory with directory + (if **noOverwriteDirNonDir**) +- **403** - client error, permission denied, the volume + or container rootfs is marked as read-only. +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** resource does not exist) +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.20/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275, + "Labels": {} + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135, + "Labels": { + "com.example.version": "v1" + } + } + ] + +**Example request, with digest information**: + + GET /v1.20/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728, + "Labels": {} + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.20/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the `Dockerfile`. This is + ignored if `remote` is specified and points to an external `Dockerfile`. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. +- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the + URI points to a single text file, the file's contents are placed into + a file called `Dockerfile` and the image is built from that file. If + the URI points to a tarball, the file is downloaded by the daemon and + the contents therein used as the context for the build. If the URI + points to a tarball and the `dockerfile` parameter is also specified, + there must be a file with the corresponding path inside the tarball. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.20/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. +- **repo** – Repository name. +- **tag** – Tag. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.20/images/ubuntu/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Created": "2013-03-23T22:24:18.818426-07:00", + "Container": "3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "ContainerConfig": { + "Hostname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": true, + "OpenStdin": true, + "StdinOnce": false, + "Env": null, + "Cmd": ["/bin/bash"], + "Dns": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": null, + "VolumesFrom": "", + "WorkingDir": "" + }, + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Parent": "27cf784147099545", + "Size": 6824592 + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.20/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": null, + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.20/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +**Example request**: + + POST /v1.20/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object. + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.20/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.20/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.20/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /v1.20/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.20/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers": 11, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OperatingSystem": "Boot2Docker", + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "SwapLimit": false, + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.20/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.5.0", + "Os": "linux", + "KernelVersion": "3.18.5-tinycore64", + "GoVersion": "go1.4.1", + "GitCommit": "a8a31ef", + "Arch": "amd64", + "ApiVersion": "1.20", + "Experimental": false + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.20/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.20/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ], + "Labels": { + "key1": "value1", + "key2": "value2" + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing +- **changes** – Dockerfile instructions to apply while committing + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause + +Docker images report the following events: + + delete, import, pull, push, tag, untag + +**Example request**: + + GET /v1.20/events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "ubuntu:latest", "time":1374067970} + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.20/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.20/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.20/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.20/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "Tty": true, + "User": "123:456" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. +- **User** - A string value specifying the user, and optionally, group to run + the exec process inside the container. Format is one of: `"user"`, + `"user:group"`, `"uid"`, or `"uid:gid"`. + +**Status codes**: + +- **201** – no error +- **404** – no such container + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.20/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.20/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.20/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "IPAddress" : "172.17.0.2", + "IPPrefixLen" : 16, + "MacAddress" : "02:42:ac:11:00:02", + "Gateway" : "172.17.42.1", + "Bridge" : "docker0", + "PortMapping" : null, + "Ports" : {} + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Mounts" : [] + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.21.md b/_vendor/github.com/moby/moby/api/docs/v1.21.md new file mode 100644 index 000000000000..a67fe191940e --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.21.md @@ -0,0 +1,2997 @@ +--- +title: "Engine API v1.21" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.21/ +- /reference/api/docker_remote_api_v1.21/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST. However, for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.21/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`created`|`restarting`|`running`|`paused`|`exited`) + - `label=key` or `label="key=value"` of a container label + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.21/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "StopSignal": "SIGTERM", + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Links": ["redis3:redis"], + "LxcConf": {"lxc.utsname":"docker"}, + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "MemorySwappiness": 60, + "OomKillDisable": false, + "PidMode": "", + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsOptions": [""], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "GroupAdd": ["newgroup"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "", + "VolumeDriver": "" + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default. +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + + `volume-name:container-dest` to bind-mount a volume managed by a + volume driver into the container. `container-dest` must be an + _absolute_ path. + + `volume-name:container-dest:ro` to mount the volume read-only + inside the container. `container-dest` must be an _absolute_ path. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **LxcConf** - LXC specific configurations. These configurations only + work when using the `lxc` execution driver. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **MemoryReservation** - Memory soft limit in bytes. + - **KernelMemory** - Kernel memory limit in bytes. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpuPeriod** - The length of a CPU period in microseconds. + - **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + - **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000. + - **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + - **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsOptions** - A list of DNS options + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **GroupAdd** - A list of additional groups that the container process will run as + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart, `"unless-stopped"` to restart always except when + user has manually stopped the container or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken + as a custom network's name to which this container should connect to. + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `gelf`, `awslogs`, `none`. + `json-file` logging driver. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + - **VolumeDriver** - Driver that this container users to mount volumes. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": null, + "WorkingDir": "", + "StopSignal": "SIGTERM" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecDriver": "native-0.2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "BlkioWeight": 0, + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuShares": 0, + "CpuPeriod": 100000, + "Devices": [], + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "LxcConf": [], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "OomKillDisable": false, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}], + "VolumeDriver": "" + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ] + } + +**Example request, with size information**: + + GET /v1.21/containers/4fa6e0f0c678/json?size=1 HTTP/1.1 + +**Example response, with size information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + .... + "SizeRw": 0, + "SizeRootFs": 972, + .... + } + +**Query parameters**: + +- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp + will only output log-entries since that timestamp. Default: 0 (unfiltered) +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.21/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.21/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100215355, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 739306590000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + }, + "precpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100093996, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 9492140000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + } + } + +The `precpu_stats` is the cpu statistic of *previous* read, which is used for calculating the cpu usage percent. It is not the exact copy of the `cpu_stats` field. + +**Query parameters**: + +- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize` + +Resize the TTY for container with `id`. The unit is number of characters. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.21/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.21/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.21/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.21/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.21/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.21/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.21/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Deprecated** in favor of the `archive` endpoint below. + +**Example request**: + + POST /v1.21/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Retrieving information about files and folders in a container + +`HEAD /containers/(id or name)/archive` + +See the description of the `X-Docker-Container-Path-Stat` header in the +following section. + +#### Get an archive of a filesystem resource in a container + +`GET /containers/(id or name)/archive` + +Get a tar archive of a resource in the filesystem of container `id`. + +**Query parameters**: + +- **path** - resource in the container's filesystem to archive. Required. + + If not an absolute path, it is relative to the container's root directory. + The resource specified by **path** must exist. To assert that the resource + is expected to be a directory, **path** should end in `/` or `/.` + (assuming a path separator of `/`). If **path** ends in `/.` then this + indicates that only the contents of the **path** directory should be + copied. A symlink is always resolved to its target. + + > **Note**: It is not possible to copy certain system files such as resources + > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the + > container. + +**Example request**: + + GET /v1.21/containers/8cce319429b2/archive?path=/root HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +On success, a response header `X-Docker-Container-Path-Stat` will be set to a +base64-encoded JSON object containing some filesystem header information about +the archived resource. The above example value would decode to the following +JSON object (whitespace added for readability): + +```json +{ + "name": "root", + "size": 4096, + "mode": 2147484096, + "mtime": "2014-02-27T20:51:23Z", + "linkTarget": "" +} +``` + +A `HEAD` request can also be made to this endpoint if only this information is +desired. + +**Status codes**: + +- **200** - success, returns archive of copied resource +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** was asserted to be a directory but exists as a + file) +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** does not exist) +- **500** - server error + +#### Extract an archive of files or folders to a directory in a container + +`PUT /containers/(id or name)/archive` + +Upload a tar archive to be extracted to a path in the filesystem of container +`id`. + +**Query parameters**: + +- **path** - path to a directory in the container + to extract the archive's contents into. Required. + + If not an absolute path, it is relative to the container's root directory. + The **path** resource must exist. +- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error + if unpacking the given content would cause an existing directory to be + replaced with a non-directory and vice versa. + +**Example request**: + + PUT /v1.21/containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – the content was extracted successfully +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** should be a directory but exists as a file) + - unable to overwrite existing directory with non-directory + (if **noOverwriteDirNonDir**) + - unable to overwrite existing non-directory with directory + (if **noOverwriteDirNonDir**) +- **403** - client error, permission denied, the volume + or container rootfs is marked as read-only. +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** resource does not exist) +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.21/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275, + "Labels": {} + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135, + "Labels": { + "com.example.version": "v1" + } + } + ] + +**Example request, with digest information**: + + GET /v1.21/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728, + "Labels": {} + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.21/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the `Dockerfile`. This is + ignored if `remote` is specified and points to an external `Dockerfile`. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. + You can provide one or more `t` parameters. +- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the + URI points to a single text file, the file's contents are placed into + a file called `Dockerfile` and the image is built from that file. If + the URI points to a tarball, the file is downloaded by the daemon and + the contents therein used as the context for the build. If the URI + points to a tarball and the `dockerfile` parameter is also specified, + there must be a file with the corresponding path inside the tarball. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. +- **buildargs** – JSON map of string pairs for build-time variables. Users pass + these values at build-time. Docker uses the `buildargs` as the environment + context for command(s) run via the Dockerfile's `RUN` instruction or for + variable expansion in other Dockerfile instructions. This is not meant for + passing secret values. [Read more about the buildargs instruction](https://docs.docker.com/engine/reference/builder/#arg) + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.21/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. The name may include a tag or + digest. This parameter may only be used when pulling an image. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. + This parameter may only be used when importing an image. +- **repo** – Repository name given to an image when it is imported. + The repo may include a tag. This parameter may only be used when importing + an image. +- **tag** – Tag or digest. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.21/images/example/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id" : "85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment" : "", + "Os" : "linux", + "Architecture" : "amd64", + "Parent" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig" : { + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Domainname" : "", + "AttachStdout" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "NetworkDisabled" : false, + "OnBuild" : [], + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User" : "", + "WorkingDir" : "", + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "Labels" : { + "com.example.license" : "GPL", + "com.example.version" : "1.0", + "com.example.vendor" : "Acme" + }, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts" : null, + "Cmd" : [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] + }, + "DockerVersion" : "1.9.0-dev", + "VirtualSize" : 188359297, + "Size" : 0, + "Author" : "", + "Created" : "2015-09-10T08:30:53.26995814Z", + "GraphDriver" : { + "Name" : "aufs", + "Data" : null + }, + "RepoDigests" : [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags" : [ + "example:1.0", + "example:latest", + "example:stable" + ], + "Config" : { + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled" : false, + "OnBuild" : [], + "StdinOnce" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "Domainname" : "", + "AttachStdout" : false, + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Cmd" : [ + "/bin/bash" + ], + "ExposedPorts" : null, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels" : { + "com.example.vendor" : "Acme", + "com.example.version" : "1.0", + "com.example.license" : "GPL" + }, + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "WorkingDir" : "", + "User" : "" + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.21/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": null, + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.21/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +**Example request**: + + POST /v1.21/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object. + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.21/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.21/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.21/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /v1.21/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.21/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ClusterStore": "etcd://localhost:2379", + "Containers": 11, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OperatingSystem": "Boot2Docker", + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "ServerVersion": "1.9.0", + "SwapLimit": false, + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.21/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.5.0", + "Os": "linux", + "KernelVersion": "3.18.5-tinycore64", + "GoVersion": "go1.4.1", + "GitCommit": "a8a31ef", + "Arch": "amd64", + "ApiVersion": "1.20", + "Experimental": false + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.21/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.21/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ], + "Labels": { + "key1": "value1", + "key2": "value2" + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing +- **changes** – Dockerfile instructions to apply while committing + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause + +Docker images report the following events: + + delete, import, pull, push, tag, untag + +**Example request**: + + GET /v1.21/events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"pull","id":"busybox:latest","time":1442421700,"timeNano":1442421700598988358} + {"status":"create","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716853979870} + {"status":"attach","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716894759198} + {"status":"start","id":"5745704abe9caa5","from":"busybox","time":1442421716,"timeNano":1442421716983607193} + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + - `label=<string>`; -- image and container label to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.21/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.21/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.21/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.21/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "Privileged": true, + "Tty": true, + "User": "123:456" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. +- **Privileged** - Boolean value, runs the exec process with extended privileges. +- **User** - A string value specifying the user, and optionally, group to run + the exec process inside the container. Format is one of: `"user"`, + `"user:group"`, `"uid"`, or `"uid:gid"`. + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **409** - container is paused +- **500** - server error + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.21/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **409** - container is paused + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.21/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.21/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: plain/text + + { + "ID" : "11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39", + "Running" : false, + "ExitCode" : 2, + "ProcessConfig" : { + "privileged" : false, + "user" : "", + "tty" : false, + "entrypoint" : "sh", + "arguments" : [ + "-c", + "exit 2" + ] + }, + "OpenStdin" : false, + "OpenStderr" : false, + "OpenStdout" : false, + "Container" : { + "State" : { + "Status" : "running", + "Running" : true, + "Paused" : false, + "Restarting" : false, + "OOMKilled" : false, + "Pid" : 3650, + "ExitCode" : 0, + "Error" : "", + "StartedAt" : "2014-11-17T22:26:03.717657531Z", + "FinishedAt" : "0001-01-01T00:00:00Z" + }, + "ID" : "8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c", + "Created" : "2014-11-17T22:26:03.626304998Z", + "Path" : "date", + "Args" : [], + "Config" : { + "Hostname" : "8f177a186b97", + "Domainname" : "", + "User" : "", + "AttachStdin" : false, + "AttachStdout" : false, + "AttachStderr" : false, + "ExposedPorts" : null, + "Tty" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "Env" : [ "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], + "Cmd" : [ + "date" + ], + "Image" : "ubuntu", + "Volumes" : null, + "WorkingDir" : "", + "Entrypoint" : null, + "NetworkDisabled" : false, + "MacAddress" : "", + "OnBuild" : null, + "SecurityOpt" : null + }, + "Image" : "5506de2b643be1e6febbf3b8a240760c6843244c41e12aa2f60ccbb7153d17f5", + "NetworkSettings" : { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "EndpointID": "", + "Gateway": "", + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "" + } + } + }, + "ResolvConfPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/resolv.conf", + "HostnamePath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hostname", + "HostsPath" : "/var/lib/docker/containers/8f177a186b977fb451136e0fdf182abff5599a08b3c7f6ef0d36a55aaf89634c/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Name" : "/test", + "Driver" : "aufs", + "ExecDriver" : "native-0.2", + "MountLabel" : "", + "ProcessLabel" : "", + "AppArmorProfile" : "", + "RestartCount" : 0, + "Mounts" : [] + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +### 2.4 Volumes + +#### List volumes + +`GET /volumes` + +**Example request**: + + GET /v1.21/volumes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Volumes": [ + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + ] + } + +**Query parameters**: + +- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true` + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a volume + +`POST /volumes/create` + +Create a volume + +**Example request**: + + POST /v1.21/volumes/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Name": "tardis" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + +**Status codes**: + +- **201** - no error +- **500** - server error + +**JSON parameters**: + +- **Name** - The new volume's name. If not specified, Docker generates a name. +- **Driver** - Name of the volume driver to use. Defaults to `local` for the name. +- **DriverOpts** - A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + +#### Inspect a volume + +`GET /volumes/(name)` + +Return low-level information on the volume `name` + +**Example request**: + + GET /volumes/tardis + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + +**Status codes**: + +- **200** - no error +- **404** - no such volume +- **500** - server error + +#### Remove a volume + +`DELETE /volumes/(name)` + +Instruct the driver to remove the volume (`name`). + +**Example request**: + + DELETE /v1.21/volumes/tardis HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** - no error +- **404** - no such volume or volume driver +- **409** - volume is in use and cannot be removed +- **500** - server error + +### 2.5 Networks + +#### List networks + +`GET /networks` + +**Example request**: + + GET /v1.21/networks HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +[ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Scope": "local", + "Driver": "bridge", + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Containers": { + "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": { + "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda", + "MacAddress": "02:42:ac:11:00:02", + "IPv4Address": "172.17.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Scope": "local", + "Driver": "null", + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Scope": "local", + "Driver": "host", + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } +] +``` + +**Query parameters**: + +- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: `name=[network-names]` , `id=[network-ids]` + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Inspect network + +`GET /networks/(id or name)` + +Return low-level information on the network `id` + +**Example request**: + + GET /v1.21/networks/f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566 HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Scope": "local", + "Driver": "bridge", + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Containers": { + "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": { + "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda", + "MacAddress": "02:42:ac:11:00:02", + "IPv4Address": "172.17.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } +} +``` + +**Status codes**: + +- **200** - no error +- **404** - network not found +- **500** - server error + +#### Create a network + +`POST /networks/create` + +Create a network + +**Example request**: + +``` +POST /v1.21/networks/create HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Name":"isolated_nw", + "CheckDuplicate":true, + "Driver":"bridge", + "IPAM":{ + "Driver": "default", + "Config":[ + { + "Subnet":"172.20.0.0/16", + "IPRange":"172.20.10.0/24", + "Gateway":"172.20.10.11" + } + ] + } +} +``` + +**Example response**: + +``` +HTTP/1.1 201 Created +Content-Type: application/json + +{ + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" +} +``` + +**Status codes**: + +- **201** - no error +- **404** - plugin not found +- **500** - server error + +**JSON parameters**: + +- **Name** - The new network's name. this is a mandatory field +- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false`. + Since Network is primarily keyed based on a random ID and not on the name, + and network name is strictly a user-friendly alias to the network which is uniquely identified using ID, + there is no guaranteed way to check for duplicates across a cluster of docker hosts. + This parameter CheckDuplicate is there to provide a best effort checking of any networks + which has the same name but it is not guaranteed to catch all name collisions. +- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver +- **IPAM** - Optional custom IP scheme for the network + - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver + - **Config** - List of IPAM configuration options, specified as a map: + `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` +- **Options** - Network specific options to be used by the drivers + +#### Connect a container to a network + +`POST /networks/(id or name)/connect` + +Connect a container to a network + +**Example request**: + +``` +POST /v1.21/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4" +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container is not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **container** - container-id/name to be connected to the network + +#### Disconnect a container from a network + +`POST /networks/(id or name)/disconnect` + +Disconnect a container from a network + +**Example request**: + +``` +POST /v1.21/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4" +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **Container** - container-id/name to be disconnected from a network + +#### Remove a network + +`DELETE /networks/(id or name)` + +Instruct the driver to remove the network (`id`). + +**Example request**: + + DELETE /v1.21/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **403** - operation not supported for pre-defined networks +- **404** - no such network +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.22.md b/_vendor/github.com/moby/moby/api/docs/v1.22.md new file mode 100644 index 000000000000..4f099624d69f --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.22.md @@ -0,0 +1,3336 @@ +--- +title: "Engine API v1.22" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.22/ +- /reference/api/docker_remote_api_v1.22/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST. However, for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.22/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + } + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + } + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + } + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + } + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`created`|`restarting`|`running`|`paused`|`exited`|`dead`) + - `label=key` or `label="key=value"` of a container label + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.22/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": null, + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "StopSignal": "SIGTERM", + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Tmpfs": { "/run": "rw,noexec,nosuid,size=65536k" }, + "Links": ["redis3:redis"], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "BlkioWeightDevice": [{}], + "BlkioDeviceReadBps": [{}], + "BlkioDeviceReadIOps": [{}], + "BlkioDeviceWriteBps": [{}], + "BlkioDeviceWriteIOps": [{}], + "MemorySwappiness": 60, + "OomKillDisable": false, + "OomScoreAdj": 500, + "PidMode": "", + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsOptions": [""], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "GroupAdd": ["newgroup"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "", + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "NetworkingConfig": { + "EndpointsConfig": { + "isolated_nw" : { + "IPAMConfig": { + "IPv4Address":"172.20.30.33", + "IPv6Address":"2001:db8:abcd::3033" + }, + "Links":["container_1", "container_2"], + "Aliases":["server_x", "server_y"] + } + } + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default. +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + + `volume-name:container-dest` to bind-mount a volume managed by a + volume driver into the container. `container-dest` must be an + _absolute_ path. + + `volume-name:container-dest:ro` to mount the volume read-only + inside the container. `container-dest` must be an _absolute_ path. + - **Tmpfs** – A map of container directories which should be replaced by tmpfs mounts, and their corresponding + mount options. A JSON object in the form `{ "/run": "rw,noexec,nosuid,size=65536k" }`. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **MemoryReservation** - Memory soft limit in bytes. + - **KernelMemory** - Kernel memory limit in bytes. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpuPeriod** - The length of a CPU period in microseconds. + - **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + - **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000. + - **BlkioWeightDevice** - Block IO weight (relative device weight) in the form of: `"BlkioWeightDevice": [{"Path": "device_path", "Weight": weight}]` + - **BlkioDeviceReadBps** - Limit read rate (bytes per second) from a device in the form of: `"BlkioDeviceReadBps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceReadBps": [{"Path": "/dev/sda", "Rate": "1024"}]"` + - **BlkioDeviceWriteBps** - Limit write rate (bytes per second) to a device in the form of: `"BlkioDeviceWriteBps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceWriteBps": [{"Path": "/dev/sda", "Rate": "1024"}]"` + - **BlkioDeviceReadIOps** - Limit read rate (IO per second) from a device in the form of: `"BlkioDeviceReadIOps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceReadIOps": [{"Path": "/dev/sda", "Rate": "1000"}]` + - **BlkioDeviceWriteIOps** - Limit write rate (IO per second) to a device in the form of: `"BlkioDeviceWriteIOps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceWriteIOps": [{"Path": "/dev/sda", "Rate": "1000"}]` + - **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + - **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not. + - **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsOptions** - A list of DNS options + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **GroupAdd** - A list of additional groups that the container process will run as + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart, `"unless-stopped"` to restart always except when + user has manually stopped the container or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **NetworkMode** - Sets the networking mode for the container. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken + as a custom network's name to which this container should connect to. + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `gelf`, `awslogs`, `splunk`, `none`. + `json-file` logging driver. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + - **VolumeDriver** - Driver that this container users to mount volumes. + - **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "BlkioWeight": 0, + "BlkioWeightDevice": [{}], + "BlkioDeviceReadBps": [{}], + "BlkioDeviceWriteBps": [{}], + "BlkioDeviceReadIOps": [{}], + "BlkioDeviceWriteIOps": [{}], + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuShares": 0, + "CpuPeriod": 100000, + "Devices": [], + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + +**Example request, with size information**: + + GET /v1.22/containers/4fa6e0f0c678/json?size=1 HTTP/1.1 + +**Example response, with size information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + .... + "SizeRw": 0, + "SizeRootFs": 972, + .... + } + +**Query parameters**: + +- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp + will only output log-entries since that timestamp. Default: 0 (unfiltered) +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.22/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.22/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100215355, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 739306590000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + }, + "precpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100093996, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 9492140000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + } + } + +The `precpu_stats` is the cpu statistic of *previous* read, which is used for calculating the cpu usage percent. It is not the exact copy of the `cpu_stats` field. + +**Query parameters**: + +- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize` + +Resize the TTY for container with `id`. The unit is number of characters. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.22/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.22/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Update a container + +`POST /containers/(id or name)/update` + +Update resource configs of one or more containers. + +**Example request**: + + POST /v1.22/containers/e90e34656806/update HTTP/1.1 + Content-Type: application/json + + { + "BlkioWeight": 300, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0", + "Memory": 314572800, + "MemorySwap": 514288000, + "MemoryReservation": 209715200, + "KernelMemory": 52428800 + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Warnings": [] + } + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.22/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.22/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **409** - container is paused +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.22/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.22/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.22/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Deprecated** in favor of the `archive` endpoint below. + +**Example request**: + + POST /v1.22/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Retrieving information about files and folders in a container + +`HEAD /containers/(id or name)/archive` + +See the description of the `X-Docker-Container-Path-Stat` header in the +following section. + +#### Get an archive of a filesystem resource in a container + +`GET /containers/(id or name)/archive` + +Get a tar archive of a resource in the filesystem of container `id`. + +**Query parameters**: + +- **path** - resource in the container's filesystem to archive. Required. + + If not an absolute path, it is relative to the container's root directory. + The resource specified by **path** must exist. To assert that the resource + is expected to be a directory, **path** should end in `/` or `/.` + (assuming a path separator of `/`). If **path** ends in `/.` then this + indicates that only the contents of the **path** directory should be + copied. A symlink is always resolved to its target. + + > **Note**: It is not possible to copy certain system files such as resources + > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the + > container. + +**Example request**: + + GET /v1.22/containers/8cce319429b2/archive?path=/root HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +On success, a response header `X-Docker-Container-Path-Stat` will be set to a +base64-encoded JSON object containing some filesystem header information about +the archived resource. The above example value would decode to the following +JSON object (whitespace added for readability): + +```json +{ + "name": "root", + "size": 4096, + "mode": 2147484096, + "mtime": "2014-02-27T20:51:23Z", + "linkTarget": "" +} +``` + +A `HEAD` request can also be made to this endpoint if only this information is +desired. + +**Status codes**: + +- **200** - success, returns archive of copied resource +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** was asserted to be a directory but exists as a + file) +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** does not exist) +- **500** - server error + +#### Extract an archive of files or folders to a directory in a container + +`PUT /containers/(id or name)/archive` + +Upload a tar archive to be extracted to a path in the filesystem of container +`id`. + +**Query parameters**: + +- **path** - path to a directory in the container + to extract the archive's contents into. Required. + + If not an absolute path, it is relative to the container's root directory. + The **path** resource must exist. +- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error + if unpacking the given content would cause an existing directory to be + replaced with a non-directory and vice versa. + +**Example request**: + + PUT /v1.22/containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – the content was extracted successfully +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** should be a directory but exists as a file) + - unable to overwrite existing directory with non-directory + (if **noOverwriteDirNonDir**) + - unable to overwrite existing non-directory with directory + (if **noOverwriteDirNonDir**) +- **403** - client error, permission denied, the volume + or container rootfs is marked as read-only. +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** resource does not exist) +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.22/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275, + "Labels": {} + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135, + "Labels": { + "com.example.version": "v1" + } + } + ] + +**Example request, with digest information**: + + GET /v1.22/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728, + "Labels": {} + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.22/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the `Dockerfile`. This is + ignored if `remote` is specified and points to an external `Dockerfile`. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. + You can provide one or more `t` parameters. +- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the + URI points to a single text file, the file's contents are placed into + a file called `Dockerfile` and the image is built from that file. If + the URI points to a tarball, the file is downloaded by the daemon and + the contents therein used as the context for the build. If the URI + points to a tarball and the `dockerfile` parameter is also specified, + there must be a file with the corresponding path inside the tarball. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. +- **buildargs** – JSON map of string pairs for build-time variables. Users pass + these values at build-time. Docker uses the `buildargs` as the environment + context for command(s) run via the Dockerfile's `RUN` instruction or for + variable expansion in other Dockerfile instructions. This is not meant for + passing secret values. [Read more about the buildargs instruction](https://docs.docker.com/engine/reference/builder/#arg) +- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.22/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. The name may include a tag or + digest. This parameter may only be used when pulling an image. + The pull is cancelled if the HTTP connection is closed. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. + This parameter may only be used when importing an image. +- **repo** – Repository name given to an image when it is imported. + The repo may include a tag. This parameter may only be used when importing + an image. +- **tag** – Tag or digest. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token + - Credential based login: + + ``` + { + "username": "jdoe", + "password": "secret", + "email": "jdoe@acme.com" + } + ``` + + - Token based login: + + ``` + { + "registrytoken": "9cbaf023786cd7..." + } + ``` + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.22/images/example/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id" : "85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment" : "", + "Os" : "linux", + "Architecture" : "amd64", + "Parent" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig" : { + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Domainname" : "", + "AttachStdout" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "NetworkDisabled" : false, + "OnBuild" : [], + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User" : "", + "WorkingDir" : "", + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "Labels" : { + "com.example.license" : "GPL", + "com.example.version" : "1.0", + "com.example.vendor" : "Acme" + }, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts" : null, + "Cmd" : [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] + }, + "DockerVersion" : "1.9.0-dev", + "VirtualSize" : 188359297, + "Size" : 0, + "Author" : "", + "Created" : "2015-09-10T08:30:53.26995814Z", + "GraphDriver" : { + "Name" : "aufs", + "Data" : null + }, + "RepoDigests" : [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags" : [ + "example:1.0", + "example:latest", + "example:stable" + ], + "Config" : { + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled" : false, + "OnBuild" : [], + "StdinOnce" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "Domainname" : "", + "AttachStdout" : false, + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Cmd" : [ + "/bin/bash" + ], + "ExposedPorts" : null, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels" : { + "com.example.vendor" : "Acme", + "com.example.version" : "1.0", + "com.example.license" : "GPL" + }, + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "WorkingDir" : "", + "User" : "" + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.22/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": null, + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.22/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +The push is cancelled if the HTTP connection is closed. + +**Example request**: + + POST /v1.22/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token + - Credential based login: + + ``` + { + "username": "jdoe", + "password": "secret", + "email": "jdoe@acme.com", + } + ``` + + - Token based login: + + ``` + { + "registrytoken": "9cbaf023786cd7..." + } + ``` + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.22/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.22/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.22/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /v1.22/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.22/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Architecture": "x86_64", + "ClusterStore": "etcd://localhost:2379", + "Containers": 11, + "ContainersRunning": 7, + "ContainersStopped": 3, + "ContainersPaused": 1, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OSType": "linux", + "OperatingSystem": "Boot2Docker", + "Plugins": { + "Volume": [ + "local" + ], + "Network": [ + "null", + "host", + "bridge" + ] + }, + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "ServerVersion": "1.9.0", + "SwapLimit": false, + "SystemStatus": [["State", "Healthy"]], + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.22/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.10.0", + "Os": "linux", + "KernelVersion": "3.19.0-23-generic", + "GoVersion": "go1.4.2", + "GitCommit": "e75da4b", + "Arch": "amd64", + "ApiVersion": "1.22", + "BuildTime": "2015-12-01T07:09:13.444803460+00:00", + "Experimental": true + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.22/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.22/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ], + "Labels": { + "key1": "value1", + "key2": "value2" + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing +- **changes** – Dockerfile instructions to apply while committing + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update + +Docker images report the following events: + + delete, import, pull, push, tag, untag + +Docker volumes report the following events: + + create, mount, unmount, destroy + +Docker networks report the following events: + + create, connect, disconnect, destroy + +**Example request**: + + GET /v1.22/events?since=1374067924 + +**Example response**: + + 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 + + { + "status": "pull", + "id": "alpine:latest", + "Type": "image", + "Action": "pull", + "Actor": { + "ID": "alpine:latest", + "Attributes": { + "name": "alpine" + } + }, + "time": 1461943101, + "timeNano": 1461943101301854122 + } + { + "status": "create", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "create", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101381709551 + } + { + "status": "attach", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "attach", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101383858412 + } + { + "Type": "network", + "Action": "connect", + "Actor": { + "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474", + "Attributes": { + "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "name": "bridge", + "type": "bridge" + } + }, + "time": 1461943101, + "timeNano": 1461943101394865557 + } + { + "status": "start", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "start", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101607533796 + } + { + "status": "resize", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "resize", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "height": "46", + "image": "alpine", + "name": "my-container", + "width": "204" + } + }, + "time": 1461943101, + "timeNano": 1461943101610269268 + } + { + "status": "die", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "die", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "exitCode": "0", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943105, + "timeNano": 1461943105079144137 + } + { + "Type": "network", + "Action": "disconnect", + "Actor": { + "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474", + "Attributes": { + "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "name": "bridge", + "type": "bridge" + } + }, + "time": 1461943105, + "timeNano": 1461943105230860245 + } + { + "status": "destroy", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "destroy", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943105, + "timeNano": 1461943105338056026 + } + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + - `label=<string>`; -- image and container label to filter + - `type=<string>`; -- either `container` or `image` or `volume` or `network` + - `volume=<string>`; -- volume to filter + - `network=<string>`; -- network to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.22/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.22/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.22/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.22/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "DetachKeys": "ctrl-p,ctrl-q", + "Privileged": true, + "Tty": true, + "User": "123:456" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **DetachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. +- **Privileged** - Boolean value, runs the exec process with extended privileges. +- **User** - A string value specifying the user, and optionally, group to run + the exec process inside the container. Format is one of: `"user"`, + `"user:group"`, `"uid"`, or `"uid:gid"`. + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **409** - container is paused +- **500** - server error + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.22/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **409** - container is paused + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.22/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.22/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +### 2.4 Volumes + +#### List volumes + +`GET /volumes` + +**Example request**: + + GET /v1.22/volumes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Volumes": [ + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + ], + "Warnings": [] + } + +**Query parameters**: + +- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true` + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a volume + +`POST /volumes/create` + +Create a volume + +**Example request**: + + POST /v1.22/volumes/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Name": "tardis" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + +**Status codes**: + +- **201** - no error +- **500** - server error + +**JSON parameters**: + +- **Name** - The new volume's name. If not specified, Docker generates a name. +- **Driver** - Name of the volume driver to use. Defaults to `local` for the name. +- **DriverOpts** - A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + +#### Inspect a volume + +`GET /volumes/(name)` + +Return low-level information on the volume `name` + +**Example request**: + + GET /volumes/tardis + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + +**Status codes**: + +- **200** - no error +- **404** - no such volume +- **500** - server error + +#### Remove a volume + +`DELETE /volumes/(name)` + +Instruct the driver to remove the volume (`name`). + +**Example request**: + + DELETE /v1.22/volumes/tardis HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** - no error +- **404** - no such volume or volume driver +- **409** - volume is in use and cannot be removed +- **500** - server error + +### 2.5 Networks + +#### List networks + +`GET /networks` + +**Example request**: + + GET /v1.22/networks?filters={"type":{"custom":true}} HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +[ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Scope": "local", + "Driver": "bridge", + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Containers": { + "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": { + "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda", + "MacAddress": "02:42:ac:11:00:02", + "IPv4Address": "172.17.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Scope": "local", + "Driver": "null", + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Scope": "local", + "Driver": "host", + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } +] +``` + +**Query parameters**: + +- **filters** - JSON encoded network list filter. The filter value is one of: + - `id=<network-id>` Matches all or part of a network id. + - `name=<network-name>` Matches all or part of a network name. + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Inspect network + +`GET /networks/(id or name)` + +Return low-level information on the network `id` + +**Example request**: + + GET /v1.22/networks/7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99 HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Scope": "local", + "Driver": "bridge", + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1/16" + } + ], + "Options": { + "foo": "bar" + } + }, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } +} +``` + +**Status codes**: + +- **200** - no error +- **404** - network not found +- **500** - server error + +#### Create a network + +`POST /networks/create` + +Create a network + +**Example request**: + +``` +POST /v1.22/networks/create HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Name":"isolated_nw", + "CheckDuplicate":true, + "Driver":"bridge", + "IPAM":{ + "Driver": "default", + "Config":[ + { + "Subnet":"172.20.0.0/16", + "IPRange":"172.20.10.0/24", + "Gateway":"172.20.10.11" + }, + { + "Subnet":"2001:db8:abcd::/64", + "Gateway":"2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal":true +} +``` + +**Example response**: + +``` +HTTP/1.1 201 Created +Content-Type: application/json + +{ + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" +} +``` + +**Status codes**: + +- **201** - no error +- **404** - plugin not found +- **500** - server error + +**JSON parameters**: + +- **Name** - The new network's name. this is a mandatory field +- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false`. + Since Network is primarily keyed based on a random ID and not on the name, + and network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed way to check for duplicates. + This parameter CheckDuplicate is there to provide a best effort checking of any networks + which has the same name but it is not guaranteed to catch all name collisions. +- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver +- **IPAM** - Optional custom IP scheme for the network + - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver + - **Config** - List of IPAM configuration options, specified as a map: + `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` + - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` +- **Options** - Network specific options to be used by the drivers + +#### Connect a container to a network + +`POST /networks/(id or name)/connect` + +Connect a container to a network + +**Example request**: + +``` +POST /v1.22/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address":"172.24.56.89", + "IPv6Address":"2001:db8::5689" + } + } +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container is not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **container** - container-id/name to be connected to the network + +#### Disconnect a container from a network + +`POST /networks/(id or name)/disconnect` + +Disconnect a container from a network + +**Example request**: + +``` +POST /v1.22/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4", + "Force":false +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **Container** - container-id/name to be disconnected from a network +- **Force** - Force the container to disconnect from a network + +#### Remove a network + +`DELETE /networks/(id or name)` + +Instruct the driver to remove the network (`id`). + +**Example request**: + + DELETE /v1.22/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **403** - operation not supported for pre-defined networks +- **404** - no such network +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.23.md b/_vendor/github.com/moby/moby/api/docs/v1.23.md new file mode 100644 index 000000000000..d191fb76e8c2 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.23.md @@ -0,0 +1,3452 @@ +--- +title: "Engine API v1.23" +description: "API Documentation for Docker" +keywords: "API, Docker, rcli, REST, documentation" +aliases: +- /engine/reference/api/docker_remote_api_v1.23/ +- /reference/api/docker_remote_api_v1.23/ +--- + +<!-- This file is maintained within the moby/moby GitHub + repository at https://github.com/moby/moby/. Make all + pull requests against that repo. If you see this file in + another repository, consider it read-only there, as it will + periodically be overwritten by the definitive file. Pull + requests which include edits to this file in other repositories + will be rejected. +--> + +## 1. Brief introduction + + - The daemon listens on `unix:///var/run/docker.sock` but you can + [Bind Docker to another host/port or a Unix socket](https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-host-port-or-a-unix-socket). + - The API tends to be REST. However, for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout`, + `stdin` and `stderr`. + - A `Content-Length` header should be present in `POST` requests to endpoints + that expect a body. + - To lock to a specific version of the API, you prefix the URL with the version + of the API to use. For example, `/v1.18/info`. If no version is included in + the URL, the maximum supported API version is used. + - If the API version specified in the URL is not supported by the daemon, a HTTP + `400 Bad Request` error message is returned. + +## 2. Endpoints + +### 2.1 Containers + +#### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /v1.23/containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Names":["/boring_feynman"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 1", + "Created": 1367854155, + "State": "exited", + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "2cdc4edb1ded3631c81f57966563e5c8525b81121bb3706a9a9a3ae102711f3f", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:02" + } + } + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + }, + { + "Id": "9cd87474be90", + "Names":["/coolName"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 222222", + "Created": 1367854155, + "State": "exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "88eaed7b37b38c2a3f0c4bc796494fdf51b270c2d22656412a2ca5d559a64d7a", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.8", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:08" + } + } + }, + "Mounts": [] + }, + { + "Id": "3176a2479c92", + "Names":["/sleepy_dog"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "State": "exited", + "Status": "Exit 0", + "Ports":[], + "Labels": {}, + "SizeRw":12288, + "SizeRootFs":0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "8b27c041c30326d59cd6e6f510d4f8d1d570a228466f956edf7815508f78e30d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.6", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:06" + } + } + }, + "Mounts": [] + }, + { + "Id": "4cb07b47f9fb", + "Names":["/running_cat"], + "Image": "ubuntu:latest", + "ImageID": "d74508fb6632491cea586a1fd7d748dfc5274cd6fdfedee309ecdcbc2bf5cb82", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "State": "exited", + "Status": "Exit 0", + "Ports": [], + "Labels": {}, + "SizeRw": 12288, + "SizeRootFs": 0, + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "d91c7b2f0644403d7ef3095985ea0e2370325cd2332ff3a3225c4247328e66e9", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.5", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:11:00:05" + } + } + }, + "Mounts": [] + } + ] + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created + containers, include non-running ones. +- **since** – Show only containers created since Id, include + non-running ones. +- **before** – Show only containers created before Id, include + non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers + sizes +- **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: + - `exited=<int>`; -- containers with exit code of `<int>` ; + - `status=`(`created`|`restarting`|`running`|`paused`|`exited`|`dead`) + - `label=key` or `label="key=value"` of a container label + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `since`=(`<container id>` or `<container name>`) + - `volume`=(`<volume name>` or `<mount point destination>`) + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +#### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /v1.23/containers/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": [ + "FOO=bar", + "BAZ=quux" + ], + "Cmd": [ + "date" + ], + "Entrypoint": "", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "NetworkDisabled": false, + "MacAddress": "12:34:56:78:9a:bc", + "ExposedPorts": { + "22/tcp": {} + }, + "StopSignal": "SIGTERM", + "HostConfig": { + "Binds": ["/tmp:/tmp"], + "Tmpfs": { "/run": "rw,noexec,nosuid,size=65536k" }, + "Links": ["redis3:redis"], + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0,1", + "BlkioWeight": 300, + "BlkioWeightDevice": [{}], + "BlkioDeviceReadBps": [{}], + "BlkioDeviceReadIOps": [{}], + "BlkioDeviceWriteBps": [{}], + "BlkioDeviceWriteIOps": [{}], + "MemorySwappiness": 60, + "OomKillDisable": false, + "OomScoreAdj": 500, + "PidMode": "", + "PidsLimit": -1, + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }] }, + "PublishAllPorts": false, + "Privileged": false, + "ReadonlyRootfs": false, + "Dns": ["8.8.8.8"], + "DnsOptions": [""], + "DnsSearch": [""], + "ExtraHosts": null, + "VolumesFrom": ["parent", "other:ro"], + "CapAdd": ["NET_ADMIN"], + "CapDrop": ["MKNOD"], + "GroupAdd": ["newgroup"], + "RestartPolicy": { "Name": "", "MaximumRetryCount": 0 }, + "NetworkMode": "bridge", + "Devices": [], + "Ulimits": [{}], + "LogConfig": { "Type": "json-file", "Config": {} }, + "SecurityOpt": [], + "CgroupParent": "", + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "NetworkingConfig": { + "EndpointsConfig": { + "isolated_nw" : { + "IPAMConfig": { + "IPv4Address":"172.20.30.33", + "IPv6Address":"2001:db8:abcd::3033" + }, + "Links":["container_1", "container_2"], + "Aliases":["server_x", "server_y"] + } + } + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **Hostname** - A string value containing the hostname to use for the + container. +- **Domainname** - A string value containing the domain name to use + for the container. +- **User** - A string value specifying the user inside the container. +- **AttachStdin** - Boolean value, attaches to `stdin`. +- **AttachStdout** - Boolean value, attaches to `stdout`. +- **AttachStderr** - Boolean value, attaches to `stderr`. +- **Tty** - Boolean value, Attach standard streams to a `tty`, including `stdin` if it is not closed. +- **OpenStdin** - Boolean value, opens `stdin`, +- **StdinOnce** - Boolean value, close `stdin` after the 1 attached client disconnects. +- **Env** - A list of environment variables in the form of `["VAR=value", ...]` +- **Labels** - Adds a map of labels to a container. To specify a map: `{"key":"value", ... }` +- **Cmd** - Command to run specified as a string or an array of strings. +- **Entrypoint** - Set the entry point for the container as a string or an array + of strings. +- **Image** - A string specifying the image name to use for the container. +- **Volumes** - An object mapping mount point paths (strings) inside the + container to empty objects. +- **WorkingDir** - A string specifying the working directory for commands to + run in. +- **NetworkDisabled** - Boolean value, when true disables networking for the + container +- **ExposedPorts** - An object mapping ports to an empty object in the form of: + `"ExposedPorts": { "<port>/<tcp|udp>: {}" }` +- **StopSignal** - Signal to stop a container as a string or unsigned integer. `SIGTERM` by default. +- **HostConfig** + - **Binds** – A list of volume bindings for this container. Each volume binding is a string in one of these forms: + + `host-src:container-dest` to bind-mount a host path into the + container. Both `host-src`, and `container-dest` must be an + _absolute_ path. + + `host-src:container-dest:ro` to make the bind mount read-only + inside the container. Both `host-src`, and `container-dest` must be + an _absolute_ path. + + `volume-name:container-dest` to bind-mount a volume managed by a + volume driver into the container. `container-dest` must be an + _absolute_ path. + + `volume-name:container-dest:ro` to mount the volume read-only + inside the container. `container-dest` must be an _absolute_ path. + - **Tmpfs** – A map of container directories which should be replaced by tmpfs mounts, and their corresponding + mount options. A JSON object in the form `{ "/run": "rw,noexec,nosuid,size=65536k" }`. + - **Links** - A list of links for the container. Each link entry should be + in the form of `container_name:alias`. + - **Memory** - Memory limit in bytes. + - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. + You must use this with `memory` and make the swap value larger than `memory`. + - **MemoryReservation** - Memory soft limit in bytes. + - **KernelMemory** - Kernel memory limit in bytes. + - **CpuShares** - An integer value containing the container's CPU Shares + (ie. the relative weight vs other containers). + - **CpuPeriod** - The length of a CPU period in microseconds. + - **CpuQuota** - Microseconds of CPU time that the container can get in a CPU period. + - **CpusetCpus** - String value containing the `cgroups CpusetCpus` to use. + - **CpusetMems** - Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. + - **BlkioWeight** - Block IO weight (relative weight) accepts a weight value between 10 and 1000. + - **BlkioWeightDevice** - Block IO weight (relative device weight) in the form of: `"BlkioWeightDevice": [{"Path": "device_path", "Weight": weight}]` + - **BlkioDeviceReadBps** - Limit read rate (bytes per second) from a device in the form of: `"BlkioDeviceReadBps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceReadBps": [{"Path": "/dev/sda", "Rate": "1024"}]"` + - **BlkioDeviceWriteBps** - Limit write rate (bytes per second) to a device in the form of: `"BlkioDeviceWriteBps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceWriteBps": [{"Path": "/dev/sda", "Rate": "1024"}]"` + - **BlkioDeviceReadIOps** - Limit read rate (IO per second) from a device in the form of: `"BlkioDeviceReadIOps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceReadIOps": [{"Path": "/dev/sda", "Rate": "1000"}]` + - **BlkioDeviceWriteIOps** - Limit write rate (IO per second) to a device in the form of: `"BlkioDeviceWriteIOps": [{"Path": "device_path", "Rate": rate}]`, for example: + `"BlkioDeviceWriteIOps": [{"Path": "/dev/sda", "Rate": "1000"}]` + - **MemorySwappiness** - Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. + - **OomKillDisable** - Boolean value, whether to disable OOM Killer for the container or not. + - **OomScoreAdj** - An integer value containing the score given to the container in order to tune OOM killer preferences. + - **PidMode** - Set the PID (Process) Namespace mode for the container; + `"container:<name|id>"`: joins another container's PID namespace + `"host"`: use the host's PID namespace inside the container + - **PidsLimit** - Tune a container's pids limit. Set -1 for unlimited. + - **PortBindings** - A map of exposed container ports and the host port they + should map to. A JSON object in the form + `{ <port>/<protocol>: [{ "HostPort": "<port>" }] }` + Take note that `port` is specified as a string and not an integer value. + - **PublishAllPorts** - Allocates an ephemeral host port for all of a container's + exposed ports. Specified as a boolean value. + + Ports are de-allocated when the container stops and allocated when the container starts. + The allocated port might be changed when restarting the container. + + The port is selected from the ephemeral port range that depends on the kernel. + For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. + - **Privileged** - Gives the container full access to the host. Specified as + a boolean value. + - **ReadonlyRootfs** - Mount the container's root filesystem as read only. + Specified as a boolean value. + - **Dns** - A list of DNS servers for the container to use. + - **DnsOptions** - A list of DNS options + - **DnsSearch** - A list of DNS search domains + - **ExtraHosts** - A list of hostnames/IP mappings to add to the + container's `/etc/hosts` file. Specified in the form `["hostname:IP"]`. + - **VolumesFrom** - A list of volumes to inherit from another container. + Specified in the form `<container name>[:<ro|rw>]` + - **CapAdd** - A list of kernel capabilities to add to the container. + - **Capdrop** - A list of kernel capabilities to drop from the container. + - **GroupAdd** - A list of additional groups that the container process will run as + - **RestartPolicy** – The behavior to apply when the container exits. The + value is an object with a `Name` property of either `"always"` to + always restart, `"unless-stopped"` to restart always except when + user has manually stopped the container or `"on-failure"` to restart only when the container + exit code is non-zero. If `on-failure` is used, `MaximumRetryCount` + controls the number of times to retry before giving up. + The default is not to restart. (optional) + An ever increasing delay (double the previous delay, starting at 100mS) + is added before each restart to prevent flooding the server. + - **UsernsMode** - Sets the usernamespace mode for the container when usernamespace remapping option is enabled. + supported values are: `host`. + - **NetworkMode** - Sets the networking mode for the container. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. Any other value is taken + as a custom network's name to which this container should connect to. + - **Devices** - A list of devices to add to the container specified as a JSON object in the + form + `{ "PathOnHost": "/dev/deviceName", "PathInContainer": "/dev/deviceName", "CgroupPermissions": "mrw"}` + - **Ulimits** - A list of ulimits to set in the container, specified as + `{ "Name": <name>, "Soft": <soft limit>, "Hard": <hard limit> }`, for example: + `Ulimits: { "Name": "nofile", "Soft": 1024, "Hard": 2048 }` + - **SecurityOpt**: A list of string values to customize labels for MLS + systems, such as SELinux. + - **LogConfig** - Log configuration for the container, specified as a JSON object in the form + `{ "Type": "<driver_name>", "Config": {"key1": "val1"}}`. + Available types: `json-file`, `syslog`, `journald`, `gelf`, `fluentd`, `awslogs`, `splunk`, `etwlogs`, `none`. + `json-file` logging driver. + - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. + - **VolumeDriver** - Driver that this container users to mount volumes. + - **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + +**Query parameters**: + +- **name** – Assign the specified name to the container. Must + match `/?[a-zA-Z0-9_-]+`. + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **406** – impossible to attach (container not running) +- **409** – conflict +- **500** – server error + +#### Inspect a container + +`GET /containers/(id or name)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "AppArmorProfile": "", + "Args": [ + "-c", + "exit 9" + ], + "Config": { + "AttachStderr": true, + "AttachStdin": false, + "AttachStdout": true, + "Cmd": [ + "/bin/sh", + "-c", + "exit 9" + ], + "Domainname": "", + "Entrypoint": null, + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts": null, + "Hostname": "ba033ac44011", + "Image": "ubuntu", + "Labels": { + "com.example.vendor": "Acme", + "com.example.license": "GPL", + "com.example.version": "1.0" + }, + "MacAddress": "", + "NetworkDisabled": false, + "OnBuild": null, + "OpenStdin": false, + "StdinOnce": false, + "Tty": false, + "User": "", + "Volumes": { + "/volumes/data": {} + }, + "WorkingDir": "", + "StopSignal": "SIGTERM" + }, + "Created": "2015-01-06T15:47:31.485331387Z", + "Driver": "overlay2", + "ExecIDs": null, + "HostConfig": { + "Binds": null, + "BlkioWeight": 0, + "BlkioWeightDevice": [{}], + "BlkioDeviceReadBps": [{}], + "BlkioDeviceWriteBps": [{}], + "BlkioDeviceReadIOps": [{}], + "BlkioDeviceWriteIOps": [{}], + "CapAdd": null, + "CapDrop": null, + "ContainerIDFile": "", + "CpusetCpus": "", + "CpusetMems": "", + "CpuShares": 0, + "CpuPeriod": 100000, + "Devices": [], + "Dns": null, + "DnsOptions": null, + "DnsSearch": null, + "ExtraHosts": null, + "IpcMode": "", + "Links": null, + "Memory": 0, + "MemorySwap": 0, + "MemoryReservation": 0, + "KernelMemory": 0, + "OomKillDisable": false, + "OomScoreAdj": 500, + "NetworkMode": "bridge", + "PidMode": "", + "PortBindings": {}, + "Privileged": false, + "ReadonlyRootfs": false, + "PublishAllPorts": false, + "RestartPolicy": { + "MaximumRetryCount": 2, + "Name": "on-failure" + }, + "LogConfig": { + "Config": null, + "Type": "json-file" + }, + "SecurityOpt": null, + "VolumesFrom": null, + "Ulimits": [{}], + "VolumeDriver": "", + "ShmSize": 67108864 + }, + "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", + "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", + "LogPath": "/var/lib/docker/containers/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b/1eb5fabf5a03807136561b3c00adcd2992b535d624d5e18b6cdc6a6844d9767b-json.log", + "Id": "ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39", + "Image": "04c5d3b7b0656168630d3ba35d8889bd0e9caafcaeb3004d2bfbc47e7c5d35d2", + "MountLabel": "", + "Name": "/boring_euclid", + "NetworkSettings": { + "Bridge": "", + "SandboxID": "", + "HairpinMode": false, + "LinkLocalIPv6Address": "", + "LinkLocalIPv6PrefixLen": 0, + "Ports": null, + "SandboxKey": "", + "SecondaryIPAddresses": null, + "SecondaryIPv6Addresses": null, + "EndpointID": "", + "Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "IPAddress": "", + "IPPrefixLen": 0, + "IPv6Gateway": "", + "MacAddress": "", + "Networks": { + "bridge": { + "NetworkID": "7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", + "EndpointID": "7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d", + "Gateway": "172.17.0.1", + "IPAddress": "172.17.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Path": "/bin/sh", + "ProcessLabel": "", + "ResolvConfPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/resolv.conf", + "RestartCount": 1, + "State": { + "Error": "", + "ExitCode": 9, + "FinishedAt": "2015-01-06T15:47:32.080254511Z", + "OOMKilled": false, + "Dead": false, + "Paused": false, + "Pid": 0, + "Restarting": false, + "Running": true, + "StartedAt": "2015-01-06T15:47:32.072697474Z", + "Status": "running" + }, + "Mounts": [ + { + "Name": "fac362...80535", + "Source": "/data", + "Destination": "/data", + "Driver": "local", + "Mode": "ro,Z", + "RW": false, + "Propagation": "" + } + ] + } + +**Example request, with size information**: + + GET /v1.23/containers/4fa6e0f0c678/json?size=1 HTTP/1.1 + +**Example response, with size information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + .... + "SizeRw": 0, + "SizeRootFs": 972, + .... + } + +**Query parameters**: + +- **size** – 1/True/true or 0/False/false, return container size information. Default is `false`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### List processes running inside a container + +`GET /containers/(id or name)/top` + +List processes running inside the container `id`. On Unix systems this +is done by running the `ps` command. This endpoint is not +supported on Windows. + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "UID", "PID", "PPID", "C", "STIME", "TTY", "TIME", "CMD" + ], + "Processes" : [ + [ + "root", "13642", "882", "0", "17:03", "pts/0", "00:00:00", "/bin/bash" + ], + [ + "root", "13735", "13642", "0", "17:06", "pts/0", "00:00:00", "sleep 10" + ] + ] + } + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/top?ps_args=aux HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles" : [ + "USER","PID","%CPU","%MEM","VSZ","RSS","TTY","STAT","START","TIME","COMMAND" + ] + "Processes" : [ + [ + "root","13642","0.0","0.1","18172","3184","pts/0","Ss","17:03","0:00","/bin/bash" + ], + [ + "root","13895","0.0","0.0","4348","692","pts/0","S+","17:15","0:00","sleep 10" + ] + ], + } + +**Query parameters**: + +- **ps_args** – `ps` arguments to use (e.g., `aux`), defaults to `-ef` + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container logs + +`GET /containers/(id or name)/logs` + +Get `stdout` and `stderr` logs from the container ``id`` + +> **Note**: +> This endpoint works only for containers with the `json-file` or `journald` logging drivers. + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/logs?stderr=1&stdout=1×tamps=1&follow=1&tail=10&since=1428990821 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **follow** – 1/True/true or 0/False/false, return stream. Default `false`. +- **stdout** – 1/True/true or 0/False/false, show `stdout` log. Default `false`. +- **stderr** – 1/True/true or 0/False/false, show `stderr` log. Default `false`. +- **since** – UNIX timestamp (integer) to filter logs. Specifying a timestamp + will only output log-entries since that timestamp. Default: 0 (unfiltered) +- **timestamps** – 1/True/true or 0/False/false, print timestamps for + every log line. Default `false`. +- **tail** – Output specified number of lines at the end of logs: `all` or `<number>`. Default all. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **404** – no such container +- **500** – server error + +#### Inspect changes on a container's filesystem + +`GET /containers/(id or name)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Values for `Kind`: + +- `0`: Modify +- `1`: Add +- `2`: Delete + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Export a container + +`GET /containers/(id or name)/export` + +Export the contents of container `id` + +**Example request**: + + GET /v1.23/containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Get container stats based on resource usage + +`GET /containers/(id or name)/stats` + +This endpoint returns a live stream of a container's resource usage statistics. + +**Example request**: + + GET /v1.23/containers/redis1/stats HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "read" : "2015-01-08T22:57:31.547920715Z", + "pids_stats": { + "current": 3 + }, + "networks": { + "eth0": { + "rx_bytes": 5338, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 36, + "tx_bytes": 648, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 8 + }, + "eth5": { + "rx_bytes": 4641, + "rx_dropped": 0, + "rx_errors": 0, + "rx_packets": 26, + "tx_bytes": 690, + "tx_dropped": 0, + "tx_errors": 0, + "tx_packets": 9 + } + }, + "memory_stats" : { + "stats" : { + "total_pgmajfault" : 0, + "cache" : 0, + "mapped_file" : 0, + "total_inactive_file" : 0, + "pgpgout" : 414, + "rss" : 6537216, + "total_mapped_file" : 0, + "writeback" : 0, + "unevictable" : 0, + "pgpgin" : 477, + "total_unevictable" : 0, + "pgmajfault" : 0, + "total_rss" : 6537216, + "total_rss_huge" : 6291456, + "total_writeback" : 0, + "total_inactive_anon" : 0, + "rss_huge" : 6291456, + "hierarchical_memory_limit" : 67108864, + "total_pgfault" : 964, + "total_active_file" : 0, + "active_anon" : 6537216, + "total_active_anon" : 6537216, + "total_pgpgout" : 414, + "total_cache" : 0, + "inactive_anon" : 0, + "active_file" : 0, + "pgfault" : 964, + "inactive_file" : 0, + "total_pgpgin" : 477 + }, + "max_usage" : 6651904, + "usage" : 6537216, + "failcnt" : 0, + "limit" : 67108864 + }, + "blkio_stats" : {}, + "cpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24472255, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100215355, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 739306590000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + }, + "precpu_stats" : { + "cpu_usage" : { + "percpu_usage" : [ + 8646879, + 24350896, + 36438778, + 30657443 + ], + "usage_in_usermode" : 50000000, + "total_usage" : 100093996, + "usage_in_kernelmode" : 30000000 + }, + "system_cpu_usage" : 9492140000000, + "throttling_data" : {"periods":0,"throttled_periods":0,"throttled_time":0} + } + } + +The `precpu_stats` is the cpu statistic of *previous* read, which is used for calculating the cpu usage percent. It is not the exact copy of the `cpu_stats` field. + +**Query parameters**: + +- **stream** – 1/True/true or 0/False/false, pull stats once then disconnect. Default `true`. + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Resize a container TTY + +`POST /containers/(id or name)/resize` + +Resize the TTY for container with `id`. The unit is number of characters. You must restart the container for the resize to take effect. + +**Example request**: + + POST /v1.23/containers/4fa6e0f0c678/resize?h=40&w=80 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **200** – no error +- **404** – No such container +- **500** – Cannot resize container + +#### Start a container + +`POST /containers/(id or name)/start` + +Start the container `id` + +> **Note**: +> For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. +> See [create a container](#create-a-container) for details. + +**Example request**: + + POST /v1.23/containers/e90e34656806/start HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + +**Status codes**: + +- **204** – no error +- **304** – container already started +- **404** – no such container +- **500** – server error + +#### Stop a container + +`POST /containers/(id or name)/stop` + +Stop the container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **304** – container already stopped +- **404** – no such container +- **500** – server error + +#### Restart a container + +`POST /containers/(id or name)/restart` + +Restart the container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **t** – number of seconds to wait before killing the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Kill a container + +`POST /containers/(id or name)/kill` + +Kill the container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **signal** - Signal to send to the container: integer or string like `SIGINT`. + When not set, `SIGKILL` is assumed and the call waits for the container to exit. + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Update a container + +`POST /containers/(id or name)/update` + +Update configuration of one or more containers. + +**Example request**: + + POST /v1.23/containers/e90e34656806/update HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "BlkioWeight": 300, + "CpuShares": 512, + "CpuPeriod": 100000, + "CpuQuota": 50000, + "CpusetCpus": "0,1", + "CpusetMems": "0", + "Memory": 314572800, + "MemorySwap": 514288000, + "MemoryReservation": 209715200, + "KernelMemory": 52428800, + "RestartPolicy": { + "MaximumRetryCount": 4, + "Name": "on-failure" + } + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Warnings": [] + } + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Rename a container + +`POST /containers/(id or name)/rename` + +Rename the container `id` to a `new_name` + +**Example request**: + + POST /v1.23/containers/e90e34656806/rename?name=new_name HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **name** – new name for the container + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **409** - conflict name already assigned +- **500** – server error + +#### Pause a container + +`POST /containers/(id or name)/pause` + +Pause the container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/pause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Unpause a container + +`POST /containers/(id or name)/unpause` + +Unpause the container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/unpause HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** – no error +- **404** – no such container +- **500** – server error + +#### Attach to a container + +`POST /containers/(id or name)/attach` + +Attach to the container `id` + +**Example request**: + + POST /v1.23/containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. +- **stdin** – 1/True/true or 0/False/false, if `stream=true`, attach + to `stdin`. Default `false`. +- **stdout** – 1/True/true or 0/False/false, if `logs=true`, return + `stdout` log, if `stream=true`, attach to `stdout`. Default `false`. +- **stderr** – 1/True/true or 0/False/false, if `logs=true`, return + `stderr` log, if `stream=true`, attach to `stderr`. Default `false`. + +**Status codes**: + +- **101** – no error, hints proxy about hijacking +- **200** – no error, no upgrade header found +- **400** – bad parameter +- **404** – no such container +- **409** - container is paused +- **500** – server error + +**Stream details**: + +When using the TTY setting is enabled in +[`POST /containers/create` +](#create-a-container), +the stream is the raw data from the process PTY and client's `stdin`. +When the TTY is disabled, then the stream is multiplexed to separate +`stdout` and `stderr`. + +The format is a **Header** and a **Payload** (frame). + +**HEADER** + +The header contains the information which the stream writes (`stdout` or +`stderr`). It also contains the size of the associated frame encoded in the +last four bytes (`uint32`). + +It is encoded on the first eight bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + +`STREAM_TYPE` can be: + +- 0: `stdin` (is written on `stdout`) +- 1: `stdout` +- 2: `stderr` + +`SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of +the `uint32` size encoded as big endian. + +**PAYLOAD** + +The payload is the raw stream. + +**IMPLEMENTATION** + +The simplest way to implement the Attach protocol is the following: + + 1. Read eight bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + +#### Attach to a container (websocket) + +`GET /containers/(id or name)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /v1.23/containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {% raw %} + {{ STREAM }} + {% endraw %} + +**Query parameters**: + +- **detachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **logs** – 1/True/true or 0/False/false, return logs. Default `false`. +- **stream** – 1/True/true or 0/False/false, return stream. + Default `false`. + +**Status codes**: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +#### Wait a container + +`POST /containers/(id or name)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /v1.23/containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Remove a container + +`DELETE /containers/(id or name)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /v1.23/containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Query parameters**: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default `false`. +- **force** - 1/True/true or 0/False/false, Kill then remove the container. + Default `false`. +- **link** - 1/True/true or 0/False/false, Remove the specified + link associated to the container. Default `false`. + +**Status codes**: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **409** – conflict +- **500** – server error + +#### Copy files or folders from a container + +`POST /containers/(id or name)/copy` + +Copy files or folders of container `id` + +**Deprecated** in favor of the `archive` endpoint below. + +**Example request**: + + POST /v1.23/containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Status codes**: + +- **200** – no error +- **404** – no such container +- **500** – server error + +#### Retrieving information about files and folders in a container + +`HEAD /containers/(id or name)/archive` + +See the description of the `X-Docker-Container-Path-Stat` header in the +following section. + +#### Get an archive of a filesystem resource in a container + +`GET /containers/(id or name)/archive` + +Get a tar archive of a resource in the filesystem of container `id`. + +**Query parameters**: + +- **path** - resource in the container's filesystem to archive. Required. + + If not an absolute path, it is relative to the container's root directory. + The resource specified by **path** must exist. To assert that the resource + is expected to be a directory, **path** should end in `/` or `/.` + (assuming a path separator of `/`). If **path** ends in `/.` then this + indicates that only the contents of the **path** directory should be + copied. A symlink is always resolved to its target. + + > **Note**: It is not possible to copy certain system files such as resources + > under `/proc`, `/sys`, `/dev`, and mounts created by the user in the + > container. + +**Example request**: + + GET /v1.23/containers/8cce319429b2/archive?path=/root HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +On success, a response header `X-Docker-Container-Path-Stat` will be set to a +base64-encoded JSON object containing some filesystem header information about +the archived resource. The above example value would decode to the following +JSON object (whitespace added for readability): + +```json +{ + "name": "root", + "size": 4096, + "mode": 2147484096, + "mtime": "2014-02-27T20:51:23Z", + "linkTarget": "" +} +``` + +A `HEAD` request can also be made to this endpoint if only this information is +desired. + +**Status codes**: + +- **200** - success, returns archive of copied resource +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** was asserted to be a directory but exists as a + file) +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** does not exist) +- **500** - server error + +#### Extract an archive of files or folders to a directory in a container + +`PUT /containers/(id or name)/archive` + +Upload a tar archive to be extracted to a path in the filesystem of container +`id`. + +**Query parameters**: + +- **path** - path to a directory in the container + to extract the archive's contents into. Required. + + If not an absolute path, it is relative to the container's root directory. + The **path** resource must exist. +- **noOverwriteDirNonDir** - If "1", "true", or "True" then it will be an error + if unpacking the given content would cause an existing directory to be + replaced with a non-directory and vice versa. + +**Example request**: + + PUT /v1.23/containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** – the content was extracted successfully +- **400** - client error, bad parameter, details in JSON response body, one of: + - must specify path parameter (**path** cannot be empty) + - not a directory (**path** should be a directory but exists as a file) + - unable to overwrite existing directory with non-directory + (if **noOverwriteDirNonDir**) + - unable to overwrite existing non-directory with directory + (if **noOverwriteDirNonDir**) +- **403** - client error, permission denied, the volume + or container rootfs is marked as read-only. +- **404** - client error, resource not found, one of: + – no such container (container `id` does not exist) + - no such file or directory (**path** resource does not exist) +- **500** – server error + +### 2.2 Images + +#### List Images + +`GET /images/json` + +**Example request**: + + GET /v1.23/images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275, + "Labels": {} + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135, + "Labels": { + "com.example.version": "v1" + } + } + ] + +**Example request, with digest information**: + + GET /v1.23/images/json?digests=1 HTTP/1.1 + +**Example response, with digest information**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Created": 1420064636, + "Id": "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125", + "ParentId": "ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2", + "RepoDigests": [ + "localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags": [ + "localhost:5000/test/busybox:latest", + "playdate:latest" + ], + "Size": 0, + "VirtualSize": 2429728, + "Labels": {} + } + ] + +The response shows a single image `Id` associated with two repositories +(`RepoTags`): `localhost:5000/test/busybox`: and `playdate`. A caller can use +either of the `RepoTags` values `localhost:5000/test/busybox:latest` or +`playdate:latest` to reference the image. + +You can also use `RepoDigests` values to reference an image. In this response, +the array has only one reference and that is to the +`localhost:5000/test/busybox` repository; the `playdate` repository has no +digest. You can reference this digest using the value: +`localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d...` + +See the `docker run` and `docker build` commands for examples of digest and tag +references on the command line. + +**Query parameters**: + +- **all** – 1/True/true or 0/False/false, default false +- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters: + - `dangling=true` + - `label=key` or `label="key=value"` of an image label +- **filter** - only return images with the specified name + +#### Build image from a Dockerfile + +`POST /build` + +Build an image from a Dockerfile + +**Example request**: + + POST /v1.23/build HTTP/1.1 + Content-Type: application/x-tar + + {% raw %} + {{ TAR STREAM }} + {% endraw %} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1/5..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + +The input stream must be a `tar` archive compressed with one of the +following algorithms: `identity` (no compression), `gzip`, `bzip2`, `xz`. + +The archive must include a build instructions file, typically called +`Dockerfile` at the archive's root. The `dockerfile` parameter may be +used to specify a different build instructions file. To do this, its value must be +the path to the alternate build instructions file to use. + +The archive may include any number of other files, +which are accessible in the build context (See the [*ADD build +command*](https://docs.docker.com/engine/reference/builder/#add)). + +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + +The build is canceled if the client drops the connection by quitting +or being killed. + +**Query parameters**: + +- **dockerfile** - Path within the build context to the `Dockerfile`. This is + ignored if `remote` is specified and points to an external `Dockerfile`. +- **t** – A name and optional tag to apply to the image in the `name:tag` format. + If you omit the `tag` the default `latest` value is assumed. + You can provide one or more `t` parameters. +- **remote** – A Git repository URI or HTTP/HTTPS context URI. If the + URI points to a single text file, the file's contents are placed into + a file called `Dockerfile` and the image is built from that file. If + the URI points to a tarball, the file is downloaded by the daemon and + the contents therein used as the context for the build. If the URI + points to a tarball and the `dockerfile` parameter is also specified, + there must be a file with the corresponding path inside the tarball. +- **q** – Suppress verbose build output. +- **nocache** – Do not use the cache when building the image. +- **pull** - Attempt to pull the image even if an older image exists locally. +- **rm** - Remove intermediate containers after a successful build (default behavior). +- **forcerm** - Always remove intermediate containers (includes `rm`). +- **memory** - Set memory limit for build. +- **memswap** - Total memory (memory + swap), `-1` to enable unlimited swap. +- **cpushares** - CPU shares (relative weight). +- **cpusetcpus** - CPUs in which to allow execution (e.g., `0-3`, `0,1`). +- **cpuperiod** - The length of a CPU period in microseconds. +- **cpuquota** - Microseconds of CPU time that the container can get in a CPU period. +- **buildargs** – JSON map of string pairs for build-time variables. Users pass + these values at build-time. Docker uses the `buildargs` as the environment + context for command(s) run via the Dockerfile's `RUN` instruction or for + variable expansion in other Dockerfile instructions. This is not meant for + passing secret values. [Read more about the buildargs instruction](https://docs.docker.com/engine/reference/builder/#arg) +- **shmsize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. +- **labels** – JSON map of string pairs for labels to set on the image. + +**Request Headers**: + +- **Content-type** – Set to `"application/x-tar"`. +- **X-Registry-Config** – A base64-url-safe-encoded Registry Auth Config JSON + object with the following structure: + + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + + This object maps the hostname of a registry to an object containing the + "username" and "password" for that registry. Multiple registries may + be specified as the build may be based on an image requiring + authentication to pull from any arbitrary registry. Only the registry + domain name (and port if not the default "443") are required. However + (for legacy reasons) the "official" Docker, Inc. hosted registry must + be specified with both a "https://" prefix and a "/v1/" suffix even + though Docker will prefer to use the v2 registry API. + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Create an image + +`POST /images/create` + +Create an image either by pulling it from the registry or by importing it + +**Example request**: + + POST /v1.23/images/create?fromImage=busybox&tag=latest HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + +When using this endpoint to pull an image from the registry, the +`X-Registry-Auth` header can be used to include +a base64-encoded AuthConfig object. + +**Query parameters**: + +- **fromImage** – Name of the image to pull. The name may include a tag or + digest. This parameter may only be used when pulling an image. + The pull is cancelled if the HTTP connection is closed. +- **fromSrc** – Source to import. The value may be a URL from which the image + can be retrieved or `-` to read the image from the request body. + This parameter may only be used when importing an image. +- **repo** – Repository name given to an image when it is imported. + The repo may include a tag. This parameter may only be used when importing + an image. +- **tag** – Tag or digest. If empty when pulling an image, this causes all tags + for the given image to be pulled. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token + - Credential based login: + + ``` + { + "username": "jdoe", + "password": "secret", + "email": "jdoe@acme.com" + } + ``` + + - Token based login: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +**Status codes**: + +- **200** – no error +- **404** - repository does not exist or no read access +- **500** – server error + + + +#### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /v1.23/images/example/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id" : "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c", + "Container" : "cb91e48a60d01f1e27028b4fc6819f4f290b3cf12496c8176ec714d0d390984a", + "Comment" : "", + "Os" : "linux", + "Architecture" : "amd64", + "Parent" : "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "ContainerConfig" : { + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Domainname" : "", + "AttachStdout" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "StdinOnce" : false, + "NetworkDisabled" : false, + "OnBuild" : [], + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "User" : "", + "WorkingDir" : "", + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "Labels" : { + "com.example.license" : "GPL", + "com.example.version" : "1.0", + "com.example.vendor" : "Acme" + }, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "ExposedPorts" : null, + "Cmd" : [ + "/bin/sh", + "-c", + "#(nop) LABEL com.example.vendor=Acme com.example.license=GPL com.example.version=1.0" + ] + }, + "DockerVersion" : "1.9.0-dev", + "VirtualSize" : 188359297, + "Size" : 0, + "Author" : "", + "Created" : "2015-09-10T08:30:53.26995814Z", + "GraphDriver" : { + "Name" : "aufs", + "Data" : null + }, + "RepoDigests" : [ + "localhost:5000/test/busybox/example@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf" + ], + "RepoTags" : [ + "example:1.0", + "example:latest", + "example:stable" + ], + "Config" : { + "Image" : "91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", + "NetworkDisabled" : false, + "OnBuild" : [], + "StdinOnce" : false, + "PublishService" : "", + "AttachStdin" : false, + "OpenStdin" : false, + "Domainname" : "", + "AttachStdout" : false, + "Tty" : false, + "Hostname" : "e611e15f9c9d", + "Volumes" : null, + "Cmd" : [ + "/bin/bash" + ], + "ExposedPorts" : null, + "Env" : [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + ], + "Labels" : { + "com.example.vendor" : "Acme", + "com.example.version" : "1.0", + "com.example.license" : "GPL" + }, + "Entrypoint" : null, + "MacAddress" : "", + "AttachStderr" : false, + "WorkingDir" : "", + "User" : "" + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6", + "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + ] + } + } + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /v1.23/images/ubuntu/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710", + "Created": 1398108230, + "CreatedBy": "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /", + "Tags": [ + "ubuntu:lucid", + "ubuntu:10.04" + ], + "Size": 182964289, + "Comment": "" + }, + { + "Id": "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8", + "Created": 1398108222, + "CreatedBy": "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/", + "Tags": null, + "Size": 0, + "Comment": "" + }, + { + "Id": "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158", + "Created": 1371157430, + "CreatedBy": "", + "Tags": [ + "scratch12:latest", + "scratch:latest" + ], + "Size": 0, + "Comment": "Imported from -" + } + ] + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /v1.23/images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + +If you wish to push an image on to a private registry, that image must already have a tag +into a repository which references that registry `hostname` and `port`. This repository name should +then be used in the URL. This duplicates the command line's flow. + +The push is cancelled if the HTTP connection is closed. + +**Example request**: + + POST /v1.23/images/registry.acme.com:5000/test/push HTTP/1.1 + + +**Query parameters**: + +- **tag** – The tag to associate with the image on the registry. This is optional. + +**Request Headers**: + +- **X-Registry-Auth** – base64-encoded AuthConfig object, containing either login information, or a token + - Credential based login: + + ``` + { + "username": "jdoe", + "password": "secret", + "email": "jdoe@acme.com", + } + ``` + + - Identity token based login: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **500** – server error + +#### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /v1.23/images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 Created + +**Query parameters**: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +**Status codes**: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /v1.23/images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +**Query parameters**: + +- **force** – 1/True/true or 0/False/false, default false +- **noprune** – 1/True/true or 0/False/false, default false + +**Status codes**: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +#### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /v1.23/images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_automated": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +**Query parameters**: + +- **term** – term to search + +**Status codes**: + +- **200** – no error +- **500** – server error + +### 2.3 Misc + +#### Check auth configuration + +`POST /auth` + +Validate credentials for a registry and get identity token, +if available, for accessing the registry without password. + +**Example request**: + + POST /v1.23/auth HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "username": "hannibal", + "password": "xxxx", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + + { + "Status": "Login Succeeded", + "IdentityToken": "9cbaf023786cd7..." + } + +**Status codes**: + +- **200** – no error +- **204** – no error +- **500** – server error + +#### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /v1.23/info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Architecture": "x86_64", + "ClusterStore": "etcd://localhost:2379", + "CgroupDriver": "cgroupfs", + "Containers": 11, + "ContainersRunning": 7, + "ContainersStopped": 3, + "ContainersPaused": 1, + "CpuCfsPeriod": true, + "CpuCfsQuota": true, + "Debug": false, + "DockerRootDir": "/var/lib/docker", + "Driver": "btrfs", + "DriverStatus": [[""]], + "ExecutionDriver": "native-0.1", + "ExperimentalBuild": false, + "HttpProxy": "http://test:test@localhost:8080", + "HttpsProxy": "https://test:test@localhost:8080", + "ID": "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS", + "IPv4Forwarding": true, + "Images": 16, + "IndexServerAddress": "https://index.docker.io/v1/", + "InitPath": "/usr/bin/docker", + "InitSha1": "", + "KernelMemory": true, + "KernelVersion": "3.12.0-1-amd64", + "Labels": [ + "storage=ssd" + ], + "MemTotal": 2099236864, + "MemoryLimit": true, + "NCPU": 1, + "NEventsListener": 0, + "NFd": 11, + "NGoroutines": 21, + "Name": "prod-server-42", + "NoProxy": "9.81.1.160", + "OomKillDisable": true, + "OSType": "linux", + "OperatingSystem": "Boot2Docker", + "Plugins": { + "Volume": [ + "local" + ], + "Network": [ + "null", + "host", + "bridge" + ] + }, + "RegistryConfig": { + "IndexConfigs": { + "docker.io": { + "Mirrors": null, + "Name": "docker.io", + "Official": true, + "Secure": true + } + }, + "InsecureRegistryCIDRs": [ + "127.0.0.0/8" + ] + }, + "ServerVersion": "1.9.0", + "SwapLimit": false, + "SystemStatus": [["State", "Healthy"]], + "SystemTime": "2015-03-10T11:11:23.730591467-07:00" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /v1.23/version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version": "1.11.0", + "Os": "linux", + "KernelVersion": "3.19.0-23-generic", + "GoVersion": "go1.4.2", + "GitCommit": "e75da4b", + "Arch": "amd64", + "ApiVersion": "1.23", + "BuildTime": "2015-12-01T07:09:13.444803460+00:00", + "Experimental": true + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Ping the docker server + +`GET /_ping` + +Ping the docker server + +**Example request**: + + GET /v1.23/_ping HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + OK + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /v1.23/commit?container=44c004db4b17&comment=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Mounts": [ + { + "Source": "/data", + "Destination": "/data", + "Mode": "ro,Z", + "RW": false + } + ], + "Labels": { + "key1": "value1", + "key2": "value2" + }, + "WorkingDir": "", + "NetworkDisabled": false, + "ExposedPorts": { + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + {"Id": "596069db4bf5"} + +**JSON parameters**: + +- **config** - the container's configuration + +**Query parameters**: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **comment** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **pause** – 1/True/true or 0/False/false, whether to pause the container before committing +- **changes** – Dockerfile instructions to apply while committing + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **500** – server error + +#### Monitor Docker's events + +`GET /events` + +Get container events from docker, in real time via streaming. + +Docker containers report the following events: + + attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update + +Docker images report the following events: + + delete, import, pull, push, tag, untag + +Docker volumes report the following events: + + create, mount, unmount, destroy + +Docker networks report the following events: + + create, connect, disconnect, destroy + +**Example request**: + + GET /v1.23/events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + Server: Docker/1.11.0 (linux) + Date: Fri, 29 Apr 2016 15:18:06 GMT + Transfer-Encoding: chunked + + { + "status": "pull", + "id": "alpine:latest", + "Type": "image", + "Action": "pull", + "Actor": { + "ID": "alpine:latest", + "Attributes": { + "name": "alpine" + } + }, + "time": 1461943101, + "timeNano": 1461943101301854122 + } + { + "status": "create", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "create", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101381709551 + } + { + "status": "attach", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "attach", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101383858412 + } + { + "Type": "network", + "Action": "connect", + "Actor": { + "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474", + "Attributes": { + "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "name": "bridge", + "type": "bridge" + } + }, + "time": 1461943101, + "timeNano": 1461943101394865557 + } + { + "status": "start", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "start", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943101, + "timeNano": 1461943101607533796 + } + { + "status": "resize", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "resize", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "height": "46", + "image": "alpine", + "name": "my-container", + "width": "204" + } + }, + "time": 1461943101, + "timeNano": 1461943101610269268 + } + { + "status": "die", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "die", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "exitCode": "0", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943105, + "timeNano": 1461943105079144137 + } + { + "Type": "network", + "Action": "disconnect", + "Actor": { + "ID": "7dc8ac97d5d29ef6c31b6052f3938c1e8f2749abbd17d1bd1febf2608db1b474", + "Attributes": { + "container": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "name": "bridge", + "type": "bridge" + } + }, + "time": 1461943105, + "timeNano": 1461943105230860245 + } + { + "status": "destroy", + "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "from": "alpine", + "Type": "container", + "Action": "destroy", + "Actor": { + "ID": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", + "Attributes": { + "com.example.some-label": "some-label-value", + "image": "alpine", + "name": "my-container" + } + }, + "time": 1461943105, + "timeNano": 1461943105338056026 + } + +**Query parameters**: + +- **since** – Timestamp. Show all events created since timestamp and then stream +- **until** – Timestamp. Show events created until given timestamp and stop streaming +- **filters** – A json encoded value of the filters (a map[string][]string) to process on the event list. Available filters: + - `container=<string>`; -- container to filter + - `event=<string>`; -- event to filter + - `image=<string>`; -- image to filter + - `label=<string>`; -- image and container label to filter + - `type=<string>`; -- either `container` or `image` or `volume` or `network` + - `volume=<string>`; -- volume to filter + - `network=<string>`; -- network to filter + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified +by `name`. + +If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image +(and its parents) are returned. If `name` is an image ID, similarly only that +image (and its parents) are returned, but with the exclusion of the +'repositories' file in the tarball, as there were no image names referenced. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.23/images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Get a tarball containing all images + +`GET /images/get` + +Get a tarball containing all images and metadata for one or more repositories. + +For each value of the `names` parameter: if it is a specific name and tag (e.g. +`ubuntu:latest`), then only that image (and its parents) are returned; if it is +an image ID, similarly only that image (and its parents) are returned and there +would be no names referenced in the 'repositories' file for this image ID. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /v1.23/images/get?names=myname%2Fmyapp%3Alatest&names=busybox + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into a Docker repository. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /v1.23/images/load + Content-Type: application/x-tar + Content-Length: 12345 + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + + {"status":"Loading layer","progressDetail":{"current":32768,"total":1292800},"progress":"[= ] 32.77 kB/1.293 MB","id":"8ac8bfaff55a"} + {"status":"Loading layer","progressDetail":{"current":65536,"total":1292800},"progress":"[== ] 65.54 kB/1.293 MB","id":"8ac8bfaff55a"} + {"status":"Loading layer","progressDetail":{"current":98304,"total":1292800},"progress":"[=== ] 98.3 kB/1.293 MB","id":"8ac8bfaff55a"} + {"status":"Loading layer","progressDetail":{"current":131072,"total":1292800},"progress":"[===== ] 131.1 kB/1.293 MB","id":"8ac8bfaff55a"} + ... + {"stream":"Loaded image: busybox:latest\n"} + +**Example response**: + +If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress +details are suppressed, and only a confirmation message is returned once the +action completes. + + HTTP/1.1 200 OK + Content-Type: application/json + Transfer-Encoding: chunked + + {"stream":"Loaded image: busybox:latest\n"} + +**Query parameters**: + +- **quiet** – Boolean value, suppress progress details during load. Defaults + to `0` / `false` if omitted. + +**Status codes**: + +- **200** – no error +- **500** – server error + +#### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing these files: + +- `VERSION`: currently `1.0` - the file format version +- `json`: detailed layer information, similar to `docker inspect layer_id` +- `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file contains `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, the tarball should also include a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +#### Exec Create + +`POST /containers/(id or name)/exec` + +Sets up an exec instance in a running container `id` + +**Example request**: + + POST /v1.23/containers/e90e34656806/exec HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "AttachStdin": true, + "AttachStdout": true, + "AttachStderr": true, + "Cmd": ["sh"], + "DetachKeys": "ctrl-p,ctrl-q", + "Privileged": true, + "Tty": true, + "User": "123:456" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id": "f90e34656806", + "Warnings":[] + } + +**JSON parameters**: + +- **AttachStdin** - Boolean value, attaches to `stdin` of the `exec` command. +- **AttachStdout** - Boolean value, attaches to `stdout` of the `exec` command. +- **AttachStderr** - Boolean value, attaches to `stderr` of the `exec` command. +- **DetachKeys** – Override the key sequence for detaching a + container. Format is a single character `[a-Z]` or `ctrl-<value>` + where `<value>` is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. +- **Tty** - Boolean value to allocate a pseudo-TTY. +- **Cmd** - Command to run specified as a string or an array of strings. +- **Privileged** - Boolean value, runs the exec process with extended privileges. +- **User** - A string value specifying the user, and optionally, group to run + the exec process inside the container. Format is one of: `"user"`, + `"user:group"`, `"uid"`, or `"uid:gid"`. + +**Status codes**: + +- **201** – no error +- **404** – no such container +- **409** - container is paused +- **500** - server error + +#### Exec Start + +`POST /exec/(id)/start` + +Starts a previously set up `exec` instance `id`. If `detach` is true, this API +returns after starting the `exec` command. Otherwise, this API sets up an +interactive session with the `exec` command. + +**Example request**: + + POST /v1.23/exec/e90e34656806/start HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Detach": false, + "Tty": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {% raw %} + {{ STREAM }} + {% endraw %} + +**JSON parameters**: + +- **Detach** - Detach from the `exec` command. +- **Tty** - Boolean value to allocate a pseudo-TTY. + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **409** - container is paused + +**Stream details**: + +Similar to the stream behavior of `POST /containers/(id or name)/attach` API + +#### Exec Resize + +`POST /exec/(id)/resize` + +Resizes the `tty` session used by the `exec` command `id`. The unit is number of characters. +This API is valid only if `tty` was specified as part of creating and starting the `exec` command. + +**Example request**: + + POST /v1.23/exec/e90e34656806/resize?h=40&w=80 HTTP/1.1 + Content-Type: text/plain + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: text/plain + +**Query parameters**: + +- **h** – height of `tty` session +- **w** – width + +**Status codes**: + +- **201** – no error +- **404** – no such exec instance + +#### Exec Inspect + +`GET /exec/(id)/json` + +Return low-level information about the `exec` command `id`. + +**Example request**: + + GET /v1.23/exec/11fb006128e8ceb3942e7c58d77750f24210e35f879dd204ac975c184b820b39/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "CanRemove": false, + "ContainerID": "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126", + "DetachKeys": "", + "ExitCode": 2, + "ID": "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b", + "OpenStderr": true, + "OpenStdin": true, + "OpenStdout": true, + "ProcessConfig": { + "arguments": [ + "-c", + "exit 2" + ], + "entrypoint": "sh", + "privileged": false, + "tty": true, + "user": "1000" + }, + "Running": false + } + +**Status codes**: + +- **200** – no error +- **404** – no such exec instance +- **500** - server error + +### 2.4 Volumes + +#### List volumes + +`GET /volumes` + +**Example request**: + + GET /v1.23/volumes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Volumes": [ + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis" + } + ], + "Warnings": [] + } + +**Query parameters**: + +- **filters** - JSON encoded value of the filters (a `map[string][]string`) to process on the volumes list. There is one available filter: `dangling=true` + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Create a volume + +`POST /volumes/create` + +Create a volume + +**Example request**: + + POST /v1.23/volumes/create HTTP/1.1 + Content-Type: application/json + Content-Length: 12345 + + { + "Name": "tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + +**Status codes**: + +- **201** - no error +- **500** - server error + +**JSON parameters**: + +- **Name** - The new volume's name. If not specified, Docker generates a name. +- **Driver** - Name of the volume driver to use. Defaults to `local` for the name. +- **DriverOpts** - A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. +- **Labels** - Labels to set on the volume, specified as a map: `{"key":"value","key2":"value2"}` + +#### Inspect a volume + +`GET /volumes/(name)` + +Return low-level information on the volume `name` + +**Example request**: + + GET /v1.23/volumes/tardis + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Name": "tardis", + "Driver": "local", + "Mountpoint": "/var/lib/docker/volumes/tardis/_data", + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } + } + +**Status codes**: + +- **200** - no error +- **404** - no such volume +- **500** - server error + +#### Remove a volume + +`DELETE /volumes/(name)` + +Instruct the driver to remove the volume (`name`). + +**Example request**: + + DELETE /v1.23/volumes/tardis HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** - no error +- **404** - no such volume or volume driver +- **409** - volume is in use and cannot be removed +- **500** - server error + +### 3.5 Networks + +#### List networks + +`GET /networks` + +**Example request**: + + GET /v1.23/networks?filters={"type":{"custom":true}} HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +[ + { + "Name": "bridge", + "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "Internal": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.17.0.0/16" + } + ] + }, + "Containers": { + "39b69226f9d79f5634485fb236a23b2fe4e96a0a94128390a7fbbcc167065867": { + "EndpointID": "ed2419a97c1d9954d05b46e462e7002ea552f216e9b136b80a7db8d98b442eda", + "MacAddress": "02:42:ac:11:00:02", + "IPv4Address": "172.17.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + } + }, + { + "Name": "none", + "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794", + "Scope": "local", + "Driver": "null", + "EnableIPv6": false, + "Internal": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + }, + { + "Name": "host", + "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e", + "Scope": "local", + "Driver": "host", + "EnableIPv6": false, + "Internal": false, + "IPAM": { + "Driver": "default", + "Config": [] + }, + "Containers": {}, + "Options": {} + } +] +``` + +**Query parameters**: + +- **filters** - JSON encoded network list filter. The filter value is one of: + - `id=<network-id>` Matches all or part of a network id. + - `name=<network-name>` Matches all or part of a network name. + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + +**Status codes**: + +- **200** - no error +- **500** - server error + +#### Inspect network + +`GET /networks/(id or name)` + +Return low-level information on the network `id` + +**Example request**: + + GET /v1.23/networks/7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99 HTTP/1.1 + +**Example response**: + +``` +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "Name": "net01", + "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", + "Scope": "local", + "Driver": "bridge", + "EnableIPv6": false, + "IPAM": { + "Driver": "default", + "Config": [ + { + "Subnet": "172.19.0.0/16", + "Gateway": "172.19.0.1/16" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal": false, + "Containers": { + "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": { + "Name": "test", + "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a", + "MacAddress": "02:42:ac:13:00:02", + "IPv4Address": "172.19.0.2/16", + "IPv6Address": "" + } + }, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } +} +``` + +**Status codes**: + +- **200** - no error +- **404** - network not found +- **500** - server error + +#### Create a network + +`POST /networks/create` + +Create a network + +**Example request**: + +``` +POST /v1.23/networks/create HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Name":"isolated_nw", + "CheckDuplicate":true, + "Driver":"bridge", + "EnableIPv6": true, + "IPAM":{ + "Driver": "default", + "Config":[ + { + "Subnet":"172.20.0.0/16", + "IPRange":"172.20.10.0/24", + "Gateway":"172.20.10.11" + }, + { + "Subnet":"2001:db8:abcd::/64", + "Gateway":"2001:db8:abcd::1011" + } + ], + "Options": { + "foo": "bar" + } + }, + "Internal":true, + "Options": { + "com.docker.network.bridge.default_bridge": "true", + "com.docker.network.bridge.enable_icc": "true", + "com.docker.network.bridge.enable_ip_masquerade": "true", + "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", + "com.docker.network.bridge.name": "docker0", + "com.docker.network.driver.mtu": "1500" + }, + "Labels": { + "com.example.some-label": "some-value", + "com.example.some-other-label": "some-other-value" + } +} +``` + +**Example response**: + +``` +HTTP/1.1 201 Created +Content-Type: application/json + +{ + "Id": "22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30", + "Warning": "" +} +``` + +**Status codes**: + +- **201** - no error +- **404** - plugin not found +- **500** - server error + +**JSON parameters**: + +- **Name** - The new network's name. this is a mandatory field +- **CheckDuplicate** - Requests daemon to check for networks with same name. Defaults to `false`. + Since Network is primarily keyed based on a random ID and not on the name, + and network name is strictly a user-friendly alias to the network + which is uniquely identified using ID, there is no guaranteed way to check for duplicates. + This parameter CheckDuplicate is there to provide a best effort checking of any networks + which has the same name but it is not guaranteed to catch all name collisions. +- **Driver** - Name of the network driver plugin to use. Defaults to `bridge` driver +- **Internal** - Restrict external access to the network +- **IPAM** - Optional custom IP scheme for the network + - **Driver** - Name of the IPAM driver to use. Defaults to `default` driver + - **Config** - List of IPAM configuration options, specified as a map: + `{"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}` + - **Options** - Driver-specific options, specified as a map: `{"option":"value" [,"option2":"value2"]}` +- **EnableIPv6** - Enable IPv6 on the network +- **Options** - Network specific options to be used by the drivers +- **Labels** - Labels to set on the network, specified as a map: `{"key":"value" [,"key2":"value2"]}` + +#### Connect a container to a network + +`POST /networks/(id or name)/connect` + +Connect a container to a network + +**Example request**: + +``` +POST /v1.23/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/connect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4", + "EndpointConfig": { + "IPAMConfig": { + "IPv4Address":"172.24.56.89", + "IPv6Address":"2001:db8::5689" + } + } +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container is not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **container** - container-id/name to be connected to the network + +#### Disconnect a container from a network + +`POST /networks/(id or name)/disconnect` + +Disconnect a container from a network + +**Example request**: + +``` +POST /v1.23/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30/disconnect HTTP/1.1 +Content-Type: application/json +Content-Length: 12345 + +{ + "Container":"3613f73ba0e4", + "Force":false +} +``` + +**Example response**: + + HTTP/1.1 200 OK + +**Status codes**: + +- **200** - no error +- **404** - network or container not found +- **500** - Internal Server Error + +**JSON parameters**: + +- **Container** - container-id/name to be disconnected from a network +- **Force** - Force the container to disconnect from a network + +#### Remove a network + +`DELETE /networks/(id or name)` + +Instruct the driver to remove the network (`id`). + +**Example request**: + + DELETE /v1.23/networks/22be93d5babb089c5aab8dbc369042fad48ff791584ca2da2100db837a1c7c30 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +**Status codes**: + +- **204** - no error +- **403** - operation not supported for pre-defined networks +- **404** - no such network +- **500** - server error + +## 3. Going further + +### 3.1 Inside `docker run` + +As an example, the `docker run` command line makes the following API calls: + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it. + - Then, retry to create the container. + +- Start the container. + +- If you are not in detached mode: +- Attach to the container, using `logs=1` (to have `stdout` and + `stderr` from the container's start) and `stream=1` + +- If in detached mode or only `stdin` is attached, display the container's id. + +### 3.2 Hijacking + +In this version of the API, `/attach`, uses hijacking to transport `stdin`, +`stdout`, and `stderr` on the same socket. + +To hint potential proxies about connection hijacking, Docker client sends +connection upgrade headers similarly to websocket. + + Upgrade: tcp + Connection: Upgrade + +When Docker daemon detects the `Upgrade` header, it switches its status code +from **200 OK** to **101 UPGRADED** and resends the same headers. + + +### 3.3 CORS Requests + +To set cross origin requests to the Engine API please give values to +`--api-cors-header` when running Docker in daemon mode. Set * (asterisk) allows all, +default or blank means CORS disabled + + $ dockerd -H="192.168.1.9:2375" --api-cors-header="http://foo.bar" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.24.md b/_vendor/github.com/moby/moby/api/docs/v1.24.md similarity index 99% rename from _vendor/github.com/moby/moby/docs/api/v1.24.md rename to _vendor/github.com/moby/moby/api/docs/v1.24.md index 45b4b3fdbb9e..2d374a4a8484 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.24.md +++ b/_vendor/github.com/moby/moby/api/docs/v1.24.md @@ -310,7 +310,6 @@ Create a container "Memory": 0, "MemorySwap": 0, "MemoryReservation": 0, - "KernelMemory": 0, "CpuPercent": 80, "CpuShares": 512, "CpuPeriod": 100000, @@ -438,7 +437,6 @@ Create a container - **MemorySwap** - Total memory limit (memory + swap); set `-1` to enable unlimited swap. You must use this with `memory` and make the swap value larger than `memory`. - **MemoryReservation** - Memory soft limit in bytes. - - **KernelMemory** - Kernel memory limit in bytes. - **CpuPercent** - An integer value containing the usable percentage of the available CPUs. (Windows daemon only) - **CpuShares** - An integer value containing the container's CPU Shares (ie. the relative weight vs other containers). @@ -627,7 +625,6 @@ Return low-level information on the container `id` "Memory": 0, "MemorySwap": 0, "MemoryReservation": 0, - "KernelMemory": 0, "OomKillDisable": false, "OomScoreAdj": 500, "NetworkMode": "bridge", @@ -1197,7 +1194,6 @@ Update configuration of one or more containers. "Memory": 314572800, "MemorySwap": 514288000, "MemoryReservation": 209715200, - "KernelMemory": 52428800, "RestartPolicy": { "MaximumRetryCount": 4, "Name": "on-failure" @@ -1830,8 +1826,7 @@ a base64-encoded AuthConfig object. ``` { "username": "jdoe", - "password": "secret", - "email": "jdoe@acme.com" + "password": "secret" } ``` @@ -2066,8 +2061,7 @@ The push is cancelled if the HTTP connection is closed. ``` { "username": "jdoe", - "password": "secret", - "email": "jdoe@acme.com", + "password": "secret" } ``` @@ -2498,8 +2492,6 @@ Docker daemon report the following event: Transfer-Encoding: chunked { - "status": "pull", - "id": "alpine:latest", "Type": "image", "Action": "pull", "Actor": { @@ -2512,9 +2504,6 @@ Docker daemon report the following event: "timeNano": 1461943101301854122 } { - "status": "create", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "create", "Actor": { @@ -2529,9 +2518,6 @@ Docker daemon report the following event: "timeNano": 1461943101381709551 } { - "status": "attach", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "attach", "Actor": { @@ -2560,9 +2546,6 @@ Docker daemon report the following event: "timeNano": 1461943101394865557 } { - "status": "start", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "start", "Actor": { @@ -2577,9 +2560,6 @@ Docker daemon report the following event: "timeNano": 1461943101607533796 } { - "status": "resize", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "resize", "Actor": { @@ -2596,9 +2576,6 @@ Docker daemon report the following event: "timeNano": 1461943101610269268 } { - "status": "die", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "die", "Actor": { @@ -2628,9 +2605,6 @@ Docker daemon report the following event: "timeNano": 1461943105230860245 } { - "status": "destroy", - "id": "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743", - "from": "alpine", "Type": "container", "Action": "destroy", "Actor": { diff --git a/_vendor/github.com/moby/moby/docs/api/v1.25.yaml b/_vendor/github.com/moby/moby/api/docs/v1.25.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.25.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.25.yaml index 8a57a98d8729..aa9d190b4fb8 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.25.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.25.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -130,6 +129,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -156,6 +183,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -167,13 +208,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -257,19 +295,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -320,7 +359,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -432,10 +474,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -984,6 +1022,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -1975,6 +2017,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Networks: type: "array" items: @@ -2712,7 +2755,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -3012,7 +3054,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -3693,7 +3734,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -4602,24 +4642,7 @@ paths: schema: type: "array" items: - type: "object" - properties: - Id: - type: "string" - Created: - type: "integer" - format: "int64" - CreatedBy: - type: "string" - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - Comment: - type: "string" + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -4712,7 +4735,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -5100,7 +5128,6 @@ paths: IndexServerAddress: "https://index.docker.io/v1/" InitPath: "/usr/bin/docker" InitSha1: "" - KernelMemory: true KernelVersion: "3.12.0-1-amd64" Labels: - "storage=ssd" @@ -6946,17 +6973,32 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.26.yaml b/_vendor/github.com/moby/moby/api/docs/v1.26.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.26.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.26.yaml index 8de146c0733b..63b88964180c 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.26.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.26.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -130,6 +129,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -156,6 +183,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -167,13 +208,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -257,19 +295,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -320,7 +359,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -432,10 +474,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -984,6 +1022,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -1979,6 +2021,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Networks: type: "array" items: @@ -2716,7 +2759,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4610,24 +4652,7 @@ paths: schema: type: "array" items: - type: "object" - properties: - Id: - type: "string" - Created: - type: "integer" - format: "int64" - CreatedBy: - type: "string" - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - Comment: - type: "string" + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -4720,7 +4745,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -7017,17 +7047,32 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.27.yaml b/_vendor/github.com/moby/moby/api/docs/v1.27.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.27.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.27.yaml index 3e4c1167cf5e..c8e021a33a5d 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.27.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.27.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,13 +210,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -259,19 +297,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -322,7 +361,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -434,10 +476,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -504,7 +542,9 @@ definitions: format: "int64" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -515,6 +555,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -989,6 +1035,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2051,6 +2101,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Networks: type: "array" items: @@ -2775,7 +2826,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -3075,7 +3125,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -4680,24 +4729,7 @@ paths: schema: type: "array" items: - type: "object" - properties: - Id: - type: "string" - Created: - type: "integer" - format: "int64" - CreatedBy: - type: "string" - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - Comment: - type: "string" + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -4790,7 +4822,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -7115,17 +7152,32 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.28.yaml b/_vendor/github.com/moby/moby/api/docs/v1.28.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.28.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.28.yaml index 34ad0b839119..2f70a312cf2b 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.28.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.28.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,13 +210,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -259,19 +297,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -322,7 +361,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -440,10 +482,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -510,7 +548,9 @@ definitions: format: "int64" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -521,6 +561,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1027,6 +1073,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2104,6 +2154,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Networks: type: "array" items: @@ -2864,7 +2915,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -3164,7 +3214,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -3855,7 +3904,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -4781,31 +4829,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -4898,7 +4922,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -5287,7 +5316,6 @@ paths: IndexServerAddress: "https://index.docker.io/v1/" InitPath: "/usr/bin/docker" InitSha1: "" - KernelMemory: true KernelVersion: "3.12.0-1-amd64" Labels: - "storage=ssd" @@ -7265,17 +7293,32 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.29.yaml b/_vendor/github.com/moby/moby/api/docs/v1.29.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.29.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.29.yaml index 0895a92ed223..61d3d41d2ef9 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.29.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.29.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,13 +210,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -259,19 +297,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -325,7 +364,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -443,10 +485,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -513,7 +551,9 @@ definitions: format: "int64" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -524,6 +564,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1033,6 +1079,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2125,6 +2175,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Networks: type: "array" items: @@ -2897,7 +2948,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -3197,7 +3247,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -3888,7 +3937,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -4814,31 +4862,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -4931,7 +4955,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -5320,7 +5349,6 @@ paths: IndexServerAddress: "https://index.docker.io/v1/" InitPath: "/usr/bin/docker" InitSha1: "" - KernelMemory: true KernelVersion: "3.12.0-1-amd64" Labels: - "storage=ssd" @@ -7306,17 +7334,32 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.3.md b/_vendor/github.com/moby/moby/api/docs/v1.3.md new file mode 100644 index 000000000000..1e2b4b3ce4d3 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.3.md @@ -0,0 +1,1110 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.3" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.3 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "PID":"11935", + "Tty":"pts/2", + "Time":"00:00:00", + "Cmd":"sh" + }, + { + "PID":"12140", + "Tty":"pts/2", + "Time":"00:00:00", + "Cmd":"sleep" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/(id)/start HTTP/1.1 + Content-Type: application/json + + { + "Binds":["/tmp:/tmp"] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + + > **Example request**: + > + > POST /images/test/push HTTP/1.1 + > {{ authConfig }} + > + > **Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + The archive must include a file called Dockerfile at its root. I + may include any number of other files, which will be accessible in + the build context (See the ADD build command). + + The Content-type header should be set to "application/tar". + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":"hannibal", + "password:"xxxx", + "email":"hannibal@a-team.com" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "EventsListeners":"0", + "LXCVersion":"0.7.5", + "KernelVersion":"3.8.0-19-generic" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"create","id":"dfdf82bd3881","time":1374067924} + {"status":"start","id":"dfdf82bd3881","time":1374067924} + {"status":"stop","id":"dfdf82bd3881","time":1374067966} + {"status":"destroy","id":"dfdf82bd3881","time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + +> docker -d -H="192.168.1.9:2375" -api-enable-cors diff --git a/_vendor/github.com/moby/moby/docs/api/v1.30.yaml b/_vendor/github.com/moby/moby/api/docs/v1.30.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.30.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.30.yaml index 8ab1764f047c..5c748faae49f 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.30.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.30.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,13 +210,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -259,20 +297,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -326,7 +364,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -445,10 +486,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -515,7 +552,9 @@ definitions: format: "int64" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -526,6 +565,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1043,6 +1088,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2303,6 +2352,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3110,7 +3160,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -5056,31 +5105,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -5173,7 +5198,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -7558,10 +7588,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -7575,11 +7616,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.31.yaml b/_vendor/github.com/moby/moby/api/docs/v1.31.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.31.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.31.yaml index 9a5efd28de16..aa164fa7a23f 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.31.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.31.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,20 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,13 +210,10 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -259,20 +297,20 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -326,7 +364,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: description: | @@ -445,10 +486,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -515,7 +552,9 @@ definitions: format: "int64" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -526,6 +565,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1049,6 +1094,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2332,6 +2381,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -2857,11 +2907,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -2902,8 +2952,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Config: @@ -3183,7 +3233,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -5150,31 +5199,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -5267,7 +5292,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -7659,10 +7689,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -7676,11 +7717,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.32.yaml b/_vendor/github.com/moby/moby/api/docs/v1.32.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.32.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.32.yaml index 99823282e567..c3d0dc38bd49 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.32.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.32.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -132,6 +131,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -158,6 +185,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -169,15 +212,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -261,20 +300,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -328,7 +370,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -449,10 +494,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -566,7 +607,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -577,6 +620,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1308,6 +1357,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2783,6 +2836,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3329,11 +3383,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3375,8 +3429,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" @@ -3518,10 +3572,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." type: "boolean" @@ -3621,10 +3671,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -4395,7 +4448,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4703,7 +4755,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -5392,7 +5443,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -6361,31 +6411,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6478,7 +6504,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8617,10 +8648,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8634,11 +8676,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.33.yaml b/_vendor/github.com/moby/moby/api/docs/v1.33.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.33.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.33.yaml index 4d49c4156bd4..7e923474a2e7 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.33.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.33.yaml @@ -60,7 +60,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -136,6 +135,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -162,6 +189,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -173,15 +216,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -265,20 +304,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -332,7 +374,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -453,10 +498,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -570,7 +611,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -581,6 +624,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1312,6 +1361,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2787,6 +2840,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3333,11 +3387,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3379,8 +3433,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" @@ -3522,10 +3576,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." type: "boolean" @@ -3625,10 +3675,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -4399,7 +4452,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4707,7 +4759,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -5396,7 +5447,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -6365,31 +6415,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6482,7 +6508,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8625,10 +8656,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8642,11 +8684,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.34.yaml b/_vendor/github.com/moby/moby/api/docs/v1.34.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.34.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.34.yaml index 2d0d987fb2ba..bebaf385f840 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.34.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.34.yaml @@ -62,7 +62,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -138,6 +137,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -164,6 +191,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -175,15 +218,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -267,20 +306,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -334,7 +376,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -455,10 +500,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -572,7 +613,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -583,6 +626,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1322,6 +1371,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2797,6 +2850,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3361,11 +3415,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3407,8 +3461,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" @@ -3550,10 +3604,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." type: "boolean" @@ -3653,10 +3703,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -4427,7 +4480,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4735,7 +4787,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -5424,7 +5475,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -6405,31 +6455,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6522,7 +6548,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8665,10 +8696,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8682,11 +8724,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.35.yaml b/_vendor/github.com/moby/moby/api/docs/v1.35.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.35.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.35.yaml index e7de26d46d72..513a55ba23e0 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.35.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.35.yaml @@ -71,7 +71,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -147,6 +146,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -173,6 +200,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -184,15 +227,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -276,20 +315,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -344,7 +386,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -466,10 +511,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -583,7 +624,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -594,6 +637,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1319,6 +1368,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2801,6 +2854,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3365,11 +3419,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3411,8 +3465,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" @@ -3554,10 +3608,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." type: "boolean" @@ -3657,10 +3707,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -4431,7 +4484,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4739,7 +4791,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -5433,7 +5484,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -6414,31 +6464,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6531,7 +6557,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8699,10 +8730,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8716,11 +8758,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.36.yaml b/_vendor/github.com/moby/moby/api/docs/v1.36.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.36.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.36.yaml index d39839373f83..770489951c99 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.36.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.36.yaml @@ -71,7 +71,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -147,6 +146,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -173,6 +200,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -184,15 +227,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -276,20 +315,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -344,7 +386,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -583,7 +628,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -594,6 +641,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1319,6 +1372,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2814,6 +2871,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3378,11 +3436,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3424,8 +3482,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" @@ -3670,10 +3728,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6440,33 +6501,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6559,7 +6594,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8743,10 +8783,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8760,11 +8811,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.37.yaml b/_vendor/github.com/moby/moby/api/docs/v1.37.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.37.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.37.yaml index 014086b9d55a..93b268916dc7 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.37.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.37.yaml @@ -71,7 +71,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -147,6 +146,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -173,6 +200,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -184,15 +227,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -276,20 +315,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -344,7 +386,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -587,7 +632,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -598,6 +645,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1322,6 +1375,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2817,6 +2874,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3384,11 +3442,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3437,8 +3495,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -3690,10 +3748,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6483,33 +6544,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6602,7 +6637,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8786,10 +8826,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8803,11 +8854,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.38.yaml b/_vendor/github.com/moby/moby/api/docs/v1.38.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.38.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.38.yaml index 23555a87ac48..3cbf7cda747d 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.38.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.38.yaml @@ -71,7 +71,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -147,6 +146,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -174,6 +201,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -185,15 +228,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -277,20 +316,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -345,7 +387,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -467,10 +512,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -588,7 +629,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -599,6 +642,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -1333,6 +1382,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2871,6 +2924,7 @@ definitions: ForceUpdate: description: "A counter that triggers an update even if no relevant parameters have been changed." type: "integer" + format: "uint64" Runtime: description: "Runtime is the type of runtime specified for the task executor." type: "string" @@ -3438,11 +3492,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -3491,8 +3545,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -3641,10 +3695,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: "Indicates if CPU CFS(Completely Fair Scheduler) period is supported by the host." type: "boolean" @@ -3744,10 +3794,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -4518,7 +4571,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -4836,7 +4888,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -5543,7 +5594,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -6554,33 +6604,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -6673,7 +6697,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -8857,10 +8886,21 @@ paths: type: "object" properties: ListenAddr: - description: "Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)." + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: - description: "Externally reachable address advertised to other nodes. This can either be an address/port combination in the form `192.168.1.1:4567`, or an interface followed by a port number, like `eth0:4567`. If the port number is omitted, the port number from the listen address is used. If `AdvertiseAddr` is not specified, it will be automatically detected when possible." + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. type: "string" DataPathAddr: description: | @@ -8874,11 +8914,15 @@ paths: type: "string" RemoteAddrs: - description: "Addresses of manager nodes already participating in the swarm." - type: "string" + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.39.yaml b/_vendor/github.com/moby/moby/api/docs/v1.39.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.39.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.39.yaml index 2c16eca88604..3e7504eac1b5 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.39.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.39.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,15 +254,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -303,20 +342,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -371,7 +413,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -530,11 +575,6 @@ definitions: description: "Disk limit (in bytes)." type: "integer" format: "int64" - KernelMemory: - description: "Kernel memory limit in bytes." - type: "integer" - format: "int64" - example: 209715200 MemoryReservation: description: "Memory soft limit in bytes." type: "integer" @@ -676,7 +716,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -687,6 +729,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -700,6 +748,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2109,6 +2161,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -3913,6 +3969,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -4499,11 +4556,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -4554,8 +4611,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -4744,7 +4801,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -4889,10 +4948,6 @@ definitions: description: "Indicates if the host has memory swap limit support enabled." type: "boolean" example: true - KernelMemory: - description: "Indicates if the host has kernel memory limit support enabled." - type: "boolean" - example: true CpuCfsPeriod: description: | Indicates if CPU CFS(Completely Fair Scheduler) period is supported by @@ -4999,10 +5054,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -5823,7 +5881,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 NanoCpus: 500000 CpuPercent: 80 CpuShares: 512 @@ -6097,7 +6154,6 @@ paths: Memory: 0 MemorySwap: 0 MemoryReservation: 0 - KernelMemory: 0 OomKillDisable: false OomScoreAdj: 500 NetworkMode: "bridge" @@ -6469,7 +6525,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -6835,7 +6892,6 @@ paths: Memory: 314572800 MemorySwap: 514288000 MemoryReservation: 209715200 - KernelMemory: 52428800 RestartPolicy: MaximumRetryCount: 4 Name: "on-failure" @@ -7820,33 +7876,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -7945,7 +7975,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -10164,7 +10199,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -10198,6 +10235,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.4.md b/_vendor/github.com/moby/moby/api/docs/v1.4.md new file mode 100644 index 000000000000..6cedddf12e4f --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.4.md @@ -0,0 +1,1153 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.4" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.4 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports":"", + "SizeRw":12288, + "SizeRootFs":0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Privileged": false, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"", + "WorkingDir":"" + + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **409** – conflict between containers and images +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/(id)/start HTTP/1.1 + Content-Type: application/json + + { + "Binds":["/tmp:/tmp"], + "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict between containers and images +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + {{ authConfig }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} ... + +Status Codes: + +- **200** – no error :statuscode 404: no such image :statuscode + 500: server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + The archive must include a file called Dockerfile at its root. I + may include any number of other files, which will be accessible in + the build context (See the ADD build command). + + The Content-type header should be set to "application/tar". + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"create","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067924} + {"status":"start","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067924} + {"status":"stop","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067966} + {"status":"destroy","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/docs/api/v1.40.yaml b/_vendor/github.com/moby/moby/api/docs/v1.40.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.40.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.40.yaml index 27414904597d..1a1333be0100 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.40.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.40.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,15 +254,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -340,22 +379,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -414,7 +454,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -727,7 +770,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -738,6 +783,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -751,6 +802,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2169,6 +2224,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -4039,6 +4098,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -4623,11 +4683,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -4678,8 +4738,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -4868,7 +4928,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5135,10 +5197,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6775,7 +6840,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -7948,7 +8014,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8143,33 +8220,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8268,7 +8319,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -10478,7 +10534,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -10512,6 +10570,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.41.yaml b/_vendor/github.com/moby/moby/api/docs/v1.41.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.41.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.41.yaml index 0554b5a719ed..fa0467b02989 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.41.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.41.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,22 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,15 +254,11 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -340,22 +379,23 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must exist prior to creating the container. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -414,7 +454,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -754,7 +797,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -765,6 +810,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -778,6 +829,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2200,6 +2255,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -4204,6 +4263,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -4872,11 +4932,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -4927,8 +4987,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5117,7 +5177,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5370,10 +5432,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -7057,7 +7122,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8237,7 +8303,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8432,33 +8509,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8557,7 +8608,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -10777,7 +10833,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -10811,6 +10869,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.42.yaml b/_vendor/github.com/moby/moby/api/docs/v1.42.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.42.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.42.yaml index b31e84af5db0..03c12deeeaaa 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.42.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.42.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -422,7 +463,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -756,7 +800,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -767,6 +813,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -780,6 +832,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2203,6 +2259,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2616,14 +2676,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4223,6 +4275,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -4891,11 +4944,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -4946,8 +4999,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5156,7 +5209,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5400,10 +5455,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6333,8 +6391,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" paths: /containers/json: @@ -7276,7 +7337,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8487,7 +8549,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8697,33 +8770,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8822,7 +8869,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11155,7 +11207,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11189,6 +11243,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.43.yaml b/_vendor/github.com/moby/moby/api/docs/v1.43.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.43.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.43.yaml index a1cdea0ea5e4..9bf5e3483584 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.43.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.43.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -422,7 +463,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -756,7 +800,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -767,6 +813,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -780,6 +832,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2234,6 +2290,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2647,14 +2707,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4254,6 +4306,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -4922,11 +4975,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -4977,8 +5030,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5188,7 +5241,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5432,10 +5487,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6366,8 +6424,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" paths: /containers/json: @@ -7294,7 +7355,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8505,7 +8567,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8715,33 +8788,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8840,7 +8887,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11173,7 +11225,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11207,6 +11261,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.44.yaml b/_vendor/github.com/moby/moby/api/docs/v1.44.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.44.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.44.yaml index 8e4e6121e622..33b9d61ee6e4 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.44.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.44.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -432,7 +473,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -766,7 +810,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -777,6 +823,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -790,6 +842,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2086,14 +2142,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/GraphDriverData" RootFS: @@ -2225,14 +2273,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2261,6 +2301,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2674,14 +2718,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4322,6 +4358,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5037,11 +5074,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5092,8 +5129,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5303,7 +5340,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5547,10 +5586,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6521,8 +6563,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" paths: /containers/json: @@ -7450,7 +7495,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8662,7 +8708,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8872,33 +8929,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8997,7 +9028,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11339,7 +11375,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11373,6 +11411,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.45.yaml b/_vendor/github.com/moby/moby/api/docs/v1.45.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.45.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.45.yaml index 56d346fea4ce..a13bd56b625d 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.45.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.45.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -440,7 +481,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" RestartPolicy: @@ -774,7 +818,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -785,6 +831,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -798,6 +850,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -2072,14 +2128,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/GraphDriverData" RootFS: @@ -2211,14 +2259,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2247,6 +2287,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2660,14 +2704,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4308,6 +4344,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5023,11 +5060,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5078,8 +5115,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5289,7 +5326,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5533,10 +5572,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6507,8 +6549,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" paths: /containers/json: @@ -7436,7 +7481,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8648,7 +8694,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8858,33 +8915,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -8983,7 +9014,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11319,7 +11355,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11353,6 +11391,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.46.yaml b/_vendor/github.com/moby/moby/api/docs/v1.46.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.46.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.46.yaml index 8c4be6c3ce01..e5c24dccc6f6 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.46.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.46.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -440,7 +481,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" Options: description: | @@ -789,7 +833,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -800,6 +846,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -813,6 +865,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -1385,7 +1441,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" Domainname: @@ -1395,7 +1451,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" User: @@ -1409,7 +1465,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1420,7 +1476,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1431,7 +1487,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1458,7 +1514,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1469,7 +1525,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1480,7 +1536,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1517,7 +1573,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1556,7 +1612,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1568,7 +1624,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1602,7 +1658,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "integer" default: 10 x-nullable: true @@ -2099,14 +2155,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/GraphDriverData" RootFS: @@ -2239,14 +2287,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2275,6 +2315,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2706,14 +2750,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4361,6 +4397,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5082,11 +5119,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5137,8 +5174,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5348,7 +5385,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5592,10 +5631,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6618,8 +6660,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" paths: /containers/json: @@ -7557,7 +7602,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8769,7 +8815,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -8979,33 +9036,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -9117,7 +9148,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11438,7 +11474,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11472,6 +11510,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.47.yaml b/_vendor/github.com/moby/moby/api/docs/v1.47.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.47.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.47.yaml index 4eb222a05074..3e05a643b253 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.47.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.47.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,24 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,17 +256,12 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -342,24 +382,25 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "tmpfs" - - "npipe" - - "cluster" + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -440,7 +481,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" Options: description: | @@ -789,7 +833,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -800,6 +846,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -813,6 +865,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -1385,7 +1441,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" Domainname: @@ -1395,7 +1451,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" User: @@ -1409,7 +1465,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1420,7 +1476,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1431,7 +1487,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1458,7 +1514,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1469,7 +1525,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1480,7 +1536,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1517,7 +1573,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1556,7 +1612,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1568,7 +1624,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1602,7 +1658,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "integer" default: 10 x-nullable: true @@ -2099,14 +2155,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/DriverData" RootFS: @@ -2239,14 +2287,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2288,6 +2328,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2724,14 +2768,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -4379,6 +4415,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5100,11 +5137,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5155,8 +5192,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5366,7 +5403,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -5614,10 +5653,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -6640,8 +6682,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" ImageManifestSummary: x-go-name: "ManifestSummary" @@ -7693,7 +7738,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -8910,7 +8956,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -9120,33 +9177,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -9258,7 +9289,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -11588,7 +11624,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -11622,6 +11660,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.48.yaml b/_vendor/github.com/moby/moby/api/docs/v1.48.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.48.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.48.yaml index a2901377e5b5..2b645d45117b 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.48.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.48.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,26 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,19 +258,13 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `image` a docker image - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "image" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -344,26 +385,26 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `image` Mounts an image. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "image" - - "tmpfs" - - "npipe" - - "cluster" + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -452,7 +493,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" Options: description: | @@ -801,7 +845,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -812,6 +858,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -825,6 +877,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -1435,7 +1491,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" Domainname: @@ -1445,7 +1501,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" User: @@ -1459,7 +1515,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1470,7 +1526,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1481,7 +1537,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1508,7 +1564,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1519,7 +1575,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1530,7 +1586,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1567,7 +1623,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1606,7 +1662,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1618,7 +1674,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1652,7 +1708,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "integer" default: 10 x-nullable: true @@ -2176,14 +2232,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/DriverData" RootFS: @@ -2316,14 +2364,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2377,6 +2417,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2825,14 +2869,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -3039,7 +3075,8 @@ definitions: be used. If multiple endpoints have the same priority, endpoints are lexicographically sorted based on their network name, and the one that sorts first is picked. - type: "number" + type: "integer" + format: "int64" example: - 10 @@ -4517,6 +4554,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5508,11 +5546,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5563,8 +5601,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5988,7 +6026,7 @@ definitions: type: "integer" format: "uint64" x-nullable: true - example: 18446744073709551615 + example: "18446744073709551615" ContainerThrottlingData: description: | @@ -6046,7 +6084,11 @@ definitions: example: 0 stats: description: | - All the stats exported via memory.stat. when using cgroups v2. + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. This field is Linux-specific and omitted for Windows containers. type: "object" @@ -6386,7 +6428,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -6546,7 +6590,7 @@ definitions: > **Deprecated**: netfilter module is now loaded on-demand and no longer > during daemon startup, making this field obsolete. This field is always - > `false` and will be removed in a API v1.49. + > `false` and will be removed in a API v1.50. type: "boolean" example: false BridgeNfIp6tables: @@ -6557,7 +6601,7 @@ definitions: > **Deprecated**: netfilter module is now loaded on-demand, and no longer > during daemon startup, making this field obsolete. This field is always - > `false` and will be removed in a API v1.49. + > `false` and will be removed in a API v1.50. type: "boolean" example: false Debug: @@ -6645,10 +6689,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -7698,8 +7745,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" ImageManifestSummary: x-go-name: "ManifestSummary" @@ -8336,7 +8386,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -9454,7 +9505,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -9492,7 +9554,7 @@ paths: Amount of disk space in bytes to keep for cache > **Deprecated**: This parameter is deprecated and has been renamed to "reserved-space". - > It is kept for backward compatibility and will be removed in API v1.49. + > It is kept for backward compatibility and will be removed in API v1.52. type: "integer" format: "int64" - name: "reserved-space" @@ -9695,33 +9757,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -9847,7 +9883,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -12206,7 +12247,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -12240,6 +12283,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/docs/api/v1.49.yaml b/_vendor/github.com/moby/moby/api/docs/v1.49.yaml similarity index 98% rename from _vendor/github.com/moby/moby/docs/api/v1.49.yaml rename to _vendor/github.com/moby/moby/api/docs/v1.49.yaml index 1183aaf2b59d..f9bc354274fe 100644 --- a/_vendor/github.com/moby/moby/docs/api/v1.49.yaml +++ b/_vendor/github.com/moby/moby/api/docs/v1.49.yaml @@ -81,7 +81,6 @@ info: { "username": "string", "password": "string", - "email": "string", "serveraddress": "string" } ``` @@ -173,6 +172,34 @@ tags: x-displayName: "System" definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false Port: type: "object" description: "An open port on a container" @@ -200,6 +227,26 @@ definitions: PublicPort: 80 Type: "tcp" + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + MountPoint: type: "object" description: | @@ -211,19 +258,13 @@ definitions: The mount type: - `bind` a mount of a file or directory from the host into the container. - - `volume` a docker volume with the given `Name`. - - `image` a docker image - - `tmpfs` a `tmpfs`. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. - `npipe` a named pipe from the host into the container. - - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "image" - - "tmpfs" - - "npipe" - - "cluster" + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" example: "volume" Name: description: | @@ -344,26 +385,26 @@ definitions: description: "Container path." type: "string" Source: - description: "Mount source (e.g. a volume name, a host path)." + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. type: "string" Type: description: | The mount type. Available types: - - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - - `image` Mounts an image. - - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. - `cluster` a Swarm cluster volume - type: "string" - enum: - - "bind" - - "volume" - - "image" - - "tmpfs" - - "npipe" - - "cluster" + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" ReadOnly: description: "Whether the mount should be read-only." type: "boolean" @@ -452,7 +493,10 @@ definitions: type: "integer" format: "int64" Mode: - description: "The permission mode for the tmpfs mount in an integer." + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). type: "integer" Options: description: | @@ -801,7 +845,9 @@ definitions: Value: "UUID2" HealthConfig: - description: "A test to perform to check that the container is healthy." + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. type: "object" properties: Test: @@ -812,6 +858,12 @@ definitions: - `["NONE"]` disable healthcheck - `["CMD", args...]` exec arguments directly - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe type: "array" items: type: "string" @@ -825,6 +877,10 @@ definitions: description: | The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. type: "integer" format: "int64" Retries: @@ -1435,7 +1491,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" Domainname: @@ -1445,7 +1501,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" example: "" User: @@ -1459,7 +1515,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1470,7 +1526,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1481,7 +1537,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1508,7 +1564,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1519,7 +1575,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1530,7 +1586,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always false. It must not be used, and will be removed in API v1.48. + > always false. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1567,7 +1623,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always empty. It must not be used, and will be removed in API v1.48. + > always empty. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1606,7 +1662,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "boolean" default: false example: false @@ -1618,7 +1674,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "string" default: "" example: "" @@ -1652,7 +1708,7 @@ definitions: <p><br /></p> > **Deprecated**: this field is not part of the image specification and is - > always omitted. It must not be used, and will be removed in API v1.48. + > always omitted. It must not be used, and will be removed in API v1.50. type: "integer" default: 10 x-nullable: true @@ -2176,14 +2232,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: | - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 1239828 GraphDriver: $ref: "#/definitions/DriverData" RootFS: @@ -2316,14 +2364,6 @@ definitions: format: "int64" x-nullable: false example: 1239828 - VirtualSize: - description: |- - Total size of the image including all layers it is composed of. - - Deprecated: this field is omitted in API v1.44, but kept for backward compatibility. Use Size instead. - type: "integer" - format: "int64" - example: 172064416 Labels: description: "User-defined key/value metadata." type: "object" @@ -2377,6 +2417,10 @@ definitions: password: type: "string" email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. type: "string" serveraddress: type: "string" @@ -2825,14 +2869,6 @@ definitions: description: | Unique ID of the build cache record. example: "ndlpt0hhvkqcdfkputsk4cq9c" - Parent: - description: | - ID of the parent build cache record. - - > **Deprecated**: This field is deprecated, and omitted if empty. - type: "string" - x-nullable: true - example: "" Parents: description: | List of parent build cache record IDs. @@ -3039,7 +3075,8 @@ definitions: be used. If multiple endpoints have the same priority, endpoints are lexicographically sorted based on their network name, and the one that sorts first is picked. - type: "number" + type: "integer" + format: "int64" example: - 10 @@ -4517,6 +4554,7 @@ definitions: A counter that triggers an update even if no relevant parameters have been changed. type: "integer" + format: "uint64" Runtime: description: | Runtime is the type of runtime specified for the task executor. @@ -5508,11 +5546,11 @@ definitions: com.example.some-other-label: "some-other-value" Data: description: | - Data is the data to store as a secret, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, - as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/api/validation#MaxSecretSize). + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). This field is only used to _create_ a secret, and is not returned by other endpoints. @@ -5563,8 +5601,8 @@ definitions: type: "string" Data: description: | - Data is the data to store as a config, formatted as a Base64-url-safe-encoded - ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-5)) string. + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). type: "string" Templating: @@ -5988,7 +6026,7 @@ definitions: type: "integer" format: "uint64" x-nullable: true - example: 18446744073709551615 + example: "18446744073709551615" ContainerThrottlingData: description: | @@ -6046,7 +6084,11 @@ definitions: example: 0 stats: description: | - All the stats exported via memory.stat. when using cgroups v2. + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. This field is Linux-specific and omitted for Windows containers. type: "object" @@ -6386,7 +6428,9 @@ definitions: example: "linux" Arch: description: | - The architecture that the daemon is running on + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). type: "string" example: "amd64" KernelVersion: @@ -6546,7 +6590,7 @@ definitions: > **Deprecated**: netfilter module is now loaded on-demand and no longer > during daemon startup, making this field obsolete. This field is always - > `false` and will be removed in a API v1.49. + > `false` and will be removed in a API v1.50. type: "boolean" example: false BridgeNfIp6tables: @@ -6557,7 +6601,7 @@ definitions: > **Deprecated**: netfilter module is now loaded on-demand, and no longer > during daemon startup, making this field obsolete. This field is always - > `false` and will be removed in a API v1.49. + > `false` and will be removed in a API v1.50. type: "boolean" example: false Debug: @@ -6645,10 +6689,13 @@ definitions: example: "linux" Architecture: description: | - Hardware architecture of the host, as returned by the Go runtime - (`GOARCH`). + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. - A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). type: "string" example: "x86_64" NCPU: @@ -7698,8 +7745,11 @@ definitions: details, see documentation for the Topology object in the CSI specification. type: "object" - additionalProperties: - type: "string" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" ImageManifestSummary: x-go-name: "ManifestSummary" @@ -8336,7 +8386,8 @@ paths: To calculate the values shown by the `stats` command of the docker cli tool the following formulas can be used: - * used_memory = `memory_stats.usage - memory_stats.stats.cache` + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) * available_memory = `memory_stats.limit` * Memory usage % = `(used_memory / available_memory) * 100.0` * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` @@ -9454,7 +9505,18 @@ paths: default: "" - name: "outputs" in: "query" - description: "BuildKit output configuration" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` type: "string" default: "" - name: "version" @@ -9492,7 +9554,7 @@ paths: Amount of disk space in bytes to keep for cache > **Deprecated**: This parameter is deprecated and has been renamed to "reserved-space". - > It is kept for backward compatibility and will be removed in API v1.49. + > It is kept for backward compatibility and will be removed in API v1.52. type: "integer" format: "int64" - name: "reserved-space" @@ -9678,10 +9740,31 @@ paths: required: true - name: "manifests" in: "query" - description: "Include Manifests in the image summary." + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. type: "boolean" default: false required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` tags: ["Image"] /images/{name}/history: get: @@ -9695,33 +9778,7 @@ paths: schema: type: "array" items: - type: "object" - x-go-name: HistoryResponseItem - title: "HistoryResponseItem" - description: "individual image layer information in response to ImageHistory operation" - required: [Id, Created, CreatedBy, Tags, Size, Comment] - properties: - Id: - type: "string" - x-nullable: false - Created: - type: "integer" - format: "int64" - x-nullable: false - CreatedBy: - type: "string" - x-nullable: false - Tags: - type: "array" - items: - type: "string" - Size: - type: "integer" - format: "int64" - x-nullable: false - Comment: - type: "string" - x-nullable: false + $ref: "#/definitions/ImageHistoryResponseItem" examples: application/json: - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" @@ -9847,7 +9904,12 @@ paths: /images/{name}/tag: post: summary: "Tag an image" - description: "Tag an image so that it becomes part of a repository." + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. operationId: "ImageTag" responses: 201: @@ -12206,7 +12268,9 @@ paths: description: | Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking - interface used for the VXLAN Tunnel Endpoint (VTEP). + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. type: "string" AdvertiseAddr: description: | @@ -12240,6 +12304,7 @@ paths: JoinToken: description: "Secret token for joining this swarm." type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] example: ListenAddr: "0.0.0.0:2377" AdvertiseAddr: "192.168.1.1:2377" diff --git a/_vendor/github.com/moby/moby/api/docs/v1.5.md b/_vendor/github.com/moby/moby/api/docs/v1.5.md new file mode 100644 index 000000000000..76c6142c1cb3 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.5.md @@ -0,0 +1,1159 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.5" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.5 + +# 1. Brief introduction + +- The Remote API is replacing rcli +- Default port in the docker daemon is 2375 +- The API tends to be REST, but for some complex commands, like attach + or pull, the HTTP connection is hijacked to transport stdout stdin + and stderr + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "ubuntu:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":[{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "9cd87474be90", + "Image": "ubuntu:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "3176a2479c92", + "Image": "centos:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "fedora:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Privileged": false, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"ubuntu", + "Volumes":{}, + "VolumesFrom":"", + "WorkingDir":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "ubuntu", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir":"" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles":[ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes":[ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path":"/dev", + "Kind":0 + }, + { + "Path":"/dev/kmsg", + "Kind":1 + }, + { + "Path":"/test", + "Kind":1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + POST /containers/(id)/start HTTP/1.1 + Content-Type: application/json + + { + "Binds":["/tmp:/tmp"], + "LxcConf":[{"Key":"lxc.utsname","Value":"docker"}] + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource":"test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"ubuntu", + "Tag":"precise", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + }, + { + "Repository":"ubuntu", + "Tag":"12.04", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nubuntu",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\ncentos",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\nfedora",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=ubuntu HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/centos/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"centos", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/fedora/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id":"b750fe79269d", + "Created":1364102658, + "CreatedBy":"/bin/bash" + }, + { + "Id":"27cf78414709", + "Created":1364068391, + "CreatedBy":"" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + + The `X-Registry-Auth` header can be used to + include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged":"3e2f21a89f"}, + {"Deleted":"3e2f21a89f"}, + {"Deleted":"53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + The archive must include a file called Dockerfile at its root. I + may include any number of other files, which will be accessible in + the build context (See the ADD build command). + + The Content-type header should be set to "application/tar". + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** – remove intermediate containers after a successful build + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":"hannibal", + "password:"xxxx", + "email":"hannibal@a-team.com", + "serveraddress":"https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "PortSpecs":["22"] + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"create","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067924} + {"status":"start","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067924} + {"status":"stop","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067966} + {"status":"destroy","id":"dfdf82bd3881","from":"ubuntu:latest","time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run`: + + - Create the container + - If the status code is 404, it means the image doesn't exist: + Try to pull it - Then retry to create the container + - Start the container + - If you are not in detached mode: + Attach to the container, using logs=1 (to have stdout and stderr + from the container's start) and stream=1 + - If in detached mode or only stdin is attached: + Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.50.yaml b/_vendor/github.com/moby/moby/api/docs/v1.50.yaml new file mode 100644 index 000000000000..062e1cd57b91 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.50.yaml @@ -0,0 +1,13442 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.50" +info: + title: "Docker Engine API" + version: "1.50" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.50/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + Port: + type: "object" + description: "An open port on a container" + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + KernelMemoryTCP: + description: | + Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + type: "integer" + format: "int64" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + MacAddress: + description: | + MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + type: "string" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + Bridge: + description: | + Name of the default bridge interface when dockerd's --bridge flag is set. + type: "string" + example: "docker0" + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + HairpinMode: + description: | + Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + type: "boolean" + example: false + LinkLocalIPv6Address: + description: | + IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + type: "string" + example: "" + LinkLocalIPv6PrefixLen: + description: | + Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + type: "integer" + example: "" + Ports: + $ref: "#/definitions/PortMap" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + + SecondaryIPAddresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + SecondaryIPv6Addresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + # TODO properties below are part of DefaultNetworkSettings, which is + # marked as deprecated since Docker 1.9 and to be removed in Docker v17.12 + EndpointID: + description: | + EndpointID uniquely represents a service endpoint in a Sandbox. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.1" + GlobalIPv6Address: + description: | + Global IPv6 address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 64 + IPAddress: + description: | + IPv4 address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address for this network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8:2::100" + MacAddress: + description: | + MAC address for the container on the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "02:42:ac:11:00:04" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Parent: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: false + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + DockerVersion: + description: | + The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + type: "string" + x-nullable: false + example: "27.0.1" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: false + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + This size is not calculated by default, and depends on which API endpoint + is used. `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateOptions" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + example: false + IPAM: + $ref: "#/definitions/IPAM" + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + additionalProperties: + $ref: "#/definitions/NetworkContainer" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + items: + $ref: "#/definitions/PeerInfo" + x-nullable: true + # TODO: Add Services (only present when "verbose" is set). + + ConfigReference: + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + example: "config_only_network_01" + + IPAM: + type: "object" + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + NetworkContainer: + type: "object" + properties: + Name: + type: "string" + example: "container_1" + EndpointID: + type: "string" + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + example: "02:42:ac:13:00:02" + IPv4Address: + type: "string" + example: "172.19.0.2/16" + IPv6Address: + type: "string" + example: "" + + PeerInfo: + description: | + PeerInfo represents one peer of an overlay network. + type: "object" + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + example: "10.133.77.91" + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + LinkLocalIPs: + type: "array" + items: + type: "string" + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginInterfaceType: + type: "object" + x-nullable: false + required: [Prefix, Capability, Version] + properties: + Prefix: + type: "string" + x-nullable: false + Capability: + type: "string" + x-nullable: false + Version: + type: "string" + x-nullable: false + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "PluginPrivilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "Settings that can be modified by users." + type: "object" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + DockerVersion: + description: "Docker Version used to create the plugin" + type: "string" + x-nullable: false + example: "17.06.0-ce" + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + $ref: "#/definitions/PluginInterfaceType" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/Port" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + name: + description: "Name of the container" + type: "string" + x-nullable: true + example: "boring_wozniak" + id: + description: "ID of the container" + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + MacAddress: "12:34:56:78:9a:bc" + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "keep-storage" + in: "query" + description: | + Amount of disk space in bytes to keep for cache + + > **Deprecated**: This parameter is deprecated and has been renamed to "reserved-space". + > It is kept for backward compatibility and will be removed in API v1.52. + type: "integer" + format: "int64" + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + type: "object" + title: "SystemAuthResponse" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + x-nullable: false + examples: + application/json: + Status: "Login Succeeded" + IdentityToken: "9cbaf023786cd7..." + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + LayersSize: + type: "integer" + format: "int64" + Images: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + Containers: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + Volumes: + type: "array" + items: + $ref: "#/definitions/Volume" + BuildCache: + type: "array" + items: + $ref: "#/definitions/BuildCache" + example: + LayersSize: 1092588 + Images: + - + Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + ParentId: "" + RepoTags: + - "busybox:latest" + RepoDigests: + - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + Created: 1466724217 + Size: 1092588 + SharedSize: 0 + Labels: {} + Containers: 1 + Containers: + - + Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" + Names: + - "/top" + Image: "busybox" + ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + Command: "top" + Created: 1472592424 + Ports: [] + SizeRootFs: 1092588 + Labels: {} + State: "exited" + Status: "Exited (0) 56 minutes ago" + HostConfig: + NetworkMode: "default" + NetworkSettings: + Networks: + bridge: + IPAMConfig: null + Links: null + Aliases: null + NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" + EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" + Gateway: "172.18.0.1" + IPAddress: "172.18.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:12:00:02" + Mounts: [] + Volumes: + - + Name: "my-volume" + Driver: "local" + Mountpoint: "/var/lib/docker/volumes/my-volume/_data" + Labels: null + Scope: "local" + Options: null + UsageData: + Size: 10920104 + RefCount: 2 + BuildCache: + - + ID: "hw53o5aio51xtltp5xjp8v7fx" + Parents: [] + Type: "regular" + Description: "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0" + InUse: false + Shared: true + Size: 0 + CreatedAt: "2021-06-28T13:31:01.474619385Z" + LastUsedAt: "2021-07-07T22:02:32.738075951Z" + UsageCount: 26 + - + ID: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: ["ndlpt0hhvkqcdfkputsk4cq9c"] + Type: "regular" + Description: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: false + Shared: true + Size: 51 + CreatedAt: "2021-06-28T13:31:03.002625487Z" + LastUsedAt: "2021-07-07T22:02:32.773909517Z" + UsageCount: 26 + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be load if the image is + multi-platform. + If not provided, the full multi-platform image will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateOptions" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Network" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Network" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkConnectRequest" + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + example: + Container: "3613f73ba0e4" + EndpointConfig: + IPAMConfig: + IPv4Address: "172.24.56.89" + IPv6Address: "2001:db8::5689" + MacAddress: "02:42:ac:12:05:02" + Priority: 100 + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkDisconnectRequest" + properties: + Container: + type: "string" + description: | + The ID or name of the container to disconnect from the network. + Force: + type: "boolean" + description: | + Force the container to disconnect from the network. + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.51.yaml b/_vendor/github.com/moby/moby/api/docs/v1.51.yaml new file mode 100644 index 000000000000..94b51801d5fb --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.51.yaml @@ -0,0 +1,13463 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.51" +info: + title: "Docker Engine API" + version: "1.51" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.51/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + Port: + type: "object" + description: "An open port on a container" + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + KernelMemoryTCP: + description: | + Hard limit for kernel TCP buffer memory (in bytes). Depending on the + OCI runtime in use, this option may be ignored. It is no longer supported + by the default (runc) runtime. + + This field is omitted when empty. + + **Deprecated**: This field is deprecated as kernel 6.12 has deprecated `memory.kmem.tcp.limit_in_bytes` field + for cgroups v1. This field will be removed in a future release. + type: "integer" + format: "int64" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + MacAddress: + description: | + MAC address of the container. + + Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. + type: "string" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + Bridge: + description: | + Name of the default bridge interface when dockerd's --bridge flag is set. + + Deprecated: This field is only set when the daemon is started with the --bridge flag specified. + type: "string" + example: "docker0" + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + HairpinMode: + description: | + Indicates if hairpin NAT should be enabled on the virtual interface. + + Deprecated: This field is never set and will be removed in a future release. + type: "boolean" + example: false + LinkLocalIPv6Address: + description: | + IPv6 unicast address using the link-local prefix. + + Deprecated: This field is never set and will be removed in a future release. + type: "string" + example: "" + LinkLocalIPv6PrefixLen: + description: | + Prefix length of the IPv6 unicast address. + + Deprecated: This field is never set and will be removed in a future release. + type: "integer" + example: "" + Ports: + $ref: "#/definitions/PortMap" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + + SecondaryIPAddresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + SecondaryIPv6Addresses: + description: "Deprecated: This field is never set and will be removed in a future release." + type: "array" + items: + $ref: "#/definitions/Address" + x-nullable: true + + # TODO properties below are part of DefaultNetworkSettings, which is + # marked as deprecated since Docker 1.9 and to be removed in Docker v17.12 + EndpointID: + description: | + EndpointID uniquely represents a service endpoint in a Sandbox. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.1" + GlobalIPv6Address: + description: | + Global IPv6 address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 64 + IPAddress: + description: | + IPv4 address for the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address for this network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "2001:db8:2::100" + MacAddress: + description: | + MAC address for the container on the default "bridge" network. + + <p><br /></p> + + > **Deprecated**: This field is only propagated when attached to the + > default "bridge" network. Use the information from the "bridge" + > network inside the `Networks` map instead, which contains the same + > information. This field was deprecated in Docker 1.9 and is scheduled + > to be removed in Docker 17.12.0 + type: "string" + example: "02:42:ac:11:00:04" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Parent: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + + > **Deprecated**: This field is only set when using the deprecated + > legacy builder. It is included in API responses for informational + > purposes, but should not be depended on as it will be omitted + > once the legacy builder is removed. + type: "string" + x-nullable: false + example: "" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: false + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + DockerVersion: + description: | + The version of Docker that was used to build the image. + + Depending on how the image was created, this field may be empty. + + > **Deprecated**: This field is only set when using the deprecated + > legacy builder. It is included in API responses for informational + > purposes, but should not be depended on as it will be omitted + > once the legacy builder is removed. + type: "string" + x-nullable: false + example: "27.0.1" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: false + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + email: + description: | + Email is an optional value associated with the username. + + > **Deprecated**: This field is deprecated since docker 1.11 (API v1.23) and will be removed in a future release. + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumeCreateOptions: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateOptions" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + example: false + IPAM: + $ref: "#/definitions/IPAM" + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + additionalProperties: + $ref: "#/definitions/NetworkContainer" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + items: + $ref: "#/definitions/PeerInfo" + x-nullable: true + # TODO: Add Services (only present when "verbose" is set). + + ConfigReference: + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + example: "config_only_network_01" + + IPAM: + type: "object" + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + NetworkContainer: + type: "object" + properties: + Name: + type: "string" + example: "container_1" + EndpointID: + type: "string" + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + example: "02:42:ac:13:00:02" + IPv4Address: + type: "string" + example: "172.19.0.2/16" + IPv6Address: + type: "string" + example: "" + + PeerInfo: + description: | + PeerInfo represents one peer of an overlay network. + type: "object" + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + example: "10.133.77.91" + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + error: + type: "string" + x-nullable: true + description: |- + errors encountered during the operation. + + + > **Deprecated**: This field is deprecated since API v1.4, and will be omitted in a future API version. Use the information in errorDetail instead. + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progress: + type: "string" + x-nullable: true + description: |- + Progress is a pre-formatted presentation of progressDetail. + + + > **Deprecated**: This field is deprecated since API v1.8, and will be omitted in a future API version. Use the information in progressDetail instead. + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + LinkLocalIPs: + type: "array" + items: + type: "string" + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginInterfaceType: + type: "object" + x-nullable: false + required: [Prefix, Capability, Version] + properties: + Prefix: + type: "string" + x-nullable: false + Capability: + type: "string" + x-nullable: false + Version: + type: "string" + x-nullable: false + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "PluginPrivilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "Settings that can be modified by users." + type: "object" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + DockerVersion: + description: |- + Docker Version used to create the plugin. + + Depending on how the plugin was created, this field may be empty or omitted. + + Deprecated: this field is no longer set, and will be removed in the next API version. + type: "string" + x-nullable: false + x-omitempty: true + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + $ref: "#/definitions/PluginInterfaceType" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/Port" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + name: + description: "Name of the container" + type: "string" + x-nullable: true + example: "boring_wozniak" + id: + description: "ID of the container" + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + KernelMemoryTCP: + description: | + Indicates if the host has kernel memory TCP limit support enabled. This + field is omitted if not supported. + + Kernel memory TCP limits are not supported when using cgroups v2, which + does not support the corresponding `memory.kmem.tcp.limit_in_bytes` cgroup. + + **Deprecated**: This field is deprecated as kernel 6.12 has deprecated kernel memory TCP accounting. + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + MacAddress: "12:34:56:78:9a:bc" + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "keep-storage" + in: "query" + description: | + Amount of disk space in bytes to keep for cache + + > **Deprecated**: This parameter is deprecated and has been renamed to "reserved-space". + > It is kept for backward compatibility and will be removed in API v1.52. + type: "integer" + format: "int64" + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + type: "object" + title: "SystemAuthResponse" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + x-nullable: false + examples: + application/json: + Status: "Login Succeeded" + IdentityToken: "9cbaf023786cd7..." + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + LayersSize: + type: "integer" + format: "int64" + Images: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + Containers: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + Volumes: + type: "array" + items: + $ref: "#/definitions/Volume" + BuildCache: + type: "array" + items: + $ref: "#/definitions/BuildCache" + example: + LayersSize: 1092588 + Images: + - + Id: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + ParentId: "" + RepoTags: + - "busybox:latest" + RepoDigests: + - "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + Created: 1466724217 + Size: 1092588 + SharedSize: 0 + Labels: {} + Containers: 1 + Containers: + - + Id: "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" + Names: + - "/top" + Image: "busybox" + ImageID: "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + Command: "top" + Created: 1472592424 + Ports: [] + SizeRootFs: 1092588 + Labels: {} + State: "exited" + Status: "Exited (0) 56 minutes ago" + HostConfig: + NetworkMode: "default" + NetworkSettings: + Networks: + bridge: + IPAMConfig: null + Links: null + Aliases: null + NetworkID: "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92" + EndpointID: "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a" + Gateway: "172.18.0.1" + IPAddress: "172.18.0.2" + IPPrefixLen: 16 + IPv6Gateway: "" + GlobalIPv6Address: "" + GlobalIPv6PrefixLen: 0 + MacAddress: "02:42:ac:12:00:02" + Mounts: [] + Volumes: + - + Name: "my-volume" + Driver: "local" + Mountpoint: "/var/lib/docker/volumes/my-volume/_data" + Labels: null + Scope: "local" + Options: null + UsageData: + Size: 10920104 + RefCount: 2 + BuildCache: + - + ID: "hw53o5aio51xtltp5xjp8v7fx" + Parents: [] + Type: "regular" + Description: "pulled from docker.io/library/debian@sha256:234cb88d3020898631af0ccbbcca9a66ae7306ecd30c9720690858c1b007d2a0" + InUse: false + Shared: true + Size: 0 + CreatedAt: "2021-06-28T13:31:01.474619385Z" + LastUsedAt: "2021-07-07T22:02:32.738075951Z" + UsageCount: 26 + - + ID: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: ["ndlpt0hhvkqcdfkputsk4cq9c"] + Type: "regular" + Description: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: false + Shared: true + Size: 51 + CreatedAt: "2021-06-28T13:31:03.002625487Z" + LastUsedAt: "2021-07-07T22:02:32.773909517Z" + UsageCount: 26 + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "string" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be load if the image is + multi-platform. + If not provided, the full multi-platform image will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateOptions" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Network" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Network" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkConnectRequest" + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + example: + Container: "3613f73ba0e4" + EndpointConfig: + IPAMConfig: + IPv4Address: "172.24.56.89" + IPv6Address: "2001:db8::5689" + MacAddress: "02:42:ac:12:05:02" + Priority: 100 + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + type: "object" + title: "NetworkDisconnectRequest" + properties: + Container: + type: "string" + description: | + The ID or name of the container to disconnect from the network. + Force: + type: "boolean" + description: | + Force the container to disconnect from the network. + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.52.yaml b/_vendor/github.com/moby/moby/api/docs/v1.52.yaml new file mode 100644 index 000000000000..7ca2da0dcaef --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.52.yaml @@ -0,0 +1,13627 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.52" +info: + title: "Docker Engine API" + version: "1.52" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.52/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + PortSummary: + type: "object" + description: | + Describes a port-mapping between the container and the host. + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + x-go-type: + type: Addr + import: + package: net/netip + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + description: | + The name of the device driver to use for this request. + + Note that if this is specified the capabilities are ignored when + selecting a device driver. + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + + Note that if a driver is specified the capabilities have no effect on + selecting a driver as the driver name is used directly. + + Note that if no driver is specified the capabilities are used to + select a driver with the required capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + format: "ip-address" + x-go-type: + type: Addr + import: + package: net/netip + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + Ports: + $ref: "#/definitions/PortMap" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + x-go-type: + type: Addr + import: + package: net/netip + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + Storage: + description: | + Information about the storage used by the container. + type: "object" + properties: + RootFS: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorage" + + RootFSStorage: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-go-name: RootFSStorage + properties: + Snapshot: + description: | + Information about the snapshot used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorageSnapshot" + + RootFSStorageSnapshot: + description: | + Information about a snapshot backend of the container's root filesystem. + type: "object" + x-go-name: RootFSStorageSnapshot + properties: + Name: + description: "Name of the snapshotter." + type: "string" + x-nullable: false + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: true + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: true + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + x-nullable: true + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + ImagesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/image" + description: | + represents system data usage for image resources. + properties: + ActiveCount: + description: | + Count of active images. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all images. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing unused images. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by images. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of image summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + AuthResponse: + description: | + An identity token was generated successfully. + type: "object" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + example: "Login Succeeded" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + example: "9cbaf023786cd7..." + x-nullable: false + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + x-nullable: false + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/volume" + description: | + represents system data usage for volume resources. + properties: + ActiveCount: + description: | + Count of active volumes. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all volumes. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive volumes. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by volumes. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of volumes. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Volume + + VolumeCreateRequest: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateRequest" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + x-omitempty: false + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + x-go-name: "ID" + x-omitempty: false + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-omitempty: false + x-go-type: + type: Time + import: + package: time + hints: + nullable: false + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + x-omitempty: false + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + x-omitempty: false + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + x-omitempty: false + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + x-omitempty: false + example: false + IPAM: + description: | + The network's IP Address Management. + $ref: "#/definitions/IPAM" + x-nullable: false + x-omitempty: false + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + x-nullable: false + x-omitempty: false + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + x-omitempty: false + x-nullable: false + default: false + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: | + Metadata specific to the network being created. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + x-omitempty: true + items: + $ref: "#/definitions/PeerInfo" + + NetworkSummary: + description: "Network list response item" + x-go-name: Summary + type: "object" + allOf: + - $ref: "#/definitions/Network" + + NetworkInspect: + description: 'The body of the "get network" http response message.' + x-go-name: Inspect + type: "object" + allOf: + - $ref: "#/definitions/Network" + properties: + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + x-omitempty: false + additionalProperties: + $ref: "#/definitions/EndpointResource" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Services: + description: | + List of services using the network. This field is only present for + swarm scope networks, and omitted for local scope networks. + type: "object" + x-omitempty: true + additionalProperties: + x-go-type: + type: ServiceInfo + hints: + nullable: false + Status: + description: > + provides runtime information about the network + such as the number of allocated IPs. + $ref: "#/definitions/NetworkStatus" + + NetworkStatus: + description: > + provides runtime information about the network + such as the number of allocated IPs. + type: "object" + x-go-name: Status + properties: + IPAM: + $ref: "#/definitions/IPAMStatus" + + ServiceInfo: + x-nullable: false + x-omitempty: false + description: > + represents service parameters with the list of service's tasks + type: "object" + properties: + VIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Ports: + type: "array" + x-omitempty: false + items: + type: "string" + LocalLBIndex: + type: "integer" + format: "int" + x-omitempty: false + x-go-type: + type: int + Tasks: + type: "array" + x-omitempty: false + items: + $ref: "#/definitions/NetworkTaskInfo" + + NetworkTaskInfo: + x-nullable: false + x-omitempty: false + x-go-name: Task + description: > + carries the information about one backend task + type: "object" + properties: + Name: + type: "string" + x-omitempty: false + EndpointID: + type: "string" + x-omitempty: false + EndpointIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Info: + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + + ConfigReference: + x-nullable: false + x-omitempty: false + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + x-omitempty: false + example: "config_only_network_01" + + IPAM: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + IPAMStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Subnets: + type: "object" + additionalProperties: + $ref: "#/definitions/SubnetStatus" + example: + "172.16.0.0/16": + IPsInUse: 3 + DynamicIPsAvailable: 65533 + "2001:db8:abcd:0012::0/96": + IPsInUse: 5 + DynamicIPsAvailable: 4294967291 + x-go-type: + type: SubnetStatuses + kind: map + + SubnetStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + IPsInUse: + description: > + Number of IP addresses in the subnet that are in use or reserved and + are therefore unavailable for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + DynamicIPsAvailable: + description: > + Number of IP addresses within the network's IPRange for the subnet + that are available for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + + EndpointResource: + type: "object" + description: > + contains network resources allocated and used for a + container in a network. + properties: + Name: + type: "string" + x-omitempty: false + example: "container_1" + EndpointID: + type: "string" + x-omitempty: false + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + x-omitempty: false + example: "02:42:ac:13:00:02" + x-go-type: + type: HardwareAddr + IPv4Address: + type: "string" + x-omitempty: false + example: "172.19.0.2/16" + x-go-type: + type: Prefix + import: + package: net/netip + IPv6Address: + type: "string" + x-omitempty: false + example: "" + x-go-type: + type: Prefix + import: + package: net/netip + + PeerInfo: + description: > + represents one peer of an overlay network. + type: "object" + x-nullable: false + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "10.133.77.91" + x-go-type: + type: Addr + import: + package: net/netip + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + BuildCacheDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/build" + description: | + represents system data usage for build cache resources. + properties: + ActiveCount: + description: | + Count of active build cache records. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all build cache records. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive build cache records. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by build cache records. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of build cache records. + type: "array" + x-omitempty: true + items: + x-go-type: + type: CacheRecord + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + NetworkConnectRequest: + description: | + NetworkConnectRequest represents the data to be used to connect a container to a network. + type: "object" + x-go-name: "ConnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + x-nullable: false + example: "3613f73ba0e4" + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + x-nullable: true + + NetworkDisconnectRequest: + description: | + NetworkDisconnectRequest represents the data to be used to disconnect a container from a network. + type: "object" + x-go-name: "DisconnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to disconnect from the network." + x-nullable: false + example: "3613f73ba0e4" + Force: + type: "boolean" + description: "Force the container to disconnect from the network." + default: false + x-nullable: false + x-omitempty: false + example: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + x-go-type: + type: HardwareAddr + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + x-go-type: + type: Addr + import: + package: net/netip + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + x-go-type: + type: Addr + import: + package: net/netip + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + x-go-type: + type: Addr + import: + package: net/netip + LinkLocalIPs: + type: "array" + items: + type: "string" + x-go-type: + type: Addr + import: + package: net/netip + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-go-name: "Mount" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + x-go-name: "Device" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-go-name: "Env" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "Privilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + x-go-name: "Plugin" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "user-configurable settings for the plugin." + type: "object" + x-go-name: "Settings" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-go-name: "PluginReference" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-go-name: "Config" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + x-go-name: "Interface" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + type: "string" + x-go-type: + type: "CapabilityID" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-go-name: "User" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-go-name: "NetworkConfig" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-go-name: "LinuxConfig" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-go-name: "Args" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + x-go-name: "RootFS" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + SwapBytes: + description: | + Amount of swap in bytes - can only be used together with a memory limit. + If not specified, the default behaviour is to grant a swap space twice + as big as the memory limit. + Set to -1 to enable unlimited swap. + type: "integer" + format: "int64" + minimum: -1 + x-nullable: true + x-omitempty: true + MemorySwappiness: + description: | + Tune the service's containers' memory swappiness (0 to 100). + If not specified, defaults to the containers' OS' default, generally 60, + or whatever value was predefined in the image. + Set to -1 to unset a previously set value. + type: "integer" + format: "int64" + minimum: -1 + maximum: 100 + x-nullable: true + x-omitempty: true + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + x-nullable: true + Storage: + $ref: "#/definitions/Storage" + x-nullable: true + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/PortSummary" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + Health: + type: "object" + description: |- + Summary of health status + + Added in v1.52, before that version all container summary not include Health. + After this attribute introduced, it includes containers with no health checks configured, + or containers that are not running with none + properties: + Status: + type: "string" + description: |- + the health status of the container + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + + ContainersDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/container" + description: | + represents system data usage information for container resources. + properties: + ActiveCount: + description: | + Count of active containers. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all containers. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive containers. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by containers. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of container summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + id: + description: | + ID of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + name: + description: | + Name of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "boring_wozniak" + os_type: + description: | + OSType is the OS of the container ("linux" or "windows") to allow + platform-specific handling of stats. + type: "string" + x-nullable: true + example: "linux" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + $ref: "#/definitions/AuthResponse" + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/x-ndjson" + - "application/json-seq" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + ImageUsage: + $ref: "#/definitions/ImagesDiskUsage" + ContainerUsage: + $ref: "#/definitions/ContainersDiskUsage" + VolumeUsage: + $ref: "#/definitions/VolumesDiskUsage" + BuildCacheUsage: + $ref: "#/definitions/BuildCacheDiskUsage" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + - name: "verbose" + in: "query" + description: | + Show detailed information on space usage. + type: "boolean" + default: false + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to be saved if the image is + multi-platform. If not provided, the full multi-platform image + will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to load if the image is + multi-platform. If not provided, the full multi-platform image + will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateRequest" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/NetworkSummary" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/NetworkInspect" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkConnectRequest" + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkDisconnectRequest" + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.53.yaml b/_vendor/github.com/moby/moby/api/docs/v1.53.yaml new file mode 100644 index 000000000000..5063850a523e --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.53.yaml @@ -0,0 +1,13879 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.53" +info: + title: "Docker Engine API" + version: "1.53" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.52/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + PortSummary: + type: "object" + description: | + Describes a port-mapping between the container and the host. + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + x-go-type: + type: Addr + import: + package: net/netip + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + description: | + The name of the device driver to use for this request. + + Note that if this is specified the capabilities are ignored when + selecting a device driver. + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + + Note that if a driver is specified the capabilities have no effect on + selecting a driver as the driver name is used directly. + + Note that if no driver is specified the capabilities are used to + select a driver with the required capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + format: "ip-address" + x-go-type: + type: Addr + import: + package: net/netip + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + Ports: + $ref: "#/definitions/PortMap" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + x-go-type: + type: Addr + import: + package: net/netip + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + Storage: + description: | + Information about the storage used by the container. + type: "object" + properties: + RootFS: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorage" + + RootFSStorage: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-go-name: RootFSStorage + properties: + Snapshot: + description: | + Information about the snapshot used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorageSnapshot" + + RootFSStorageSnapshot: + description: | + Information about a snapshot backend of the container's root filesystem. + type: "object" + x-go-name: RootFSStorageSnapshot + properties: + Name: + description: "Name of the snapshotter." + type: "string" + x-nullable: false + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + x-nullable: true + $ref: "#/definitions/Identity" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: true + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: true + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + x-nullable: true + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + type: "object" + properties: + Signature: + description: |- + Signature contains the properties of verified signatures for the image. + type: "array" + items: + $ref: "#/definitions/SignatureIdentity" + Pull: + description: |- + Pull contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + After successful push this images also contains the pushed repository location. + type: "array" + items: + $ref: "#/definitions/PullIdentity" + Build: + description: |- + Build contains build reference information if image was created via build. + type: "array" + items: + $ref: "#/definitions/BuildIdentity" + + BuildIdentity: + description: |- + BuildIdentity contains build reference information if image was created via build. + type: "object" + properties: + Ref: + description: |- + Ref is the identifier for the build request. This reference can be used to + look up the build details in BuildKit history API. + type: "string" + CreatedAt: + description: |- + CreatedAt is the time when the build ran. + type: "string" + format: "date-time" + + PullIdentity: + description: |- + PullIdentity contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + type: "object" + properties: + Repository: + description: |- + Repository is the remote repository location the image was pulled from. + type: "string" + + SignatureIdentity: + description: |- + SignatureIdentity contains the properties of verified signatures for the image. + type: "object" + properties: + Name: + description: |- + Name is a textual description summarizing the type of signature. + type: "string" + Timestamps: + description: |- + Timestamps contains a list of verified signed timestamps for the signature. + type: "array" + items: + $ref: "#/definitions/SignatureTimestamp" + KnownSigner: + description: |- + KnownSigner is an identifier for a special signer identity that is known to the implementation. + $ref: "#/definitions/KnownSignerIdentity" + DockerReference: + description: |- + DockerReference is the Docker image reference associated with the signature. + This is an optional field only present in older hashedrecord signatures. + type: "string" + Signer: + description: |- + Signer contains information about the signer certificate used to sign the image. + $ref: "#/definitions/SignerIdentity" + SignatureType: + description: |- + SignatureType is the type of signature format. E.g. "bundle-v0.3" or "hashedrecord". + $ref: "#/definitions/SignatureType" + Error: + description: |- + Error contains error information if signature verification failed. + Other fields will be empty in this case. + type: "string" + Warnings: + description: |- + Warnings contains any warnings that occurred during signature verification. + For example, if there was no internet connectivity and cached trust roots were used. + Warning does not indicate a failed verification but may point to configuration issues. + type: "array" + items: + type: "string" + + SignatureTimestamp: + description: |- + SignatureTimestamp contains information about a verified signed timestamp for an image signature. + type: "object" + properties: + Type: + $ref: "#/definitions/SignatureTimestampType" + URI: + type: "string" + Timestamp: + type: "string" + format: "date-time" + + SignatureTimestampType: + description: |- + SignatureTimestampType is the type of timestamp used in the signature. + type: "string" + enum: + - "Tlog" + - "TimestampAuthority" + + SignatureType: + description: |- + SignatureType is the type of signature format. + type: "string" + enum: + - "bundle-v0.3" + - "simplesigning-v1" + + KnownSignerIdentity: + description: |- + KnownSignerIdentity is an identifier for a special signer identity that is known to the implementation. + type: "string" + enum: + - "DHI" + + SignerIdentity: + description: |- + SignerIdentity contains information about the signer certificate used to sign the image. + type: "object" + properties: + CertificateIssuer: + type: "string" + description: |- + CertificateIssuer is the certificate issuer. + SubjectAlternativeName: + type: "string" + description: |- + SubjectAlternativeName is the certificate subject alternative name. + Issuer: + type: "string" + description: |- + The OIDC issuer. Should match `iss` claim of ID token or, in the case of + a federated login like Dex it should match the issuer URL of the + upstream issuer. The issuer is not set the extensions are invalid and + will fail to render. + BuildSignerURI: + type: "string" + description: |- + Reference to specific build instructions that are responsible for signing. + BuildSignerDigest: + type: "string" + description: |- + Immutable reference to the specific version of the build instructions that is responsible for signing. + RunnerEnvironment: + type: "string" + description: |- + Specifies whether the build took place in platform-hosted cloud infrastructure or customer/self-hosted infrastructure. + SourceRepositoryURI: + type: "string" + description: |- + Source repository URL that the build was based on. + SourceRepositoryDigest: + type: "string" + description: |- + Immutable reference to a specific version of the source code that the build was based upon. + SourceRepositoryRef: + type: "string" + description: |- + Source Repository Ref that the build run was based upon. + SourceRepositoryIdentifier: + type: "string" + description: |- + Immutable identifier for the source repository the workflow was based upon. + SourceRepositoryOwnerURI: + type: "string" + description: |- + Source repository owner URL of the owner of the source repository that the build was based on. + SourceRepositoryOwnerIdentifier: + type: "string" + description: |- + Immutable identifier for the owner of the source repository that the workflow was based upon. + BuildConfigURI: + type: "string" + description: |- + Build Config URL to the top-level/initiating build instructions. + BuildConfigDigest: + type: "string" + description: |- + Immutable reference to the specific version of the top-level/initiating build instructions. + BuildTrigger: + type: "string" + description: |- + Event or action that initiated the build. + RunInvocationURI: + type: "string" + description: |- + Run Invocation URL to uniquely identify the build execution. + SourceRepositoryVisibilityAtSigning: + type: "string" + description: |- + Source repository visibility at the time of signing the certificate. + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + ImagesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/image" + description: | + represents system data usage for image resources. + properties: + ActiveCount: + description: | + Count of active images. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all images. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing unused images. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by images. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of image summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + AuthResponse: + description: | + An identity token was generated successfully. + type: "object" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + example: "Login Succeeded" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + example: "9cbaf023786cd7..." + x-nullable: false + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + x-nullable: false + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/volume" + description: | + represents system data usage for volume resources. + properties: + ActiveCount: + description: | + Count of active volumes. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all volumes. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive volumes. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by volumes. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of volumes. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Volume + + VolumeCreateRequest: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateRequest" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + x-omitempty: false + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + x-go-name: "ID" + x-omitempty: false + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-omitempty: false + x-go-type: + type: Time + import: + package: time + hints: + nullable: false + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + x-omitempty: false + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + x-omitempty: false + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + x-omitempty: false + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + x-omitempty: false + example: false + IPAM: + description: | + The network's IP Address Management. + $ref: "#/definitions/IPAM" + x-nullable: false + x-omitempty: false + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + x-nullable: false + x-omitempty: false + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + x-omitempty: false + x-nullable: false + default: false + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: | + Metadata specific to the network being created. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + x-omitempty: true + items: + $ref: "#/definitions/PeerInfo" + + NetworkSummary: + description: "Network list response item" + x-go-name: Summary + type: "object" + allOf: + - $ref: "#/definitions/Network" + + NetworkInspect: + description: 'The body of the "get network" http response message.' + x-go-name: Inspect + type: "object" + allOf: + - $ref: "#/definitions/Network" + properties: + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + x-omitempty: false + additionalProperties: + $ref: "#/definitions/EndpointResource" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Services: + description: | + List of services using the network. This field is only present for + swarm scope networks, and omitted for local scope networks. + type: "object" + x-omitempty: true + additionalProperties: + x-go-type: + type: ServiceInfo + hints: + nullable: false + Status: + description: > + provides runtime information about the network + such as the number of allocated IPs. + $ref: "#/definitions/NetworkStatus" + + NetworkStatus: + description: > + provides runtime information about the network + such as the number of allocated IPs. + type: "object" + x-go-name: Status + properties: + IPAM: + $ref: "#/definitions/IPAMStatus" + + ServiceInfo: + x-nullable: false + x-omitempty: false + description: > + represents service parameters with the list of service's tasks + type: "object" + properties: + VIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Ports: + type: "array" + x-omitempty: false + items: + type: "string" + LocalLBIndex: + type: "integer" + format: "int" + x-omitempty: false + x-go-type: + type: int + Tasks: + type: "array" + x-omitempty: false + items: + $ref: "#/definitions/NetworkTaskInfo" + + NetworkTaskInfo: + x-nullable: false + x-omitempty: false + x-go-name: Task + description: > + carries the information about one backend task + type: "object" + properties: + Name: + type: "string" + x-omitempty: false + EndpointID: + type: "string" + x-omitempty: false + EndpointIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Info: + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + + ConfigReference: + x-nullable: false + x-omitempty: false + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + x-omitempty: false + example: "config_only_network_01" + + IPAM: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + IPAMStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Subnets: + type: "object" + additionalProperties: + $ref: "#/definitions/SubnetStatus" + example: + "172.16.0.0/16": + IPsInUse: 3 + DynamicIPsAvailable: 65533 + "2001:db8:abcd:0012::0/96": + IPsInUse: 5 + DynamicIPsAvailable: 4294967291 + x-go-type: + type: SubnetStatuses + kind: map + + SubnetStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + IPsInUse: + description: > + Number of IP addresses in the subnet that are in use or reserved and + are therefore unavailable for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + DynamicIPsAvailable: + description: > + Number of IP addresses within the network's IPRange for the subnet + that are available for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + + EndpointResource: + type: "object" + description: > + contains network resources allocated and used for a + container in a network. + properties: + Name: + type: "string" + x-omitempty: false + example: "container_1" + EndpointID: + type: "string" + x-omitempty: false + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + x-omitempty: false + example: "02:42:ac:13:00:02" + x-go-type: + type: HardwareAddr + IPv4Address: + type: "string" + x-omitempty: false + example: "172.19.0.2/16" + x-go-type: + type: Prefix + import: + package: net/netip + IPv6Address: + type: "string" + x-omitempty: false + example: "" + x-go-type: + type: Prefix + import: + package: net/netip + + PeerInfo: + description: > + represents one peer of an overlay network. + type: "object" + x-nullable: false + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "10.133.77.91" + x-go-type: + type: Addr + import: + package: net/netip + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + BuildCacheDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/build" + description: | + represents system data usage for build cache resources. + properties: + ActiveCount: + description: | + Count of active build cache records. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all build cache records. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive build cache records. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by build cache records. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of build cache records. + type: "array" + x-omitempty: true + items: + x-go-type: + type: CacheRecord + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + NRIInfo: + description: | + Information about the Node Resource Interface (NRI). + + This field is only present if NRI is enabled. + type: "object" + x-nullable: true + properties: + Info: + description: | + Information about NRI, provided as "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["plugin-path", "/opt/docker/nri/plugins"] + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + NetworkConnectRequest: + description: | + NetworkConnectRequest represents the data to be used to connect a container to a network. + type: "object" + x-go-name: "ConnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + x-nullable: false + example: "3613f73ba0e4" + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + x-nullable: true + + NetworkDisconnectRequest: + description: | + NetworkDisconnectRequest represents the data to be used to disconnect a container from a network. + type: "object" + x-go-name: "DisconnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to disconnect from the network." + x-nullable: false + example: "3613f73ba0e4" + Force: + type: "boolean" + description: "Force the container to disconnect from the network." + default: false + x-nullable: false + x-omitempty: false + example: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + x-go-type: + type: HardwareAddr + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + x-go-type: + type: Addr + import: + package: net/netip + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + x-go-type: + type: Addr + import: + package: net/netip + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + x-go-type: + type: Addr + import: + package: net/netip + LinkLocalIPs: + type: "array" + items: + type: "string" + x-go-type: + type: Addr + import: + package: net/netip + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-go-name: "Mount" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + x-go-name: "Device" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-go-name: "Env" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "Privilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + x-go-name: "Plugin" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "user-configurable settings for the plugin." + type: "object" + x-go-name: "Settings" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-go-name: "PluginReference" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-go-name: "Config" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + x-go-name: "Interface" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + type: "string" + x-go-type: + type: "CapabilityID" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-go-name: "User" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-go-name: "NetworkConfig" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-go-name: "LinuxConfig" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-go-name: "Args" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + x-go-name: "RootFS" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + SwapBytes: + description: | + Amount of swap in bytes - can only be used together with a memory limit. + If not specified, the default behaviour is to grant a swap space twice + as big as the memory limit. + Set to -1 to enable unlimited swap. + type: "integer" + format: "int64" + minimum: -1 + x-nullable: true + x-omitempty: true + MemorySwappiness: + description: | + Tune the service's containers' memory swappiness (0 to 100). + If not specified, defaults to the containers' OS' default, generally 60, + or whatever value was predefined in the image. + Set to -1 to unset a previously set value. + type: "integer" + format: "int64" + minimum: -1 + maximum: 100 + x-nullable: true + x-omitempty: true + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + x-nullable: true + Storage: + $ref: "#/definitions/Storage" + x-nullable: true + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/PortSummary" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + Health: + type: "object" + description: |- + Summary of health status + + Added in v1.52, before that version all container summary not include Health. + After this attribute introduced, it includes containers with no health checks configured, + or containers that are not running with none + properties: + Status: + type: "string" + description: |- + the health status of the container + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + + ContainersDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/container" + description: | + represents system data usage information for container resources. + properties: + ActiveCount: + description: | + Count of active containers. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all containers. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive containers. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by containers. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of container summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + id: + description: | + ID of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + name: + description: | + Name of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "boring_wozniak" + os_type: + description: | + OSType is the OS of the container ("linux" or "windows") to allow + platform-specific handling of stats. + type: "string" + x-nullable: true + example: "linux" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + NRI: + $ref: "#/definitions/NRIInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + $ref: "#/definitions/AuthResponse" + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/jsonl" + - "application/x-ndjson" + - "application/json-seq" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + ImageUsage: + $ref: "#/definitions/ImagesDiskUsage" + ContainerUsage: + $ref: "#/definitions/ContainersDiskUsage" + VolumeUsage: + $ref: "#/definitions/VolumesDiskUsage" + BuildCacheUsage: + $ref: "#/definitions/BuildCacheDiskUsage" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + - name: "verbose" + in: "query" + description: | + Show detailed information on space usage. + type: "boolean" + default: false + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to be saved if the image is + multi-platform. If not provided, the full multi-platform image + will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to load if the image is + multi-platform. If not provided, the full multi-platform image + will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateRequest" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/NetworkSummary" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/NetworkInspect" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkConnectRequest" + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkDisconnectRequest" + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + > **Deprecated**: This endpoint is deprecated and will be removed in a future version. + > Server should support gRPC directly on the listening socket. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.54.yaml b/_vendor/github.com/moby/moby/api/docs/v1.54.yaml new file mode 100644 index 000000000000..f4cb282fa3f6 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.54.yaml @@ -0,0 +1,13891 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.54" +info: + title: "Docker Engine API" + version: "1.54" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API (v1.50) is used. + For example, calling `/info` is the same as calling `/v1.52/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + PortSummary: + type: "object" + description: | + Describes a port-mapping between the container and the host. + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + x-go-type: + type: Addr + import: + package: net/netip + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + description: | + The name of the device driver to use for this request. + + Note that if this is specified the capabilities are ignored when + selecting a device driver. + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + + Note that if a driver is specified the capabilities have no effect on + selecting a driver as the driver name is used directly. + + Note that if no driver is specified the capabilities are used to + select a driver with the required capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + format: "ip-address" + x-go-type: + type: Addr + import: + package: net/netip + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + Ports: + $ref: "#/definitions/PortMap" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + x-go-type: + type: Addr + import: + package: net/netip + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + Storage: + description: | + Information about the storage used by the container. + type: "object" + properties: + RootFS: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorage" + + RootFSStorage: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-go-name: RootFSStorage + properties: + Snapshot: + description: | + Information about the snapshot used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorageSnapshot" + + RootFSStorageSnapshot: + description: | + Information about a snapshot backend of the container's root filesystem. + type: "object" + x-go-name: RootFSStorageSnapshot + properties: + Name: + description: "Name of the snapshotter." + type: "string" + x-nullable: false + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + x-nullable: true + $ref: "#/definitions/Identity" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: true + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: true + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + x-nullable: true + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + type: "object" + properties: + Signature: + description: |- + Signature contains the properties of verified signatures for the image. + type: "array" + items: + $ref: "#/definitions/SignatureIdentity" + Pull: + description: |- + Pull contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + After successful push this images also contains the pushed repository location. + type: "array" + items: + $ref: "#/definitions/PullIdentity" + Build: + description: |- + Build contains build reference information if image was created via build. + type: "array" + items: + $ref: "#/definitions/BuildIdentity" + + BuildIdentity: + description: |- + BuildIdentity contains build reference information if image was created via build. + type: "object" + properties: + Ref: + description: |- + Ref is the identifier for the build request. This reference can be used to + look up the build details in BuildKit history API. + type: "string" + CreatedAt: + description: |- + CreatedAt is the time when the build ran. + type: "string" + format: "date-time" + + PullIdentity: + description: |- + PullIdentity contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + type: "object" + properties: + Repository: + description: |- + Repository is the remote repository location the image was pulled from. + type: "string" + + SignatureIdentity: + description: |- + SignatureIdentity contains the properties of verified signatures for the image. + type: "object" + properties: + Name: + description: |- + Name is a textual description summarizing the type of signature. + type: "string" + Timestamps: + description: |- + Timestamps contains a list of verified signed timestamps for the signature. + type: "array" + items: + $ref: "#/definitions/SignatureTimestamp" + KnownSigner: + description: |- + KnownSigner is an identifier for a special signer identity that is known to the implementation. + $ref: "#/definitions/KnownSignerIdentity" + DockerReference: + description: |- + DockerReference is the Docker image reference associated with the signature. + This is an optional field only present in older hashedrecord signatures. + type: "string" + Signer: + description: |- + Signer contains information about the signer certificate used to sign the image. + $ref: "#/definitions/SignerIdentity" + SignatureType: + description: |- + SignatureType is the type of signature format. E.g. "bundle-v0.3" or "hashedrecord". + $ref: "#/definitions/SignatureType" + Error: + description: |- + Error contains error information if signature verification failed. + Other fields will be empty in this case. + type: "string" + Warnings: + description: |- + Warnings contains any warnings that occurred during signature verification. + For example, if there was no internet connectivity and cached trust roots were used. + Warning does not indicate a failed verification but may point to configuration issues. + type: "array" + items: + type: "string" + + SignatureTimestamp: + description: |- + SignatureTimestamp contains information about a verified signed timestamp for an image signature. + type: "object" + properties: + Type: + $ref: "#/definitions/SignatureTimestampType" + URI: + type: "string" + Timestamp: + type: "string" + format: "date-time" + + SignatureTimestampType: + description: |- + SignatureTimestampType is the type of timestamp used in the signature. + type: "string" + enum: + - "Tlog" + - "TimestampAuthority" + + SignatureType: + description: |- + SignatureType is the type of signature format. + type: "string" + enum: + - "bundle-v0.3" + - "simplesigning-v1" + + KnownSignerIdentity: + description: |- + KnownSignerIdentity is an identifier for a special signer identity that is known to the implementation. + type: "string" + enum: + - "DHI" + + SignerIdentity: + description: |- + SignerIdentity contains information about the signer certificate used to sign the image. + type: "object" + properties: + CertificateIssuer: + type: "string" + description: |- + CertificateIssuer is the certificate issuer. + SubjectAlternativeName: + type: "string" + description: |- + SubjectAlternativeName is the certificate subject alternative name. + Issuer: + type: "string" + description: |- + The OIDC issuer. Should match `iss` claim of ID token or, in the case of + a federated login like Dex it should match the issuer URL of the + upstream issuer. The issuer is not set the extensions are invalid and + will fail to render. + BuildSignerURI: + type: "string" + description: |- + Reference to specific build instructions that are responsible for signing. + BuildSignerDigest: + type: "string" + description: |- + Immutable reference to the specific version of the build instructions that is responsible for signing. + RunnerEnvironment: + type: "string" + description: |- + Specifies whether the build took place in platform-hosted cloud infrastructure or customer/self-hosted infrastructure. + SourceRepositoryURI: + type: "string" + description: |- + Source repository URL that the build was based on. + SourceRepositoryDigest: + type: "string" + description: |- + Immutable reference to a specific version of the source code that the build was based upon. + SourceRepositoryRef: + type: "string" + description: |- + Source Repository Ref that the build run was based upon. + SourceRepositoryIdentifier: + type: "string" + description: |- + Immutable identifier for the source repository the workflow was based upon. + SourceRepositoryOwnerURI: + type: "string" + description: |- + Source repository owner URL of the owner of the source repository that the build was based on. + SourceRepositoryOwnerIdentifier: + type: "string" + description: |- + Immutable identifier for the owner of the source repository that the workflow was based upon. + BuildConfigURI: + type: "string" + description: |- + Build Config URL to the top-level/initiating build instructions. + BuildConfigDigest: + type: "string" + description: |- + Immutable reference to the specific version of the top-level/initiating build instructions. + BuildTrigger: + type: "string" + description: |- + Event or action that initiated the build. + RunInvocationURI: + type: "string" + description: |- + Run Invocation URL to uniquely identify the build execution. + SourceRepositoryVisibilityAtSigning: + type: "string" + description: |- + Source repository visibility at the time of signing the certificate. + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + ImagesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/image" + description: | + represents system data usage for image resources. + properties: + ActiveCount: + description: | + Count of active images. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all images. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing unused images. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by images. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of image summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + AuthResponse: + description: | + An identity token was generated successfully. + type: "object" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + example: "Login Succeeded" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + example: "9cbaf023786cd7..." + x-nullable: false + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + x-nullable: false + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/volume" + description: | + represents system data usage for volume resources. + properties: + ActiveCount: + description: | + Count of active volumes. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all volumes. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive volumes. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by volumes. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of volumes. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Volume + + VolumeCreateRequest: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateRequest" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + x-omitempty: false + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + x-go-name: "ID" + x-omitempty: false + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-omitempty: false + x-go-type: + type: Time + import: + package: time + hints: + nullable: false + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + x-omitempty: false + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + x-omitempty: false + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + x-omitempty: false + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + x-omitempty: false + example: false + IPAM: + description: | + The network's IP Address Management. + $ref: "#/definitions/IPAM" + x-nullable: false + x-omitempty: false + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + x-nullable: false + x-omitempty: false + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + x-omitempty: false + x-nullable: false + default: false + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: | + Metadata specific to the network being created. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + x-omitempty: true + items: + $ref: "#/definitions/PeerInfo" + + NetworkSummary: + description: "Network list response item" + x-go-name: Summary + type: "object" + allOf: + - $ref: "#/definitions/Network" + + NetworkInspect: + description: 'The body of the "get network" http response message.' + x-go-name: Inspect + type: "object" + allOf: + - $ref: "#/definitions/Network" + properties: + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + x-omitempty: false + additionalProperties: + $ref: "#/definitions/EndpointResource" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Services: + description: | + List of services using the network. This field is only present for + swarm scope networks, and omitted for local scope networks. + type: "object" + x-omitempty: true + additionalProperties: + x-go-type: + type: ServiceInfo + hints: + nullable: false + Status: + description: > + provides runtime information about the network + such as the number of allocated IPs. + $ref: "#/definitions/NetworkStatus" + + NetworkStatus: + description: > + provides runtime information about the network + such as the number of allocated IPs. + type: "object" + x-go-name: Status + properties: + IPAM: + $ref: "#/definitions/IPAMStatus" + + ServiceInfo: + x-nullable: false + x-omitempty: false + description: > + represents service parameters with the list of service's tasks + type: "object" + properties: + VIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Ports: + type: "array" + x-omitempty: false + items: + type: "string" + LocalLBIndex: + type: "integer" + format: "int" + x-omitempty: false + x-go-type: + type: int + Tasks: + type: "array" + x-omitempty: false + items: + $ref: "#/definitions/NetworkTaskInfo" + + NetworkTaskInfo: + x-nullable: false + x-omitempty: false + x-go-name: Task + description: > + carries the information about one backend task + type: "object" + properties: + Name: + type: "string" + x-omitempty: false + EndpointID: + type: "string" + x-omitempty: false + EndpointIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Info: + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + + ConfigReference: + x-nullable: false + x-omitempty: false + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + x-omitempty: false + example: "config_only_network_01" + + IPAM: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + IPAMStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Subnets: + type: "object" + additionalProperties: + $ref: "#/definitions/SubnetStatus" + example: + "172.16.0.0/16": + IPsInUse: 3 + DynamicIPsAvailable: 65533 + "2001:db8:abcd:0012::0/96": + IPsInUse: 5 + DynamicIPsAvailable: 4294967291 + x-go-type: + type: SubnetStatuses + kind: map + + SubnetStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + IPsInUse: + description: > + Number of IP addresses in the subnet that are in use or reserved and + are therefore unavailable for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + DynamicIPsAvailable: + description: > + Number of IP addresses within the network's IPRange for the subnet + that are available for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + + EndpointResource: + type: "object" + description: > + contains network resources allocated and used for a + container in a network. + properties: + Name: + type: "string" + x-omitempty: false + example: "container_1" + EndpointID: + type: "string" + x-omitempty: false + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + x-omitempty: false + example: "02:42:ac:13:00:02" + x-go-type: + type: HardwareAddr + IPv4Address: + type: "string" + x-omitempty: false + example: "172.19.0.2/16" + x-go-type: + type: Prefix + import: + package: net/netip + IPv6Address: + type: "string" + x-omitempty: false + example: "" + x-go-type: + type: Prefix + import: + package: net/netip + + PeerInfo: + description: > + represents one peer of an overlay network. + type: "object" + x-nullable: false + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "10.133.77.91" + x-go-type: + type: Addr + import: + package: net/netip + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + BuildCacheDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/build" + description: | + represents system data usage for build cache resources. + properties: + ActiveCount: + description: | + Count of active build cache records. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all build cache records. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive build cache records. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by build cache records. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of build cache records. + type: "array" + x-omitempty: true + items: + x-go-type: + type: CacheRecord + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + NRIInfo: + description: | + Information about the Node Resource Interface (NRI). + + This field is only present if NRI is enabled. + type: "object" + x-nullable: true + properties: + Info: + description: | + Information about NRI, provided as "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["plugin-path", "/opt/docker/nri/plugins"] + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + NetworkConnectRequest: + description: | + NetworkConnectRequest represents the data to be used to connect a container to a network. + type: "object" + x-go-name: "ConnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + x-nullable: false + example: "3613f73ba0e4" + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + x-nullable: true + + NetworkDisconnectRequest: + description: | + NetworkDisconnectRequest represents the data to be used to disconnect a container from a network. + type: "object" + x-go-name: "DisconnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to disconnect from the network." + x-nullable: false + example: "3613f73ba0e4" + Force: + type: "boolean" + description: "Force the container to disconnect from the network." + default: false + x-nullable: false + x-omitempty: false + example: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + x-go-type: + type: HardwareAddr + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + x-go-type: + type: Addr + import: + package: net/netip + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + x-go-type: + type: Addr + import: + package: net/netip + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + x-go-type: + type: Addr + import: + package: net/netip + LinkLocalIPs: + type: "array" + items: + type: "string" + x-go-type: + type: Addr + import: + package: net/netip + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-go-name: "Mount" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + x-go-name: "Device" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-go-name: "Env" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "Privilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + x-go-name: "Plugin" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "user-configurable settings for the plugin." + type: "object" + x-go-name: "Settings" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-go-name: "PluginReference" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-go-name: "Config" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + x-go-name: "Interface" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + type: "string" + x-go-type: + type: "CapabilityID" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-go-name: "User" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-go-name: "NetworkConfig" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-go-name: "LinuxConfig" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-go-name: "Args" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + x-go-name: "RootFS" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + SwapBytes: + description: | + Amount of swap in bytes - can only be used together with a memory limit. + If not specified, the default behaviour is to grant a swap space twice + as big as the memory limit. + Set to -1 to enable unlimited swap. + type: "integer" + format: "int64" + minimum: -1 + x-nullable: true + x-omitempty: true + MemorySwappiness: + description: | + Tune the service's containers' memory swappiness (0 to 100). + If not specified, defaults to the containers' OS' default, generally 60, + or whatever value was predefined in the image. + Set to -1 to unset a previously set value. + type: "integer" + format: "int64" + minimum: -1 + maximum: 100 + x-nullable: true + x-omitempty: true + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + x-nullable: true + Storage: + $ref: "#/definitions/Storage" + x-nullable: true + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/PortSummary" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + Health: + type: "object" + description: |- + Summary of health status + + Added in v1.52, before that version all container summary not include Health. + After this attribute introduced, it includes containers with no health checks configured, + or containers that are not running with none + properties: + Status: + type: "string" + description: |- + the health status of the container + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + + ContainersDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/container" + description: | + represents system data usage information for container resources. + properties: + ActiveCount: + description: | + Count of active containers. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all containers. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive containers. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by containers. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of container summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + id: + description: | + ID of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + name: + description: | + Name of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "boring_wozniak" + os_type: + description: | + OSType is the OS of the container ("linux" or "windows") to allow + platform-specific handling of stats. + type: "string" + x-nullable: true + example: "linux" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + NRI: + $ref: "#/definitions/NRIInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Identity: + description: | + Identity holds information about the identity and origin of this image. + For image list responses, this can duplicate Build/Pull fields across + image manifests, because those parts are image-level metadata. + x-nullable: true + $ref: "#/definitions/Identity" + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + - name: "identity" + in: "query" + description: "Include `Identity` in each manifest summary. Requires `manifests=1`." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + $ref: "#/definitions/AuthResponse" + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/jsonl" + - "application/x-ndjson" + - "application/json-seq" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + ImageUsage: + $ref: "#/definitions/ImagesDiskUsage" + ContainerUsage: + $ref: "#/definitions/ContainersDiskUsage" + VolumeUsage: + $ref: "#/definitions/VolumesDiskUsage" + BuildCacheUsage: + $ref: "#/definitions/BuildCacheDiskUsage" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + - name: "verbose" + in: "query" + description: | + Show detailed information on space usage. + type: "boolean" + default: false + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to be saved if the image is + multi-platform. If not provided, the full multi-platform image + will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to load if the image is + multi-platform. If not provided, the full multi-platform image + will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateRequest" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/NetworkSummary" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/NetworkInspect" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkConnectRequest" + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkDisconnectRequest" + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + > **Deprecated**: This endpoint is deprecated and will be removed in a future version. + > Server should support gRPC directly on the listening socket. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.55.yaml b/_vendor/github.com/moby/moby/api/docs/v1.55.yaml new file mode 100644 index 000000000000..72cf3de4d80b --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.55.yaml @@ -0,0 +1,13998 @@ +# A Swagger 2.0 (a.k.a. OpenAPI) definition of the Engine API. +# +# This is used for generating API documentation and the types used by the +# client/server. See api/README.md for more information. +# +# Some style notes: +# - This file is used by ReDoc, which allows GitHub Flavored Markdown in +# descriptions. +# - There is no maximum line length, for ease of editing and pretty diffs. +# - operationIds are in the format "NounVerb", with a singular noun. + +swagger: "2.0" +schemes: + - "http" + - "https" +produces: + - "application/json" + - "text/plain" +consumes: + - "application/json" + - "text/plain" +basePath: "/v1.55" +info: + title: "Docker Engine API" + version: "1.55" + x-logo: + url: "https://docs.docker.com/assets/images/logo-docker-main.png" + description: | + The Engine API is an HTTP API served by Docker Engine. It is the API the + Docker client uses to communicate with the Engine, so everything the Docker + client can do can be done with the API. + + Most of the client's commands map directly to API endpoints (e.g. `docker ps` + is `GET /containers/json`). The notable exception is running containers, + which consists of several API calls. + + # Errors + + The API uses standard HTTP status codes to indicate the success or failure + of the API call. The body of the response will be JSON in the following + format: + + ``` + { + "message": "page not found" + } + ``` + + # Versioning + + The API is usually changed in each release, so API calls are versioned to + ensure that clients don't break. To lock to a specific version of the API, + you prefix the URL with its version, for example, call `/v1.30/info` to use + the v1.30 version of the `/info` endpoint. If the API version specified in + the URL is not supported by the daemon, a HTTP `400 Bad Request` error message + is returned. + + If you omit the version-prefix, the current version of the API is used. + For example, calling `/info` is the same as calling `/v1.55/info`. Using the + API without a version-prefix is deprecated and will be removed in a future release. + + Engine releases in the near future should support this version of the API, + so your client will continue to work even if it is talking to a newer Engine. + + The API uses an open schema model, which means the server may add extra properties + to responses. Likewise, the server will ignore any extra query parameters and + request body properties. When you write clients, you need to ignore additional + properties in responses to ensure they do not break when talking to newer + daemons. + + + # Authentication + + Authentication for registries is handled client side. The client has to send + authentication details to various endpoints that need to communicate with + registries, such as `POST /images/(name)/push`. These are sent as + `X-Registry-Auth` header as a [base64url encoded](https://tools.ietf.org/html/rfc4648#section-5) + (JSON) string with the following structure: + + ``` + { + "username": "string", + "password": "string", + "serveraddress": "string" + } + ``` + + The `serveraddress` is a domain/IP without a protocol. Throughout this + structure, double quotes are required. + + If you have already got an identity token from the [`/auth` endpoint](#operation/SystemAuth), + you can just pass this instead of credentials: + + ``` + { + "identitytoken": "9cbaf023786cd7..." + } + ``` + +# The tags on paths define the menu sections in the ReDoc documentation, so +# the usage of tags must make sense for that: +# - They should be singular, not plural. +# - There should not be too many tags, or the menu becomes unwieldy. For +# example, it is preferable to add a path to the "System" tag instead of +# creating a tag with a single path in it. +# - The order of tags in this list defines the order in the menu. +tags: + # Primary objects + - name: "Container" + x-displayName: "Containers" + description: | + Create and manage containers. + - name: "Image" + x-displayName: "Images" + - name: "Network" + x-displayName: "Networks" + description: | + Networks are user-defined networks that containers can be attached to. + See the [networking documentation](https://docs.docker.com/network/) + for more information. + - name: "Volume" + x-displayName: "Volumes" + description: | + Create and manage persistent storage that can be attached to containers. + - name: "Exec" + x-displayName: "Exec" + description: | + Run new commands inside running containers. Refer to the + [command-line reference](https://docs.docker.com/engine/reference/commandline/exec/) + for more information. + + To exec a command in a container, you first need to create an exec instance, + then start it. These two API endpoints are wrapped up in a single command-line + command, `docker exec`. + + # Swarm things + - name: "Swarm" + x-displayName: "Swarm" + description: | + Engines can be clustered together in a swarm. Refer to the + [swarm mode documentation](https://docs.docker.com/engine/swarm/) + for more information. + - name: "Node" + x-displayName: "Nodes" + description: | + Nodes are instances of the Engine participating in a swarm. Swarm mode + must be enabled for these endpoints to work. + - name: "Service" + x-displayName: "Services" + description: | + Services are the definitions of tasks to run on a swarm. Swarm mode must + be enabled for these endpoints to work. + - name: "Task" + x-displayName: "Tasks" + description: | + A task is a container running on a swarm. It is the atomic scheduling unit + of swarm. Swarm mode must be enabled for these endpoints to work. + - name: "Secret" + x-displayName: "Secrets" + description: | + Secrets are sensitive data that can be used by services. Swarm mode must + be enabled for these endpoints to work. + - name: "Config" + x-displayName: "Configs" + description: | + Configs are application configurations that can be used by services. Swarm + mode must be enabled for these endpoints to work. + # System things + - name: "Plugin" + x-displayName: "Plugins" + - name: "System" + x-displayName: "System" + +definitions: + ImageHistoryResponseItem: + type: "object" + x-go-name: HistoryResponseItem + title: "HistoryResponseItem" + description: "individual image layer information in response to ImageHistory operation" + required: [Id, Created, CreatedBy, Tags, Size, Comment] + properties: + Id: + type: "string" + x-nullable: false + Created: + type: "integer" + format: "int64" + x-nullable: false + CreatedBy: + type: "string" + x-nullable: false + Tags: + type: "array" + items: + type: "string" + Size: + type: "integer" + format: "int64" + x-nullable: false + Comment: + type: "string" + x-nullable: false + PortSummary: + type: "object" + description: | + Describes a port-mapping between the container and the host. + required: [PrivatePort, Type] + properties: + IP: + type: "string" + format: "ip-address" + description: "Host IP address that the container's port is mapped to" + x-go-type: + type: Addr + import: + package: net/netip + PrivatePort: + type: "integer" + format: "uint16" + x-nullable: false + description: "Port on the container" + PublicPort: + type: "integer" + format: "uint16" + description: "Port exposed on the host" + Type: + type: "string" + x-nullable: false + enum: ["tcp", "udp", "sctp"] + example: + PrivatePort: 8080 + PublicPort: 80 + Type: "tcp" + + MountType: + description: |- + The mount type. Available types: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + type: "string" + enum: + - "bind" + - "cluster" + - "image" + - "npipe" + - "tmpfs" + - "volume" + example: "volume" + + MountPoint: + type: "object" + description: | + MountPoint represents a mount point configuration inside the container. + This is used for reporting the mountpoints in use by a container. + properties: + Type: + description: | + The mount type: + + - `bind` a mount of a file or directory from the host into the container. + - `cluster` a Swarm cluster volume. + - `image` an OCI image. + - `npipe` a named pipe from the host into the container. + - `tmpfs` a `tmpfs`. + - `volume` a docker volume with the given `Name`. + allOf: + - $ref: "#/definitions/MountType" + example: "volume" + Name: + description: | + Name is the name reference to the underlying data defined by `Source` + e.g., the volume name. + type: "string" + example: "myvolume" + Source: + description: | + Source location of the mount. + + For volumes, this contains the storage location of the volume (within + `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains + the source (host) part of the bind-mount. For `tmpfs` mount points, this + field is empty. + type: "string" + example: "/var/lib/docker/volumes/myvolume/_data" + Destination: + description: | + Destination is the path relative to the container root (`/`) where + the `Source` is mounted inside the container. + type: "string" + example: "/usr/share/nginx/html/" + Driver: + description: | + Driver is the volume driver used to create the volume (if it is a volume). + type: "string" + example: "local" + Mode: + description: | + Mode is a comma separated list of options supplied by the user when + creating the bind/volume mount. + + The default is platform-specific (`"z"` on Linux, empty on Windows). + type: "string" + example: "z" + RW: + description: | + Whether the mount is mounted writable (read-write). + type: "boolean" + example: true + Propagation: + description: | + Propagation describes how mounts are propagated from the host into the + mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) + for details. This field is not used on Windows. + type: "string" + example: "" + + DeviceMapping: + type: "object" + description: "A device mapping between the host and container" + properties: + PathOnHost: + type: "string" + PathInContainer: + type: "string" + CgroupPermissions: + type: "string" + example: + PathOnHost: "/dev/deviceName" + PathInContainer: "/dev/deviceName" + CgroupPermissions: "mrw" + + DeviceRequest: + type: "object" + description: "A request for devices to be sent to device drivers" + properties: + Driver: + description: | + The name of the device driver to use for this request. + + Note that if this is specified the capabilities are ignored when + selecting a device driver. + type: "string" + example: "nvidia" + Count: + type: "integer" + example: -1 + DeviceIDs: + type: "array" + items: + type: "string" + example: + - "0" + - "1" + - "GPU-fef8089b-4820-abfc-e83e-94318197576e" + Capabilities: + description: | + A list of capabilities; an OR list of AND lists of capabilities. + + Note that if a driver is specified the capabilities have no effect on + selecting a driver as the driver name is used directly. + + Note that if no driver is specified the capabilities are used to + select a driver with the required capabilities. + type: "array" + items: + type: "array" + items: + type: "string" + example: + # gpu AND nvidia AND compute + - ["gpu", "nvidia", "compute"] + Options: + description: | + Driver-specific options, specified as a key/value pairs. These options + are passed directly to the driver. + type: "object" + additionalProperties: + type: "string" + + ThrottleDevice: + type: "object" + properties: + Path: + description: "Device path" + type: "string" + Rate: + description: "Rate" + type: "integer" + format: "int64" + minimum: 0 + + Mount: + type: "object" + properties: + Target: + description: "Container path." + type: "string" + Source: + description: |- + Mount source (e.g. a volume name, a host path). The source cannot be + specified when using `Type=tmpfs`. For `Type=bind`, the source path + must either exist, or the `CreateMountpoint` must be set to `true` to + create the source path on the host if missing. + + For `Type=npipe`, the pipe must exist prior to creating the container. + type: "string" + Type: + description: | + The mount type. Available types: + + - `bind` Mounts a file or directory from the host into the container. The `Source` must exist prior to creating the container. + - `cluster` a Swarm cluster volume + - `image` Mounts an image. + - `npipe` Mounts a named pipe from the host into the container. The `Source` must exist prior to creating the container. + - `tmpfs` Create a tmpfs with the given options. The mount `Source` cannot be specified for tmpfs. + - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + allOf: + - $ref: "#/definitions/MountType" + ReadOnly: + description: "Whether the mount should be read-only." + type: "boolean" + Consistency: + description: "The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`." + type: "string" + BindOptions: + description: "Optional configuration for the `bind` type." + type: "object" + properties: + Propagation: + description: "A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`." + type: "string" + enum: + - "private" + - "rprivate" + - "shared" + - "rshared" + - "slave" + - "rslave" + NonRecursive: + description: "Disable recursive bind mount." + type: "boolean" + default: false + CreateMountpoint: + description: "Create mount point on host if missing" + type: "boolean" + default: false + ReadOnlyNonRecursive: + description: | + Make the mount non-recursively read-only, but still leave the mount recursive + (unless NonRecursive is set to `true` in conjunction). + + Added in v1.44, before that version all read-only mounts were + non-recursive by default. To match the previous behaviour this + will default to `true` for clients on versions prior to v1.44. + type: "boolean" + default: false + ReadOnlyForceRecursive: + description: "Raise an error if the mount cannot be made recursively read-only." + type: "boolean" + default: false + VolumeOptions: + description: "Optional configuration for the `volume` type." + type: "object" + properties: + NoCopy: + description: "Populate volume with data from the target." + type: "boolean" + default: false + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + DriverConfig: + description: "Map of driver specific options" + type: "object" + properties: + Name: + description: "Name of the driver to use to create the volume." + type: "string" + Options: + description: "key/value map of driver specific options." + type: "object" + additionalProperties: + type: "string" + Subpath: + description: "Source path inside the volume. Must be relative without any back traversals." + type: "string" + example: "dir-inside-volume/subdirectory" + ImageOptions: + description: "Optional configuration for the `image` type." + type: "object" + properties: + Subpath: + description: "Source path inside the image. Must be relative without any back traversals." + type: "string" + example: "dir-inside-image/subdirectory" + TmpfsOptions: + description: "Optional configuration for the `tmpfs` type." + type: "object" + properties: + SizeBytes: + description: "The size for the tmpfs mount in bytes." + type: "integer" + format: "int64" + Mode: + description: | + The permission mode for the tmpfs mount in an integer. + The value must not be in octal format (e.g. 755) but rather + the decimal representation of the octal value (e.g. 493). + type: "integer" + Options: + description: | + The options to be passed to the tmpfs mount. An array of arrays. + Flag options should be provided as 1-length arrays. Other types + should be provided as as 2-length arrays, where the first item is + the key and the second the value. + type: "array" + items: + type: "array" + minItems: 1 + maxItems: 2 + items: + type: "string" + example: + [["noexec"]] + + RestartPolicy: + description: | + The behavior to apply when the container exits. The default is not to + restart. + + An ever increasing delay (double the previous delay, starting at 100ms) is + added before each restart to prevent flooding the server. + type: "object" + properties: + Name: + type: "string" + description: | + - Empty string means not to restart + - `no` Do not automatically restart + - `always` Always restart + - `unless-stopped` Restart always except when the user has manually stopped the container + - `on-failure` Restart only when the container exit code is non-zero + enum: + - "" + - "no" + - "always" + - "unless-stopped" + - "on-failure" + MaximumRetryCount: + type: "integer" + description: | + If `on-failure` is used, the number of times to retry before giving up. + + Resources: + description: "A container's resources (cgroups config, ulimits, etc)" + type: "object" + properties: + # Applicable to all platforms + CpuShares: + description: | + An integer value representing this container's relative CPU weight + versus other containers. + type: "integer" + Memory: + description: "Memory limit in bytes." + type: "integer" + format: "int64" + default: 0 + # Applicable to UNIX platforms + CgroupParent: + description: | + Path to `cgroups` under which the container's `cgroup` is created. If + the path is not absolute, the path is considered to be relative to the + `cgroups` path of the init process. Cgroups are created if they do not + already exist. + type: "string" + BlkioWeight: + description: "Block IO weight (relative weight)." + type: "integer" + minimum: 0 + maximum: 1000 + BlkioWeightDevice: + description: | + Block IO weight (relative device weight) in the form: + + ``` + [{"Path": "device_path", "Weight": weight}] + ``` + type: "array" + items: + type: "object" + properties: + Path: + type: "string" + Weight: + type: "integer" + minimum: 0 + BlkioDeviceReadBps: + description: | + Limit read rate (bytes per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteBps: + description: | + Limit write rate (bytes per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceReadIOps: + description: | + Limit read rate (IO per second) from a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + BlkioDeviceWriteIOps: + description: | + Limit write rate (IO per second) to a device, in the form: + + ``` + [{"Path": "device_path", "Rate": rate}] + ``` + type: "array" + items: + $ref: "#/definitions/ThrottleDevice" + CpuPeriod: + description: "The length of a CPU period in microseconds." + type: "integer" + format: "int64" + CpuQuota: + description: | + Microseconds of CPU time that the container can get in a CPU period. + type: "integer" + format: "int64" + CpuRealtimePeriod: + description: | + The length of a CPU real-time period in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpuRealtimeRuntime: + description: | + The length of a CPU real-time runtime in microseconds. Set to 0 to + allocate no time allocated to real-time tasks. + type: "integer" + format: "int64" + CpusetCpus: + description: | + CPUs in which to allow execution (e.g., `0-3`, `0,1`). + type: "string" + example: "0-3" + CpusetMems: + description: | + Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only + effective on NUMA systems. + type: "string" + Devices: + description: "A list of devices to add to the container." + type: "array" + items: + $ref: "#/definitions/DeviceMapping" + DeviceCgroupRules: + description: "a list of cgroup rules to apply to the container" + type: "array" + items: + type: "string" + example: "c 13:* rwm" + DeviceRequests: + description: | + A list of requests for devices to be sent to device drivers. + type: "array" + items: + $ref: "#/definitions/DeviceRequest" + MemoryReservation: + description: "Memory soft limit in bytes." + type: "integer" + format: "int64" + MemorySwap: + description: | + Total memory limit (memory + swap). Set as `-1` to enable unlimited + swap. + type: "integer" + format: "int64" + MemorySwappiness: + description: | + Tune a container's memory swappiness behavior. Accepts an integer + between 0 and 100. + type: "integer" + format: "int64" + minimum: 0 + maximum: 100 + NanoCpus: + description: "CPU quota in units of 10<sup>-9</sup> CPUs." + type: "integer" + format: "int64" + OomKillDisable: + description: "Disable OOM Killer for the container." + type: "boolean" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + PidsLimit: + description: | + Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` + to not change. + type: "integer" + format: "int64" + x-nullable: true + Ulimits: + description: | + A list of resource limits to set in the container. For example: + + ``` + {"Name": "nofile", "Soft": 1024, "Hard": 2048} + ``` + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + # Applicable to Windows + CpuCount: + description: | + The number of usable CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + CpuPercent: + description: | + The usable percentage of the available CPUs (Windows only). + + On Windows Server containers, the processor resource controls are + mutually exclusive. The order of precedence is `CPUCount` first, then + `CPUShares`, and `CPUPercent` last. + type: "integer" + format: "int64" + IOMaximumIOps: + description: "Maximum IOps for the container system drive (Windows only)" + type: "integer" + format: "int64" + IOMaximumBandwidth: + description: | + Maximum IO in bytes per second for the container system drive + (Windows only). + type: "integer" + format: "int64" + + Limit: + description: | + An object describing a limit on resources which can be requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + Pids: + description: | + Limits the maximum number of PIDs in the container. Set `0` for unlimited. + type: "integer" + format: "int64" + default: 0 + example: 100 + + ResourceObject: + description: | + An object describing the resources which can be advertised by a node and + requested by a task. + type: "object" + properties: + NanoCPUs: + type: "integer" + format: "int64" + example: 4000000000 + MemoryBytes: + type: "integer" + format: "int64" + example: 8272408576 + GenericResources: + $ref: "#/definitions/GenericResources" + + GenericResources: + description: | + User-defined resources can be either Integer resources (e.g, `SSD=3`) or + String resources (e.g, `GPU=UUID1`). + type: "array" + items: + type: "object" + properties: + NamedResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "string" + DiscreteResourceSpec: + type: "object" + properties: + Kind: + type: "string" + Value: + type: "integer" + format: "int64" + example: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + HealthConfig: + description: | + A test to perform to check that the container is healthy. + Healthcheck commands should be side-effect free. + type: "object" + properties: + Test: + description: | + The test to perform. Possible values are: + + - `[]` inherit healthcheck from image or parent image + - `["NONE"]` disable healthcheck + - `["CMD", args...]` exec arguments directly + - `["CMD-SHELL", command]` run command with system's default shell + + A non-zero exit code indicates a failed healthcheck: + - `0` healthy + - `1` unhealthy + - `2` reserved (treated as unhealthy) + - other values: error running probe + type: "array" + items: + type: "string" + Interval: + description: | + The time to wait between checks in nanoseconds. It should be 0 or at + least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + Timeout: + description: | + The time to wait before considering the check to have hung. It should + be 0 or at least 1000000 (1 ms). 0 means inherit. + + If the health check command does not complete within this timeout, + the check is considered failed and the health check process is + forcibly terminated without a graceful shutdown. + type: "integer" + format: "int64" + Retries: + description: | + The number of consecutive failures needed to consider a container as + unhealthy. 0 means inherit. + type: "integer" + StartPeriod: + description: | + Start period for the container to initialize before starting + health-retries countdown in nanoseconds. It should be 0 or at least + 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + StartInterval: + description: | + The time to wait between checks in nanoseconds during the start period. + It should be 0 or at least 1000000 (1 ms). 0 means inherit. + type: "integer" + format: "int64" + + Health: + description: | + Health stores information about the container's healthcheck results. + type: "object" + x-nullable: true + properties: + Status: + description: | + Status is one of `none`, `starting`, `healthy` or `unhealthy` + + - "none" Indicates there is no healthcheck + - "starting" Starting indicates that the container is not yet ready + - "healthy" Healthy indicates that the container is running correctly + - "unhealthy" Unhealthy indicates that the container has a problem + type: "string" + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + Log: + type: "array" + description: | + Log contains the last few results (oldest first) + items: + $ref: "#/definitions/HealthcheckResult" + + HealthcheckResult: + description: | + HealthcheckResult stores information about a single run of a healthcheck probe + type: "object" + x-nullable: true + properties: + Start: + description: | + Date and time at which this check started in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "date-time" + example: "2020-01-04T10:44:24.496525531Z" + End: + description: | + Date and time at which this check ended in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2020-01-04T10:45:21.364524523Z" + ExitCode: + description: | + ExitCode meanings: + + - `0` healthy + - `1` unhealthy + - `2` reserved (considered unhealthy) + - other values: error running probe + type: "integer" + example: 0 + Output: + description: "Output from last check" + type: "string" + + HostConfig: + description: "Container configuration that depends on the host we are running on" + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + # Applicable to all platforms + Binds: + type: "array" + description: | + A list of volume bindings for this container. Each volume binding + is a string in one of these forms: + + - `host-src:container-dest[:options]` to bind-mount a host path + into the container. Both `host-src`, and `container-dest` must + be an _absolute_ path. + - `volume-name:container-dest[:options]` to bind-mount a volume + managed by a volume driver into the container. `container-dest` + must be an _absolute_ path. + + `options` is an optional, comma-delimited list of: + + - `nocopy` disables automatic copying of data from the container + path to the volume. The `nocopy` flag only applies to named volumes. + - `[ro|rw]` mounts a volume read-only or read-write, respectively. + If omitted or set to `rw`, volumes are mounted read-write. + - `[z|Z]` applies SELinux labels to allow or deny multiple containers + to read and write to the same volume. + - `z`: a _shared_ content label is applied to the content. This + label indicates that multiple containers can share the volume + content, for both reading and writing. + - `Z`: a _private unshared_ label is applied to the content. + This label indicates that only the current container can use + a private volume. Labeling systems such as SELinux require + proper labels to be placed on volume content that is mounted + into a container. Without a label, the security system can + prevent a container's processes from using the content. By + default, the labels set by the host operating system are not + modified. + - `[[r]shared|[r]slave|[r]private]` specifies mount + [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + This only applies to bind-mounted volumes, not internal volumes + or named volumes. Mount propagation requires the source mount + point (the location where the source directory is mounted in the + host operating system) to have the correct propagation properties. + For shared volumes, the source mount point must be set to `shared`. + For slave volumes, the mount must be set to either `shared` or + `slave`. + items: + type: "string" + ContainerIDFile: + type: "string" + description: "Path to a file where the container ID is written" + example: "" + LogConfig: + type: "object" + description: "The logging configuration for this container" + properties: + Type: + description: |- + Name of the logging driver used for the container or "none" + if logging is disabled. + type: "string" + enum: + - "local" + - "json-file" + - "syslog" + - "journald" + - "gelf" + - "fluentd" + - "awslogs" + - "splunk" + - "etwlogs" + - "none" + Config: + description: |- + Driver-specific configuration options for the logging driver. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "5" + "max-size": "10m" + NetworkMode: + type: "string" + description: | + Network mode to use for this container. Supported standard values + are: `bridge`, `host`, `none`, and `container:<name|id>`. Any + other value is taken as a custom network's name to which this + container should connect to. + PortBindings: + $ref: "#/definitions/PortMap" + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + AutoRemove: + type: "boolean" + description: | + Automatically remove the container when the container's process + exits. This has no effect if `RestartPolicy` is set. + VolumeDriver: + type: "string" + description: "Driver that this container uses to mount volumes." + VolumesFrom: + type: "array" + description: | + A list of volumes to inherit from another container, specified in + the form `<container name>[:<ro|rw>]`. + items: + type: "string" + Mounts: + description: | + Specification for mounts to be added to the container. + type: "array" + items: + $ref: "#/definitions/Mount" + ConsoleSize: + type: "array" + description: | + Initial console size, as an `[height, width]` array. + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + Annotations: + type: "object" + description: | + Arbitrary non-identifying metadata attached to container and + provided to the runtime when the container is started. + additionalProperties: + type: "string" + + # Applicable to UNIX platforms + CapAdd: + type: "array" + description: | + A list of kernel capabilities to add to the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CapDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the container. Conflicts + with option 'Capabilities'. + items: + type: "string" + CgroupnsMode: + type: "string" + enum: + - "private" + - "host" + description: | + cgroup namespace mode for the container. Possible values are: + + - `"private"`: the container runs in its own private cgroup namespace + - `"host"`: use the host system's cgroup namespace + + If not specified, the daemon default is used, which can either be `"private"` + or `"host"`, depending on daemon version, kernel support and configuration. + Dns: + type: "array" + description: "A list of DNS servers for the container to use." + items: + type: "string" + format: "ip-address" + x-go-type: + type: Addr + import: + package: net/netip + DnsOptions: + type: "array" + description: "A list of DNS options." + items: + type: "string" + DnsSearch: + type: "array" + description: "A list of DNS search domains." + items: + type: "string" + ExtraHosts: + type: "array" + description: | + A list of hostnames/IP mappings to add to the container's `/etc/hosts` + file. Specified in the form `["hostname:IP"]`. + items: + type: "string" + GroupAdd: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + IpcMode: + type: "string" + description: | + IPC sharing mode for the container. Possible values are: + + - `"none"`: own private IPC namespace, with /dev/shm not mounted + - `"private"`: own private IPC namespace + - `"shareable"`: own private IPC namespace, with a possibility to share it with other containers + - `"container:<name|id>"`: join another (shareable) container's IPC namespace + - `"host"`: use the host system's IPC namespace + + If not specified, daemon default is used, which can either be `"private"` + or `"shareable"`, depending on daemon version and configuration. + Cgroup: + type: "string" + description: "Cgroup to use for the container." + Links: + type: "array" + description: | + A list of links for the container in the form `container_name:alias`. + items: + type: "string" + OomScoreAdj: + type: "integer" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 500 + PidMode: + type: "string" + description: | + Set the PID (Process) Namespace mode for the container. It can be + either: + + - `"container:<name|id>"`: joins another container's PID namespace + - `"host"`: use the host's PID namespace inside the container + Privileged: + type: "boolean" + description: |- + Gives the container full access to the host. + PublishAllPorts: + type: "boolean" + description: | + Allocates an ephemeral host port for all of a container's + exposed ports. + + Ports are de-allocated when the container stops and allocated when + the container starts. The allocated port might be changed when + restarting the container. + + The port is selected from the ephemeral port range that depends on + the kernel. For example, on Linux the range is defined by + `/proc/sys/net/ipv4/ip_local_port_range`. + ReadonlyRootfs: + type: "boolean" + description: "Mount the container's root filesystem as read only." + SecurityOpt: + type: "array" + description: | + A list of string values to customize labels for MLS systems, such + as SELinux. + items: + type: "string" + StorageOpt: + type: "object" + description: | + Storage driver options for this container, in the form `{"size": "120G"}`. + additionalProperties: + type: "string" + Tmpfs: + type: "object" + description: | + A map of container directories which should be replaced by tmpfs + mounts, and their corresponding mount options. For example: + + ``` + { "/run": "rw,noexec,nosuid,size=65536k" } + ``` + additionalProperties: + type: "string" + UTSMode: + type: "string" + description: "UTS namespace to use for the container." + UsernsMode: + type: "string" + description: | + Sets the usernamespace mode for the container when usernamespace + remapping option is enabled. + ShmSize: + type: "integer" + format: "int64" + description: | + Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. + minimum: 0 + Sysctls: + type: "object" + x-nullable: true + description: |- + A list of kernel parameters (sysctls) to set in the container. + + This field is omitted if not set. + additionalProperties: + type: "string" + example: + "net.ipv4.ip_forward": "1" + Runtime: + type: "string" + x-nullable: true + description: |- + Runtime to use with this container. + # Applicable to Windows + Isolation: + type: "string" + description: | + Isolation technology of the container. (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + MaskedPaths: + type: "array" + description: | + The list of paths to be masked inside the container (this overrides + the default set of paths). + items: + type: "string" + example: + - "/proc/asound" + - "/proc/acpi" + - "/proc/kcore" + - "/proc/keys" + - "/proc/latency_stats" + - "/proc/timer_list" + - "/proc/timer_stats" + - "/proc/sched_debug" + - "/proc/scsi" + - "/sys/firmware" + - "/sys/devices/virtual/powercap" + ReadonlyPaths: + type: "array" + description: | + The list of paths to be set as read-only inside the container + (this overrides the default set of paths). + items: + type: "string" + example: + - "/proc/bus" + - "/proc/fs" + - "/proc/irq" + - "/proc/sys" + - "/proc/sysrq-trigger" + + ContainerConfig: + description: | + Configuration for a container that is portable between hosts. + type: "object" + properties: + Hostname: + description: | + The hostname to use for the container, as a valid RFC 1123 hostname. + type: "string" + example: "439f4e91bd1d" + Domainname: + description: | + The domain name to use for the container. + type: "string" + User: + description: |- + Commands run as this user inside the container. If omitted, commands + run as the user specified in the image the container was started from. + + Can be either user-name or UID, and optional group-name or GID, + separated by a colon (`<user-name|UID>[<:group-name|GID>]`). + type: "string" + example: "123:456" + AttachStdin: + description: "Whether to attach to `stdin`." + type: "boolean" + default: false + AttachStdout: + description: "Whether to attach to `stdout`." + type: "boolean" + default: true + AttachStderr: + description: "Whether to attach to `stderr`." + type: "boolean" + default: true + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Tty: + description: | + Attach standard streams to a TTY, including `stdin` if it is not closed. + type: "boolean" + default: false + OpenStdin: + description: "Open `stdin`" + type: "boolean" + default: false + StdinOnce: + description: "Close `stdin` after one attached client disconnects" + type: "boolean" + default: false + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Image: + description: | + The name (or reference) of the image to use when creating the container, + or which was used when the container was created. + type: "string" + example: "example-image:1.0" + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + NetworkDisabled: + description: "Disable networking for the container." + type: "boolean" + x-nullable: true + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + StopTimeout: + description: "Timeout to stop a container in seconds." + type: "integer" + default: 10 + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + ImageConfig: + description: | + Configuration of the image. These fields are used as defaults + when starting a container from the image. + type: "object" + properties: + User: + description: "The user that commands are run as inside the container." + type: "string" + example: "web:web" + ExposedPorts: + description: | + An object mapping ports to an empty object in the form: + + `{"<port>/<tcp|udp|sctp>": {}}` + type: "object" + x-nullable: true + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: { + "80/tcp": {}, + "443/tcp": {} + } + Env: + description: | + A list of environment variables to set inside the container in the + form `["VAR=value", ...]`. A variable without `=` is removed from the + environment, rather than to have an empty value. + type: "array" + items: + type: "string" + example: + - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + Cmd: + description: | + Command to run specified as a string or an array of strings. + type: "array" + items: + type: "string" + example: ["/bin/sh"] + Healthcheck: + $ref: "#/definitions/HealthConfig" + ArgsEscaped: + description: "Command is already escaped (Windows only)" + type: "boolean" + default: false + example: false + x-nullable: true + Volumes: + description: | + An object mapping mount point paths inside the container to empty + objects. + type: "object" + additionalProperties: + type: "object" + enum: + - {} + default: {} + example: + "/app/data": {} + "/app/config": {} + WorkingDir: + description: "The working directory for commands to run in." + type: "string" + example: "/public/" + Entrypoint: + description: | + The entry point for the container as a string or an array of strings. + + If the array consists of exactly one empty string (`[""]`) then the + entry point is reset to system default (i.e., the entry point used by + docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). + type: "array" + items: + type: "string" + example: [] + OnBuild: + description: | + `ONBUILD` metadata that were defined in the image's `Dockerfile`. + type: "array" + x-nullable: true + items: + type: "string" + example: [] + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + StopSignal: + description: | + Signal to stop a container as a string or unsigned integer. + type: "string" + example: "SIGTERM" + x-nullable: true + Shell: + description: | + Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. + type: "array" + x-nullable: true + items: + type: "string" + example: ["/bin/sh", "-c"] + + NetworkingConfig: + description: | + NetworkingConfig represents the container's networking configuration for + each of its interfaces. + It is used for the networking configs specified in the `docker create` + and `docker network connect` commands. + type: "object" + properties: + EndpointsConfig: + description: | + A mapping of network name to endpoint configuration for that network. + The endpoint configuration can be left empty to connect to that + network with no particular endpoint configuration. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + example: + # putting an example here, instead of using the example values from + # /definitions/EndpointSettings, because EndpointSettings contains + # operational data returned when inspecting a container that we don't + # accept here. + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + MacAddress: "02:42:ac:12:05:02" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + NetworkSettings: + description: "NetworkSettings exposes the network settings in the API" + type: "object" + properties: + SandboxID: + description: SandboxID uniquely represents a container's network stack. + type: "string" + example: "9d12daf2c33f5959c8bf90aa513e4f65b561738661003029ec84830cd503a0c3" + SandboxKey: + description: SandboxKey is the full path of the netns handle + type: "string" + example: "/var/run/docker/netns/8ab54b426c38" + Ports: + $ref: "#/definitions/PortMap" + Networks: + description: | + Information about all networks that the container is connected to. + type: "object" + additionalProperties: + $ref: "#/definitions/EndpointSettings" + + Address: + description: Address represents an IPv4 or IPv6 IP address. + type: "object" + properties: + Addr: + description: IP address. + type: "string" + PrefixLen: + description: Mask length of the IP address. + type: "integer" + + PortMap: + description: | + PortMap describes the mapping of container ports to host ports, using the + container's port-number and protocol as key in the format `<port>/<protocol>`, + for example, `80/udp`. + + If a container's port is mapped for multiple protocols, separate entries + are added to the mapping table. + type: "object" + additionalProperties: + type: "array" + x-nullable: true + items: + $ref: "#/definitions/PortBinding" + example: + "443/tcp": + - HostIp: "127.0.0.1" + HostPort: "4443" + "80/tcp": + - HostIp: "0.0.0.0" + HostPort: "80" + - HostIp: "0.0.0.0" + HostPort: "8080" + "80/udp": + - HostIp: "0.0.0.0" + HostPort: "80" + "53/udp": + - HostIp: "0.0.0.0" + HostPort: "53" + "2377/tcp": null + + PortBinding: + description: | + PortBinding represents a binding between a host IP address and a host + port. + type: "object" + properties: + HostIp: + description: "Host IP address that the container's port is mapped to." + type: "string" + example: "127.0.0.1" + x-go-type: + type: Addr + import: + package: net/netip + HostPort: + description: "Host port number that the container's port is mapped to." + type: "string" + example: "4443" + + DriverData: + description: | + Information about the storage driver used to store the container's and + image's filesystem. + type: "object" + required: [Name, Data] + properties: + Name: + description: "Name of the storage driver." + type: "string" + x-nullable: false + example: "overlay2" + Data: + description: | + Low-level storage metadata, provided as key/value pairs. + + This information is driver-specific, and depends on the storage-driver + in use, and should be used for informational purposes only. + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: { + "MergedDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/merged", + "UpperDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/diff", + "WorkDir": "/var/lib/docker/overlay2/ef749362d13333e65fc95c572eb525abbe0052e16e086cb64bc3b98ae9aa6d74/work" + } + + Storage: + description: | + Information about the storage used by the container. + type: "object" + properties: + RootFS: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorage" + + RootFSStorage: + description: | + Information about the storage used for the container's root filesystem. + type: "object" + x-go-name: RootFSStorage + properties: + Snapshot: + description: | + Information about the snapshot used for the container's root filesystem. + type: "object" + x-nullable: true + $ref: "#/definitions/RootFSStorageSnapshot" + + RootFSStorageSnapshot: + description: | + Information about a snapshot backend of the container's root filesystem. + type: "object" + x-go-name: RootFSStorageSnapshot + properties: + Name: + description: "Name of the snapshotter." + type: "string" + x-nullable: false + + FilesystemChange: + description: | + Change in the container's filesystem. + type: "object" + required: [Path, Kind] + properties: + Path: + description: | + Path to file or directory that has changed. + type: "string" + x-nullable: false + Kind: + $ref: "#/definitions/ChangeType" + + ChangeType: + description: | + Kind of change + + Can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + type: "integer" + format: "uint8" + enum: [0, 1, 2] + x-nullable: false + + ImageInspect: + description: | + Information about an image in the local image cache. + type: "object" + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + Manifests: + description: | + Manifests is a list of image manifests available in this image. It + provides a more detailed view of the platform-specific image manifests or + other image-attached data like build attestations. + + Only available if the daemon provides a multi-platform image store + and the `manifests` option is set in the inspect request. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: true + items: + $ref: "#/definitions/ImageManifestSummary" + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + x-nullable: true + $ref: "#/definitions/Identity" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Comment: + description: | + Optional message that was set when committing or importing the image. + type: "string" + x-nullable: true + example: "" + Created: + description: | + Date and time at which the image was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if present in the image, + and omitted otherwise. + type: "string" + format: "dateTime" + x-nullable: true + example: "2022-02-04T21:20:12.497794809Z" + Author: + description: | + Name of the author that was specified when committing the image, or as + specified through MAINTAINER (deprecated) in the Dockerfile. + type: "string" + x-nullable: true + example: "" + Config: + $ref: "#/definitions/ImageConfig" + Architecture: + description: | + Hardware CPU architecture that the image runs on. + type: "string" + x-nullable: false + example: "arm" + Variant: + description: | + CPU architecture variant (presently ARM-only). + type: "string" + x-nullable: true + example: "v7" + Os: + description: | + Operating System the image is built to run on. + type: "string" + x-nullable: false + example: "linux" + OsVersion: + description: | + Operating System version the image is built to run on (especially + for Windows). + type: "string" + example: "" + x-nullable: true + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + GraphDriver: + x-nullable: true + $ref: "#/definitions/DriverData" + RootFS: + description: | + Information about the image's RootFS, including the layer IDs. + type: "object" + required: [Type] + properties: + Type: + type: "string" + x-nullable: false + example: "layers" + Layers: + type: "array" + items: + type: "string" + example: + - "sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6" + - "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef" + Metadata: + description: | + Additional metadata of the image in the local cache. This information + is local to the daemon, and not part of the image itself. + type: "object" + properties: + LastTagTime: + description: | + Date and time at which the image was last tagged in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + + This information is only available if the image was tagged locally, + and omitted otherwise. + type: "string" + format: "dateTime" + example: "2022-02-28T14:40:02.623929178Z" + x-nullable: true + + Identity: + description: |- + Identity holds information about the identity and origin of the image. + This is trusted information verified by the daemon and cannot be modified + by tagging an image to a different name. + type: "object" + properties: + Signature: + description: |- + Signature contains the properties of verified signatures for the image. + type: "array" + items: + $ref: "#/definitions/SignatureIdentity" + Pull: + description: |- + Pull contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + After successful push this images also contains the pushed repository location. + type: "array" + items: + $ref: "#/definitions/PullIdentity" + Build: + description: |- + Build contains build reference information if image was created via build. + type: "array" + items: + $ref: "#/definitions/BuildIdentity" + + BuildIdentity: + description: |- + BuildIdentity contains build reference information if image was created via build. + type: "object" + properties: + Ref: + description: |- + Ref is the identifier for the build request. This reference can be used to + look up the build details in BuildKit history API. + type: "string" + CreatedAt: + description: |- + CreatedAt is the time when the build ran. + type: "string" + format: "date-time" + + PullIdentity: + description: |- + PullIdentity contains remote location information if image was created via pull. + If image was pulled via mirror, this contains the original repository location. + type: "object" + properties: + Repository: + description: |- + Repository is the remote repository location the image was pulled from. + type: "string" + + SignatureIdentity: + description: |- + SignatureIdentity contains the properties of verified signatures for the image. + type: "object" + properties: + Name: + description: |- + Name is a textual description summarizing the type of signature. + type: "string" + Timestamps: + description: |- + Timestamps contains a list of verified signed timestamps for the signature. + type: "array" + items: + $ref: "#/definitions/SignatureTimestamp" + KnownSigner: + description: |- + KnownSigner is an identifier for a special signer identity that is known to the implementation. + $ref: "#/definitions/KnownSignerIdentity" + DockerReference: + description: |- + DockerReference is the Docker image reference associated with the signature. + This is an optional field only present in older hashedrecord signatures. + type: "string" + Signer: + description: |- + Signer contains information about the signer certificate used to sign the image. + $ref: "#/definitions/SignerIdentity" + SignatureType: + description: |- + SignatureType is the type of signature format. E.g. "bundle-v0.3" or "hashedrecord". + $ref: "#/definitions/SignatureType" + Error: + description: |- + Error contains error information if signature verification failed. + Other fields will be empty in this case. + type: "string" + Warnings: + description: |- + Warnings contains any warnings that occurred during signature verification. + For example, if there was no internet connectivity and cached trust roots were used. + Warning does not indicate a failed verification but may point to configuration issues. + type: "array" + items: + type: "string" + + SignatureTimestamp: + description: |- + SignatureTimestamp contains information about a verified signed timestamp for an image signature. + type: "object" + properties: + Type: + $ref: "#/definitions/SignatureTimestampType" + URI: + type: "string" + Timestamp: + type: "string" + format: "date-time" + + SignatureTimestampType: + description: |- + SignatureTimestampType is the type of timestamp used in the signature. + type: "string" + enum: + - "Tlog" + - "TimestampAuthority" + + SignatureType: + description: |- + SignatureType is the type of signature format. + type: "string" + enum: + - "bundle-v0.3" + - "simplesigning-v1" + + KnownSignerIdentity: + description: |- + KnownSignerIdentity is an identifier for a special signer identity that is known to the implementation. + type: "string" + enum: + - "DHI" + + SignerIdentity: + description: |- + SignerIdentity contains information about the signer certificate used to sign the image. + type: "object" + properties: + CertificateIssuer: + type: "string" + description: |- + CertificateIssuer is the certificate issuer. + SubjectAlternativeName: + type: "string" + description: |- + SubjectAlternativeName is the certificate subject alternative name. + Issuer: + type: "string" + description: |- + The OIDC issuer. Should match `iss` claim of ID token or, in the case of + a federated login like Dex it should match the issuer URL of the + upstream issuer. The issuer is not set the extensions are invalid and + will fail to render. + BuildSignerURI: + type: "string" + description: |- + Reference to specific build instructions that are responsible for signing. + BuildSignerDigest: + type: "string" + description: |- + Immutable reference to the specific version of the build instructions that is responsible for signing. + RunnerEnvironment: + type: "string" + description: |- + Specifies whether the build took place in platform-hosted cloud infrastructure or customer/self-hosted infrastructure. + SourceRepositoryURI: + type: "string" + description: |- + Source repository URL that the build was based on. + SourceRepositoryDigest: + type: "string" + description: |- + Immutable reference to a specific version of the source code that the build was based upon. + SourceRepositoryRef: + type: "string" + description: |- + Source Repository Ref that the build run was based upon. + SourceRepositoryIdentifier: + type: "string" + description: |- + Immutable identifier for the source repository the workflow was based upon. + SourceRepositoryOwnerURI: + type: "string" + description: |- + Source repository owner URL of the owner of the source repository that the build was based on. + SourceRepositoryOwnerIdentifier: + type: "string" + description: |- + Immutable identifier for the owner of the source repository that the workflow was based upon. + BuildConfigURI: + type: "string" + description: |- + Build Config URL to the top-level/initiating build instructions. + BuildConfigDigest: + type: "string" + description: |- + Immutable reference to the specific version of the top-level/initiating build instructions. + BuildTrigger: + type: "string" + description: |- + Event or action that initiated the build. + RunInvocationURI: + type: "string" + description: |- + Run Invocation URL to uniquely identify the build execution. + SourceRepositoryVisibilityAtSigning: + type: "string" + description: |- + Source repository visibility at the time of signing the certificate. + + ImageSummary: + type: "object" + x-go-name: "Summary" + required: + - Id + - ParentId + - RepoTags + - RepoDigests + - Created + - Size + - SharedSize + - Labels + - Containers + properties: + Id: + description: | + ID is the content-addressable ID of an image. + + This identifier is a content-addressable digest calculated from the + image's configuration (which includes the digests of layers used by + the image). + + Note that this digest differs from the `RepoDigests` below, which + holds digests of image manifests that reference the image. + type: "string" + x-nullable: false + example: "sha256:ec3f0931a6e6b6855d76b2d7b0be30e81860baccd891b2e243280bf1cd8ad710" + ParentId: + description: | + ID of the parent image. + + Depending on how the image was created, this field may be empty and + is only set for images that were built/created locally. This field + is empty if the image was pulled from an image registry. + type: "string" + x-nullable: false + example: "" + RepoTags: + description: | + List of image names/tags in the local image cache that reference this + image. + + Multiple image tags can refer to the same image, and this list may be + empty if no tags reference the image, in which case the image is + "untagged", in which case it can still be referenced by its ID. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example:1.0" + - "example:latest" + - "example:stable" + - "internal.registry.example.com:5000/example:1.0" + RepoDigests: + description: | + List of content-addressable digests of locally available image manifests + that the image is referenced from. Multiple manifests can refer to the + same image. + + These digests are usually only available if the image was either pulled + from a registry, or if the image was pushed to a registry, which is when + the manifest is generated and its digest calculated. + type: "array" + x-nullable: false + items: + type: "string" + example: + - "example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb" + - "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578" + Created: + description: | + Date and time at which the image was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + x-nullable: false + example: "1644009612" + Size: + description: | + Total size of the image including all layers it is composed of. + type: "integer" + format: "int64" + x-nullable: false + example: 172064416 + SharedSize: + description: | + Total size of image layers that are shared between this image and other + images. + + This size is not calculated by default. `-1` indicates that the value + has not been set / calculated. + type: "integer" + format: "int64" + x-nullable: false + example: 1239828 + Labels: + description: "User-defined key/value metadata." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Containers: + description: | + Number of containers using this image. Includes both stopped and running + containers. + + `-1` indicates that the value has not been set / calculated. + x-nullable: false + type: "integer" + example: 2 + Manifests: + description: | + Manifests is a list of manifests available in this image. + It provides a more detailed view of the platform-specific image manifests + or other image-attached data like build attestations. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + type: "array" + x-nullable: false + x-omitempty: true + items: + $ref: "#/definitions/ImageManifestSummary" + Descriptor: + description: | + Descriptor is an OCI descriptor of the image target. + In case of a multi-platform image, this descriptor points to the OCI index + or a manifest list. + + This field is only present if the daemon provides a multi-platform image store. + + WARNING: This is experimental and may change at any time without any backward + compatibility. + x-nullable: true + $ref: "#/definitions/OCIDescriptor" + + ImagesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/image" + description: | + represents system data usage for image resources. + properties: + ActiveCount: + description: | + Count of active images. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all images. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing unused images. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by images. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of image summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + AuthConfig: + type: "object" + properties: + username: + type: "string" + password: + type: "string" + serveraddress: + type: "string" + example: + username: "hannibal" + password: "xxxx" + serveraddress: "https://index.docker.io/v1/" + + AuthResponse: + description: | + An identity token was generated successfully. + type: "object" + required: [Status] + properties: + Status: + description: "The status of the authentication" + type: "string" + example: "Login Succeeded" + x-nullable: false + IdentityToken: + description: "An opaque token used to authenticate a user after a successful login" + type: "string" + example: "9cbaf023786cd7..." + x-nullable: false + + ProcessConfig: + type: "object" + properties: + privileged: + type: "boolean" + user: + type: "string" + tty: + type: "boolean" + entrypoint: + type: "string" + arguments: + type: "array" + items: + type: "string" + + Volume: + type: "object" + required: [Name, Driver, Mountpoint, Labels, Scope, Options] + x-nullable: false + properties: + Name: + type: "string" + description: "Name of the volume." + x-nullable: false + example: "tardis" + Driver: + type: "string" + description: "Name of the volume driver used by the volume." + x-nullable: false + example: "custom" + Mountpoint: + type: "string" + description: "Mount path of the volume on the host." + x-nullable: false + example: "/var/lib/docker/volumes/tardis" + CreatedAt: + type: "string" + format: "dateTime" + description: "Date/Time the volume was created." + example: "2016-06-07T20:31:11.853781916Z" + Status: + type: "object" + description: | + Low-level details about the volume, provided by the volume driver. + Details are returned as a map with key/value pairs: + `{"key":"value","key2":"value2"}`. + + The `Status` field is optional, and is omitted if the volume driver + does not support this feature. + additionalProperties: + type: "object" + example: + hello: "world" + Labels: + type: "object" + description: "User-defined key/value metadata." + x-nullable: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Scope: + type: "string" + description: | + The level at which the volume exists. Either `global` for cluster-wide, + or `local` for machine level. + default: "local" + x-nullable: false + enum: ["local", "global"] + example: "local" + ClusterVolume: + $ref: "#/definitions/ClusterVolume" + Options: + type: "object" + description: | + The driver specific options used when creating the volume. + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + UsageData: + type: "object" + x-nullable: true + x-go-name: "UsageData" + required: [Size, RefCount] + description: | + Usage details about the volume. This information is used by the + `GET /system/df` endpoint, and omitted in other endpoints. + properties: + Size: + type: "integer" + format: "int64" + default: -1 + description: | + Amount of disk space used by the volume (in bytes). This information + is only available for volumes created with the `"local"` volume + driver. For volumes created with other volume drivers, this field + is set to `-1` ("not available") + x-nullable: false + RefCount: + type: "integer" + format: "int64" + default: -1 + description: | + The number of containers referencing this volume. This field + is set to `-1` if the reference-count is not available. + x-nullable: false + + VolumesDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/volume" + description: | + represents system data usage for volume resources. + properties: + ActiveCount: + description: | + Count of active volumes. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all volumes. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive volumes. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by volumes. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of volumes. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Volume + + VolumeCreateRequest: + description: "Volume configuration" + type: "object" + title: "VolumeConfig" + x-go-name: "CreateRequest" + properties: + Name: + description: | + The new volume's name. If not specified, Docker generates a name. + type: "string" + x-nullable: false + example: "tardis" + Driver: + description: "Name of the volume driver to use." + type: "string" + default: "local" + x-nullable: false + example: "custom" + DriverOpts: + description: | + A mapping of driver options and values. These options are + passed directly to the driver and are driver specific. + type: "object" + additionalProperties: + type: "string" + example: + device: "tmpfs" + o: "size=100m,uid=1000" + type: "tmpfs" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + ClusterVolumeSpec: + $ref: "#/definitions/ClusterVolumeSpec" + + VolumeListResponse: + type: "object" + title: "VolumeListResponse" + x-go-name: "ListResponse" + description: "Volume list response" + properties: + Volumes: + type: "array" + description: "List of volumes" + items: + $ref: "#/definitions/Volume" + Warnings: + type: "array" + description: | + Warnings that occurred when fetching the list of volumes. + items: + type: "string" + example: [] + + Network: + type: "object" + properties: + Name: + description: | + Name of the network. + type: "string" + example: "my_network" + x-omitempty: false + Id: + description: | + ID that uniquely identifies a network on a single machine. + type: "string" + x-go-name: "ID" + x-omitempty: false + example: "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99" + Created: + description: | + Date and time at which the network was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-omitempty: false + x-go-type: + type: Time + import: + package: time + hints: + nullable: false + example: "2016-10-19T04:33:30.360899459Z" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level) + type: "string" + x-omitempty: false + example: "local" + Driver: + description: | + The name of the driver used to create the network (e.g. `bridge`, + `overlay`). + type: "string" + x-omitempty: false + example: "overlay" + EnableIPv4: + description: | + Whether the network was created with IPv4 enabled. + type: "boolean" + x-omitempty: false + example: true + EnableIPv6: + description: | + Whether the network was created with IPv6 enabled. + type: "boolean" + x-omitempty: false + example: false + IPAM: + description: | + The network's IP Address Management. + $ref: "#/definitions/IPAM" + x-nullable: false + x-omitempty: false + Internal: + description: | + Whether the network is created to only allow internal networking + connectivity. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Attachable: + description: | + Whether a global / swarm scope network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + Ingress: + description: | + Whether the network is providing the routing-mesh for the swarm cluster. + type: "boolean" + x-nullable: false + x-omitempty: false + default: false + example: false + ConfigFrom: + $ref: "#/definitions/ConfigReference" + x-nullable: false + x-omitempty: false + ConfigOnly: + description: | + Whether the network is a config-only network. Config-only networks are + placeholder networks for network configurations to be used by other + networks. Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + x-omitempty: false + x-nullable: false + default: false + Options: + description: | + Network-specific options uses when creating the network. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: | + Metadata specific to the network being created. + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Peers: + description: | + List of peer nodes for an overlay network. This field is only present + for overlay networks, and omitted for other network types. + type: "array" + x-omitempty: true + items: + $ref: "#/definitions/PeerInfo" + + NetworkSummary: + description: "Network list response item" + x-go-name: Summary + type: "object" + allOf: + - $ref: "#/definitions/Network" + + NetworkInspect: + description: 'The body of the "get network" http response message.' + x-go-name: Inspect + type: "object" + allOf: + - $ref: "#/definitions/Network" + properties: + Containers: + description: | + Contains endpoints attached to the network. + type: "object" + x-omitempty: false + additionalProperties: + $ref: "#/definitions/EndpointResource" + example: + 19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c: + Name: "test" + EndpointID: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: "02:42:ac:13:00:02" + IPv4Address: "172.19.0.2/16" + IPv6Address: "" + Services: + description: | + List of services using the network. This field is only present for + swarm scope networks, and omitted for local scope networks. + type: "object" + x-omitempty: true + additionalProperties: + x-go-type: + type: ServiceInfo + hints: + nullable: false + Status: + description: > + provides runtime information about the network + such as the number of allocated IPs. + $ref: "#/definitions/NetworkStatus" + + NetworkStatus: + description: > + provides runtime information about the network + such as the number of allocated IPs. + type: "object" + x-go-name: Status + properties: + IPAM: + $ref: "#/definitions/IPAMStatus" + + ServiceInfo: + x-nullable: false + x-omitempty: false + description: > + represents service parameters with the list of service's tasks + type: "object" + properties: + VIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Ports: + type: "array" + x-omitempty: false + items: + type: "string" + LocalLBIndex: + type: "integer" + format: "int" + x-omitempty: false + x-go-type: + type: int + Tasks: + type: "array" + x-omitempty: false + items: + $ref: "#/definitions/NetworkTaskInfo" + + NetworkTaskInfo: + x-nullable: false + x-omitempty: false + x-go-name: Task + description: > + carries the information about one backend task + type: "object" + properties: + Name: + type: "string" + x-omitempty: false + EndpointID: + type: "string" + x-omitempty: false + EndpointIP: + type: "string" + x-omitempty: false + x-go-type: + type: Addr + import: + package: net/netip + Info: + type: "object" + x-omitempty: false + additionalProperties: + type: "string" + + ConfigReference: + x-nullable: false + x-omitempty: false + description: | + The config-only network source to provide the configuration for + this network. + type: "object" + properties: + Network: + description: | + The name of the config-only network that provides the network's + configuration. The specified network must be an existing config-only + network. Only network names are allowed, not network IDs. + type: "string" + x-omitempty: false + example: "config_only_network_01" + + IPAM: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Driver: + description: "Name of the IPAM driver to use." + type: "string" + default: "default" + example: "default" + Config: + description: | + List of IPAM configuration options, specified as a map: + + ``` + {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>} + ``` + type: "array" + items: + $ref: "#/definitions/IPAMConfig" + Options: + description: "Driver-specific options, specified as a map." + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + + IPAMConfig: + type: "object" + properties: + Subnet: + type: "string" + example: "172.20.0.0/16" + IPRange: + type: "string" + example: "172.20.10.0/24" + Gateway: + type: "string" + example: "172.20.10.11" + AuxiliaryAddresses: + type: "object" + additionalProperties: + type: "string" + + IPAMStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + Subnets: + type: "object" + additionalProperties: + $ref: "#/definitions/SubnetStatus" + example: + "172.16.0.0/16": + IPsInUse: 3 + DynamicIPsAvailable: 65533 + "2001:db8:abcd:0012::0/96": + IPsInUse: 5 + DynamicIPsAvailable: 4294967291 + x-go-type: + type: SubnetStatuses + kind: map + + SubnetStatus: + type: "object" + x-nullable: false + x-omitempty: false + properties: + IPsInUse: + description: > + Number of IP addresses in the subnet that are in use or reserved and + are therefore unavailable for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + DynamicIPsAvailable: + description: > + Number of IP addresses within the network's IPRange for the subnet + that are available for allocation, saturating at 2<sup>64</sup> - 1. + type: integer + format: uint64 + x-omitempty: false + + EndpointResource: + type: "object" + description: > + contains network resources allocated and used for a + container in a network. + properties: + Name: + type: "string" + x-omitempty: false + example: "container_1" + EndpointID: + type: "string" + x-omitempty: false + example: "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a" + MacAddress: + type: "string" + x-omitempty: false + example: "02:42:ac:13:00:02" + x-go-type: + type: HardwareAddr + IPv4Address: + type: "string" + x-omitempty: false + example: "172.19.0.2/16" + x-go-type: + type: Prefix + import: + package: net/netip + IPv6Address: + type: "string" + x-omitempty: false + example: "" + x-go-type: + type: Prefix + import: + package: net/netip + + PeerInfo: + description: > + represents one peer of an overlay network. + type: "object" + x-nullable: false + properties: + Name: + description: + ID of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "6869d7c1732b" + IP: + description: + IP-address of the peer-node in the Swarm cluster. + type: "string" + x-omitempty: false + example: "10.133.77.91" + x-go-type: + type: Addr + import: + package: net/netip + + NetworkCreateResponse: + description: "OK response to NetworkCreate operation" + type: "object" + title: "NetworkCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warning] + properties: + Id: + description: "The ID of the created network." + type: "string" + x-nullable: false + example: "b5c4fc71e8022147cd25de22b22173de4e3b170134117172eb595cb91b4e7e5d" + Warning: + description: "Warnings encountered when creating the container" + type: "string" + x-nullable: false + example: "" + + BuildInfo: + type: "object" + properties: + id: + type: "string" + stream: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + aux: + $ref: "#/definitions/ImageID" + + BuildCache: + type: "object" + description: | + BuildCache contains information about a build cache record. + properties: + ID: + type: "string" + description: | + Unique ID of the build cache record. + example: "ndlpt0hhvkqcdfkputsk4cq9c" + Parents: + description: | + List of parent build cache record IDs. + type: "array" + items: + type: "string" + x-nullable: true + example: ["hw53o5aio51xtltp5xjp8v7fx"] + Type: + type: "string" + description: | + Cache record type. + example: "regular" + # see https://github.com/moby/buildkit/blob/fce4a32258dc9d9664f71a4831d5de10f0670677/client/diskusage.go#L75-L84 + enum: + - "internal" + - "frontend" + - "source.local" + - "source.git.checkout" + - "exec.cachemount" + - "regular" + Description: + type: "string" + description: | + Description of the build-step that produced the build cache. + example: "mount / from exec /bin/sh -c echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache" + InUse: + type: "boolean" + description: | + Indicates if the build cache is in use. + example: false + Shared: + type: "boolean" + description: | + Indicates if the build cache is shared. + example: true + Size: + description: | + Amount of disk space used by the build cache (in bytes). + type: "integer" + example: 51 + CreatedAt: + description: | + Date and time at which the build cache was created in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + LastUsedAt: + description: | + Date and time at which the build cache was last used in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2017-08-09T07:09:37.632105588Z" + UsageCount: + type: "integer" + example: 26 + + BuildCacheDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/build" + description: | + represents system data usage for build cache resources. + properties: + ActiveCount: + description: | + Count of active build cache records. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all build cache records. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive build cache records. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by build cache records. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of build cache records. + type: "array" + x-omitempty: true + items: + x-go-type: + type: CacheRecord + + ImageID: + type: "object" + description: "Image ID or Digest" + properties: + ID: + type: "string" + example: + ID: "sha256:85f05633ddc1c50679be2b16a0479ab6f7637f8884e0cfe0f4d20e1ebb3d6e7c" + + CreateImageInfo: + type: "object" + properties: + id: + type: "string" + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + PushImageInfo: + type: "object" + properties: + errorDetail: + $ref: "#/definitions/ErrorDetail" + status: + type: "string" + progressDetail: + $ref: "#/definitions/ProgressDetail" + + DeviceInfo: + type: "object" + description: | + DeviceInfo represents a device that can be used by a container. + properties: + Source: + type: "string" + example: "cdi" + description: | + The origin device driver. + ID: + type: "string" + example: "vendor.com/gpu=0" + description: | + The unique identifier for the device within its source driver. + For CDI devices, this would be an FQDN like "vendor.com/gpu=0". + + NRIInfo: + description: | + Information about the Node Resource Interface (NRI). + + This field is only present if NRI is enabled. + type: "object" + x-nullable: true + properties: + Info: + description: | + Information about NRI, provided as "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["plugin-path", "/opt/docker/nri/plugins"] + + ErrorDetail: + type: "object" + properties: + code: + type: "integer" + message: + type: "string" + + ProgressDetail: + type: "object" + properties: + current: + type: "integer" + total: + type: "integer" + + ErrorResponse: + description: "Represents an error." + type: "object" + required: ["message"] + properties: + message: + description: "The error message." + type: "string" + x-nullable: false + example: + message: "Something went wrong." + + IDResponse: + description: "Response to an API call that returns just an Id" + type: "object" + x-go-name: "IDResponse" + required: ["Id"] + properties: + Id: + description: "The id of the newly created object." + type: "string" + x-nullable: false + + NetworkConnectRequest: + description: | + NetworkConnectRequest represents the data to be used to connect a container to a network. + type: "object" + x-go-name: "ConnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to connect to the network." + x-nullable: false + example: "3613f73ba0e4" + EndpointConfig: + $ref: "#/definitions/EndpointSettings" + x-nullable: true + + NetworkDisconnectRequest: + description: | + NetworkDisconnectRequest represents the data to be used to disconnect a container from a network. + type: "object" + x-go-name: "DisconnectRequest" + required: ["Container"] + properties: + Container: + type: "string" + description: "The ID or name of the container to disconnect from the network." + x-nullable: false + example: "3613f73ba0e4" + Force: + type: "boolean" + description: "Force the container to disconnect from the network." + default: false + x-nullable: false + x-omitempty: false + example: false + + EndpointSettings: + description: "Configuration for a network endpoint." + type: "object" + properties: + # Configurations + IPAMConfig: + $ref: "#/definitions/EndpointIPAMConfig" + Links: + type: "array" + items: + type: "string" + example: + - "container_1" + - "container_2" + MacAddress: + description: | + MAC address for the endpoint on this network. The network driver might ignore this parameter. + type: "string" + example: "02:42:ac:11:00:04" + x-go-type: + type: HardwareAddr + Aliases: + type: "array" + items: + type: "string" + example: + - "server_x" + - "server_y" + DriverOpts: + description: | + DriverOpts is a mapping of driver options and values. These options + are passed directly to the driver and are driver specific. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + GwPriority: + description: | + This property determines which endpoint will provide the default + gateway for a container. The endpoint with the highest priority will + be used. If multiple endpoints have the same priority, endpoints are + lexicographically sorted based on their network name, and the one + that sorts first is picked. + type: "integer" + format: "int64" + example: + - 10 + + # Operational data + NetworkID: + description: | + Unique ID of the network. + type: "string" + example: "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a" + EndpointID: + description: | + Unique ID for the service endpoint in a Sandbox. + type: "string" + example: "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b" + Gateway: + description: | + Gateway address for this network. + type: "string" + example: "172.17.0.1" + IPAddress: + description: | + IPv4 address. + type: "string" + example: "172.17.0.4" + x-go-type: + type: Addr + import: + package: net/netip + IPPrefixLen: + description: | + Mask length of the IPv4 address. + type: "integer" + example: 16 + IPv6Gateway: + description: | + IPv6 gateway address. + type: "string" + example: "2001:db8:2::100" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6Address: + description: | + Global IPv6 address. + type: "string" + example: "2001:db8::5689" + x-go-type: + type: Addr + import: + package: net/netip + GlobalIPv6PrefixLen: + description: | + Mask length of the global IPv6 address. + type: "integer" + format: "int64" + example: 64 + DNSNames: + description: | + List of all DNS names an endpoint has on a specific network. This + list is based on the container name, network aliases, container short + ID, and hostname. + + These DNS names are non-fully qualified but can contain several dots. + You can get fully qualified DNS names by appending `.<network-name>`. + For instance, if container name is `my.ctr` and the network is named + `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be + `my.ctr.testnet`. + type: array + items: + type: string + example: ["foobar", "server_x", "server_y", "my.ctr"] + + EndpointIPAMConfig: + description: | + EndpointIPAMConfig represents an endpoint's IPAM configuration. + type: "object" + x-nullable: true + properties: + IPv4Address: + type: "string" + example: "172.20.30.33" + x-go-type: + type: Addr + import: + package: net/netip + IPv6Address: + type: "string" + example: "2001:db8:abcd::3033" + x-go-type: + type: Addr + import: + package: net/netip + LinkLocalIPs: + type: "array" + items: + type: "string" + x-go-type: + type: Addr + import: + package: net/netip + example: + - "169.254.34.68" + - "fe80::3468" + + PluginMount: + type: "object" + x-go-name: "Mount" + x-nullable: false + required: [Name, Description, Settable, Source, Destination, Type, Options] + properties: + Name: + type: "string" + x-nullable: false + example: "some-mount" + Description: + type: "string" + x-nullable: false + example: "This is a mount that's used by the plugin." + Settable: + type: "array" + items: + type: "string" + Source: + type: "string" + example: "/var/lib/docker/plugins/" + Destination: + type: "string" + x-nullable: false + example: "/mnt/state" + Type: + type: "string" + x-nullable: false + example: "bind" + Options: + type: "array" + items: + type: "string" + example: + - "rbind" + - "rw" + + PluginDevice: + type: "object" + x-go-name: "Device" + required: [Name, Description, Settable, Path] + x-nullable: false + properties: + Name: + type: "string" + x-nullable: false + Description: + type: "string" + x-nullable: false + Settable: + type: "array" + items: + type: "string" + Path: + type: "string" + example: "/dev/fuse" + + PluginEnv: + type: "object" + x-go-name: "Env" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + Description: + x-nullable: false + type: "string" + Settable: + type: "array" + items: + type: "string" + Value: + type: "string" + + PluginPrivilege: + description: | + Describes a permission the user has to accept upon installing + the plugin. + type: "object" + x-go-name: "Privilege" + properties: + Name: + type: "string" + example: "network" + Description: + type: "string" + Value: + type: "array" + items: + type: "string" + example: + - "host" + + Plugin: + description: "A plugin for the Engine API" + type: "object" + x-go-name: "Plugin" + required: [Settings, Enabled, Config, Name] + properties: + Id: + type: "string" + example: "5724e2c8652da337ab2eedd19fc6fc0ec908e4bd907c7421bf6a8dfc70c4c078" + Name: + type: "string" + x-nullable: false + example: "tiborvass/sample-volume-plugin" + Enabled: + description: + True if the plugin is running. False if the plugin is not running, + only installed. + type: "boolean" + x-nullable: false + example: true + Settings: + description: "user-configurable settings for the plugin." + type: "object" + x-go-name: "Settings" + x-nullable: false + required: [Args, Devices, Env, Mounts] + properties: + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + type: "string" + example: + - "DEBUG=0" + Args: + type: "array" + items: + type: "string" + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PluginReference: + description: "plugin remote reference used to push/pull the plugin" + type: "string" + x-go-name: "PluginReference" + x-nullable: false + example: "localhost:5000/tiborvass/sample-volume-plugin:latest" + Config: + description: "The config of a plugin." + type: "object" + x-go-name: "Config" + x-nullable: false + required: + - Description + - Documentation + - Interface + - Entrypoint + - WorkDir + - Network + - Linux + - PidHost + - PropagatedMount + - IpcHost + - Mounts + - Env + - Args + properties: + Description: + type: "string" + x-nullable: false + example: "A sample volume plugin for Docker" + Documentation: + type: "string" + x-nullable: false + example: "https://docs.docker.com/engine/extend/plugins/" + Interface: + description: "The interface between Docker and the plugin" + x-nullable: false + type: "object" + x-go-name: "Interface" + required: [Types, Socket] + properties: + Types: + type: "array" + items: + type: "string" + x-go-type: + type: "CapabilityID" + example: + - "docker.volumedriver/1.0" + Socket: + type: "string" + x-nullable: false + example: "plugins.sock" + ProtocolScheme: + type: "string" + example: "some.protocol/v1.0" + description: "Protocol to use for clients connecting to the plugin." + enum: + - "" + - "moby.plugins.http/v1" + Entrypoint: + type: "array" + items: + type: "string" + example: + - "/usr/bin/sample-volume-plugin" + - "/data" + WorkDir: + type: "string" + x-nullable: false + example: "/bin/" + User: + type: "object" + x-go-name: "User" + x-nullable: false + properties: + UID: + type: "integer" + format: "uint32" + example: 1000 + GID: + type: "integer" + format: "uint32" + example: 1000 + Network: + type: "object" + x-go-name: "NetworkConfig" + x-nullable: false + required: [Type] + properties: + Type: + x-nullable: false + type: "string" + example: "host" + Linux: + type: "object" + x-go-name: "LinuxConfig" + x-nullable: false + required: [Capabilities, AllowAllDevices, Devices] + properties: + Capabilities: + type: "array" + items: + type: "string" + example: + - "CAP_SYS_ADMIN" + - "CAP_SYSLOG" + AllowAllDevices: + type: "boolean" + x-nullable: false + example: false + Devices: + type: "array" + items: + $ref: "#/definitions/PluginDevice" + PropagatedMount: + type: "string" + x-nullable: false + example: "/mnt/volumes" + IpcHost: + type: "boolean" + x-nullable: false + example: false + PidHost: + type: "boolean" + x-nullable: false + example: false + Mounts: + type: "array" + items: + $ref: "#/definitions/PluginMount" + Env: + type: "array" + items: + $ref: "#/definitions/PluginEnv" + example: + - Name: "DEBUG" + Description: "If set, prints debug messages" + Settable: null + Value: "0" + Args: + type: "object" + x-go-name: "Args" + x-nullable: false + required: [Name, Description, Settable, Value] + properties: + Name: + x-nullable: false + type: "string" + example: "args" + Description: + x-nullable: false + type: "string" + example: "command line arguments" + Settable: + type: "array" + items: + type: "string" + Value: + type: "array" + items: + type: "string" + rootfs: + type: "object" + x-go-name: "RootFS" + properties: + type: + type: "string" + example: "layers" + diff_ids: + type: "array" + items: + type: "string" + example: + - "sha256:675532206fbf3030b8458f88d6e26d4eb1577688a25efec97154c94e8b6b4887" + - "sha256:e216a057b1cb1efc11f8a268f37ef62083e70b1b38323ba252e25ac88904a7e8" + + ObjectVersion: + description: | + The version number of the object such as node, service, etc. This is needed + to avoid conflicting writes. The client must send the version number along + with the modified specification when updating these objects. + + This approach ensures safe concurrency and determinism in that the change + on the object may not be applied if the version number has changed from the + last read. In other words, if two update requests specify the same base + version, only one of the requests can succeed. As a result, two separate + update requests that happen at the same time will not unintentionally + overwrite each other. + type: "object" + properties: + Index: + type: "integer" + format: "uint64" + example: 373531 + + NodeSpec: + type: "object" + properties: + Name: + description: "Name for the node." + type: "string" + example: "my-node" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Role: + description: "Role of the node." + type: "string" + enum: + - "worker" + - "manager" + example: "manager" + Availability: + description: "Availability of the node." + type: "string" + enum: + - "active" + - "pause" + - "drain" + example: "active" + example: + Availability: "active" + Name: "node-name" + Role: "manager" + Labels: + foo: "bar" + + Node: + type: "object" + properties: + ID: + type: "string" + example: "24ifsmvkjbyhk" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the node was added to the swarm in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the node was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/NodeSpec" + Description: + $ref: "#/definitions/NodeDescription" + Status: + $ref: "#/definitions/NodeStatus" + ManagerStatus: + $ref: "#/definitions/ManagerStatus" + + NodeDescription: + description: | + NodeDescription encapsulates the properties of the Node as reported by the + agent. + type: "object" + properties: + Hostname: + type: "string" + example: "bf3067039e47" + Platform: + $ref: "#/definitions/Platform" + Resources: + $ref: "#/definitions/ResourceObject" + Engine: + $ref: "#/definitions/EngineDescription" + TLSInfo: + $ref: "#/definitions/TLSInfo" + + Platform: + description: | + Platform represents the platform (Arch/OS). + type: "object" + properties: + Architecture: + description: | + Architecture represents the hardware architecture (for example, + `x86_64`). + type: "string" + example: "x86_64" + OS: + description: | + OS represents the Operating System (for example, `linux` or `windows`). + type: "string" + example: "linux" + + EngineDescription: + description: "EngineDescription provides information about an engine." + type: "object" + properties: + EngineVersion: + type: "string" + example: "17.06.0" + Labels: + type: "object" + additionalProperties: + type: "string" + example: + foo: "bar" + Plugins: + type: "array" + items: + type: "object" + properties: + Type: + type: "string" + Name: + type: "string" + example: + - Type: "Log" + Name: "awslogs" + - Type: "Log" + Name: "fluentd" + - Type: "Log" + Name: "gcplogs" + - Type: "Log" + Name: "gelf" + - Type: "Log" + Name: "journald" + - Type: "Log" + Name: "json-file" + - Type: "Log" + Name: "splunk" + - Type: "Log" + Name: "syslog" + - Type: "Network" + Name: "bridge" + - Type: "Network" + Name: "host" + - Type: "Network" + Name: "ipvlan" + - Type: "Network" + Name: "macvlan" + - Type: "Network" + Name: "null" + - Type: "Network" + Name: "overlay" + - Type: "Volume" + Name: "local" + - Type: "Volume" + Name: "localhost:5000/vieux/sshfs:latest" + - Type: "Volume" + Name: "vieux/sshfs:latest" + + TLSInfo: + description: | + Information about the issuer of leaf TLS certificates and the trusted root + CA certificate. + type: "object" + properties: + TrustRoot: + description: | + The root CA certificate(s) that are used to validate leaf TLS + certificates. + type: "string" + CertIssuerSubject: + description: + The base64-url-safe-encoded raw subject bytes of the issuer. + type: "string" + CertIssuerPublicKey: + description: | + The base64-url-safe-encoded raw public key bytes of the issuer. + type: "string" + example: + TrustRoot: | + -----BEGIN CERTIFICATE----- + MIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0 + MzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf + 3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO + PQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz + pxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H + -----END CERTIFICATE----- + CertIssuerSubject: "MBMxETAPBgNVBAMTCHN3YXJtLWNh" + CertIssuerPublicKey: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A==" + + NodeStatus: + description: | + NodeStatus represents the status of a node. + + It provides the current status of the node, as seen by the manager. + type: "object" + properties: + State: + $ref: "#/definitions/NodeState" + Message: + type: "string" + example: "" + Addr: + description: "IP address of the node." + type: "string" + example: "172.17.0.2" + + NodeState: + description: "NodeState represents the state of a node." + type: "string" + enum: + - "unknown" + - "down" + - "ready" + - "disconnected" + example: "ready" + + ManagerStatus: + description: | + ManagerStatus represents the status of a manager. + + It provides the current status of a node's manager component, if the node + is a manager. + x-nullable: true + type: "object" + properties: + Leader: + type: "boolean" + default: false + example: true + Reachability: + $ref: "#/definitions/Reachability" + Addr: + description: | + The IP address and port at which the manager is reachable. + type: "string" + example: "10.0.0.46:2377" + + Reachability: + description: "Reachability represents the reachability of a node." + type: "string" + enum: + - "unknown" + - "unreachable" + - "reachable" + example: "reachable" + + SwarmSpec: + description: "User modifiable swarm configuration." + type: "object" + properties: + Name: + description: "Name of the swarm." + type: "string" + example: "default" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.corp.type: "production" + com.example.corp.department: "engineering" + Orchestration: + description: "Orchestration configuration." + type: "object" + x-nullable: true + properties: + TaskHistoryRetentionLimit: + description: | + The number of historic tasks to keep per instance or node. If + negative, never remove completed or failed tasks. + type: "integer" + format: "int64" + example: 10 + Raft: + description: "Raft configuration." + type: "object" + properties: + SnapshotInterval: + description: "The number of log entries between snapshots." + type: "integer" + format: "uint64" + example: 10000 + KeepOldSnapshots: + description: | + The number of snapshots to keep beyond the current snapshot. + type: "integer" + format: "uint64" + LogEntriesForSlowFollowers: + description: | + The number of log entries to keep around to sync up slow followers + after a snapshot is created. + type: "integer" + format: "uint64" + example: 500 + ElectionTick: + description: | + The number of ticks that a follower will wait for a message from + the leader before becoming a candidate and starting an election. + `ElectionTick` must be greater than `HeartbeatTick`. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 3 + HeartbeatTick: + description: | + The number of ticks between heartbeats. Every HeartbeatTick ticks, + the leader will send a heartbeat to the followers. + + A tick currently defaults to one second, so these translate + directly to seconds currently, but this is NOT guaranteed. + type: "integer" + example: 1 + Dispatcher: + description: "Dispatcher configuration." + type: "object" + x-nullable: true + properties: + HeartbeatPeriod: + description: | + The delay for an agent to send a heartbeat to the dispatcher. + type: "integer" + format: "int64" + example: 5000000000 + CAConfig: + description: "CA configuration." + type: "object" + x-nullable: true + properties: + NodeCertExpiry: + description: "The duration node certificates are issued for." + type: "integer" + format: "int64" + example: 7776000000000000 + ExternalCAs: + description: | + Configuration for forwarding signing requests to an external + certificate authority. + type: "array" + items: + type: "object" + properties: + Protocol: + description: | + Protocol for communication with the external CA (currently + only `cfssl` is supported). + type: "string" + enum: + - "cfssl" + default: "cfssl" + URL: + description: | + URL where certificate signing requests should be sent. + type: "string" + Options: + description: | + An object with key/value pairs that are interpreted as + protocol-specific options for the external CA driver. + type: "object" + additionalProperties: + type: "string" + CACert: + description: | + The root CA certificate (in PEM format) this external CA uses + to issue TLS certificates (assumed to be to the current swarm + root CA certificate if not provided). + type: "string" + SigningCACert: + description: | + The desired signing CA certificate for all swarm node TLS leaf + certificates, in PEM format. + type: "string" + SigningCAKey: + description: | + The desired signing CA key for all swarm node TLS leaf certificates, + in PEM format. + type: "string" + ForceRotate: + description: | + An integer whose purpose is to force swarm to generate a new + signing CA certificate and key, if none have been specified in + `SigningCACert` and `SigningCAKey` + format: "uint64" + type: "integer" + EncryptionConfig: + description: "Parameters related to encryption-at-rest." + type: "object" + properties: + AutoLockManagers: + description: | + If set, generate a key and use it to lock data stored on the + managers. + type: "boolean" + example: false + TaskDefaults: + description: "Defaults for creating tasks in this cluster." + type: "object" + properties: + LogDriver: + description: | + The log driver to use for tasks created in the orchestrator if + unspecified by a service. + + Updating this value only affects new tasks. Existing tasks continue + to use their previously configured log driver until recreated. + type: "object" + properties: + Name: + description: | + The log driver to use as a default for new tasks. + type: "string" + example: "json-file" + Options: + description: | + Driver-specific options for the selected log driver, specified + as key/value pairs. + type: "object" + additionalProperties: + type: "string" + example: + "max-file": "10" + "max-size": "100m" + + # The Swarm information for `GET /info`. It is the same as `GET /swarm`, but + # without `JoinTokens`. + ClusterInfo: + description: | + ClusterInfo represents information about the swarm as is returned by the + "/info" endpoint. Join-tokens are not included. + x-nullable: true + type: "object" + properties: + ID: + description: "The ID of the swarm." + type: "string" + example: "abajmipo7b4xz5ip2nrla6b11" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + description: | + Date and time at which the swarm was initialised in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2016-08-18T10:44:24.496525531Z" + UpdatedAt: + description: | + Date and time at which the swarm was last updated in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + example: "2017-08-09T07:09:37.632105588Z" + Spec: + $ref: "#/definitions/SwarmSpec" + TLSInfo: + $ref: "#/definitions/TLSInfo" + RootRotationInProgress: + description: | + Whether there is currently a root CA rotation in progress for the swarm + type: "boolean" + example: false + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + If no port is set or is set to 0, the default port (4789) is used. + type: "integer" + format: "uint32" + default: 4789 + example: 4789 + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global scope + networks. + type: "array" + items: + type: "string" + format: "CIDR" + example: ["10.10.0.0/16", "20.20.0.0/16"] + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created from the + default subnet pool. + type: "integer" + format: "uint32" + maximum: 29 + default: 24 + example: 24 + + JoinTokens: + description: | + JoinTokens contains the tokens workers and managers need to join the swarm. + type: "object" + properties: + Worker: + description: | + The token workers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx" + Manager: + description: | + The token managers can use to join the swarm. + type: "string" + example: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + + Swarm: + type: "object" + allOf: + - $ref: "#/definitions/ClusterInfo" + - type: "object" + properties: + JoinTokens: + $ref: "#/definitions/JoinTokens" + + TaskSpec: + description: "User modifiable task configuration." + type: "object" + properties: + PluginSpec: + type: "object" + description: | + Plugin spec for the service. *(Experimental release only.)* + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Name: + description: "The name or 'alias' to use for the plugin." + type: "string" + Remote: + description: "The plugin image reference to use." + type: "string" + Disabled: + description: "Disable the plugin once scheduled." + type: "boolean" + PluginPrivilege: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + ContainerSpec: + type: "object" + description: | + Container spec for the service. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + properties: + Image: + description: "The image name to use for the container" + type: "string" + Labels: + description: "User-defined key/value data." + type: "object" + additionalProperties: + type: "string" + Command: + description: "The command to be run in the image." + type: "array" + items: + type: "string" + Args: + description: "Arguments to the command." + type: "array" + items: + type: "string" + Hostname: + description: | + The hostname to use for the container, as a valid + [RFC 1123](https://tools.ietf.org/html/rfc1123) hostname. + type: "string" + Env: + description: | + A list of environment variables in the form `VAR=value`. + type: "array" + items: + type: "string" + Dir: + description: "The working directory for commands to run in." + type: "string" + User: + description: "The user inside the container." + type: "string" + Groups: + type: "array" + description: | + A list of additional groups that the container process will run as. + items: + type: "string" + Privileges: + type: "object" + description: "Security options for the container" + properties: + CredentialSpec: + type: "object" + description: "CredentialSpec for managed service account (Windows only)" + properties: + Config: + type: "string" + example: "0bt9dmxjvjiqermk6xrop3ekq" + description: | + Load credential spec from a Swarm Config with the given ID. + The specified config must also be present in the Configs + field with the Runtime property set. + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + File: + type: "string" + example: "spec.json" + description: | + Load credential spec from this file. The file is read by + the daemon, and must be present in the `CredentialSpecs` + subdirectory in the docker data directory, which defaults + to `C:\ProgramData\Docker\` on Windows. + + For example, specifying `spec.json` loads + `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + <p><br /></p> + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + Registry: + type: "string" + description: | + Load credential spec from this value in the Windows + registry. The specified registry value must be located in: + + `HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs` + + <p><br /></p> + + + > **Note**: `CredentialSpec.File`, `CredentialSpec.Registry`, + > and `CredentialSpec.Config` are mutually exclusive. + SELinuxContext: + type: "object" + description: "SELinux labels of the container" + properties: + Disable: + type: "boolean" + description: "Disable SELinux" + User: + type: "string" + description: "SELinux user label" + Role: + type: "string" + description: "SELinux role label" + Type: + type: "string" + description: "SELinux type label" + Level: + type: "string" + description: "SELinux level label" + Seccomp: + type: "object" + description: "Options for configuring seccomp on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "unconfined" + - "custom" + Profile: + description: "The custom seccomp profile as a json object" + type: "string" + AppArmor: + type: "object" + description: "Options for configuring AppArmor on the container" + properties: + Mode: + type: "string" + enum: + - "default" + - "disabled" + NoNewPrivileges: + type: "boolean" + description: "Configuration of the no_new_privs bit in the container" + + TTY: + description: "Whether a pseudo-TTY should be allocated." + type: "boolean" + OpenStdin: + description: "Open `stdin`" + type: "boolean" + ReadOnly: + description: "Mount the container's root filesystem as read only." + type: "boolean" + Mounts: + description: | + Specification for mounts to be added to containers created as part + of the service. + type: "array" + items: + $ref: "#/definitions/Mount" + StopSignal: + description: "Signal to stop the container." + type: "string" + StopGracePeriod: + description: | + Amount of time to wait for the container to terminate before + forcefully killing it. + type: "integer" + format: "int64" + HealthCheck: + $ref: "#/definitions/HealthConfig" + Hosts: + type: "array" + description: | + A list of hostname/IP mappings to add to the container's `hosts` + file. The format of extra hosts is specified in the + [hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html) + man page: + + IP_address canonical_hostname [aliases...] + items: + type: "string" + DNSConfig: + description: | + Specification for DNS related configurations in resolver configuration + file (`resolv.conf`). + type: "object" + properties: + Nameservers: + description: "The IP addresses of the name servers." + type: "array" + items: + type: "string" + Search: + description: "A search list for host-name lookup." + type: "array" + items: + type: "string" + Options: + description: | + A list of internal resolver variables to be modified (e.g., + `debug`, `ndots:3`, etc.). + type: "array" + items: + type: "string" + Secrets: + description: | + Secrets contains references to zero or more secrets that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + SecretID: + description: | + SecretID represents the ID of the specific secret that we're + referencing. + type: "string" + SecretName: + description: | + SecretName is the name of the secret that this references, + but this is just provided for lookup/display purposes. The + secret in the reference will be identified by its ID. + type: "string" + OomScoreAdj: + type: "integer" + format: "int64" + description: | + An integer value containing the score given to the container in + order to tune OOM killer preferences. + example: 0 + Configs: + description: | + Configs contains references to zero or more configs that will be + exposed to the service. + type: "array" + items: + type: "object" + properties: + File: + description: | + File represents a specific target that is backed by a file. + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually exclusive + type: "object" + properties: + Name: + description: | + Name represents the final filename in the filesystem. + type: "string" + UID: + description: "UID represents the file UID." + type: "string" + GID: + description: "GID represents the file GID." + type: "string" + Mode: + description: "Mode represents the FileMode of the file." + type: "integer" + format: "uint32" + Runtime: + description: | + Runtime represents a target that is not mounted into the + container but is used by the task + + <p><br /><p> + + > **Note**: `Configs.File` and `Configs.Runtime` are mutually + > exclusive + type: "object" + ConfigID: + description: | + ConfigID represents the ID of the specific config that we're + referencing. + type: "string" + ConfigName: + description: | + ConfigName is the name of the config that this references, + but this is just provided for lookup/display purposes. The + config in the reference will be identified by its ID. + type: "string" + Isolation: + type: "string" + description: | + Isolation technology of the containers running the service. + (Windows only) + enum: + - "default" + - "process" + - "hyperv" + - "" + Init: + description: | + Run an init inside the container that forwards signals and reaps + processes. This field is omitted if empty, and the default (as + configured on the daemon) is used. + type: "boolean" + x-nullable: true + Sysctls: + description: | + Set kernel namedspaced parameters (sysctls) in the container. + The Sysctls option on services accepts the same sysctls as the + are supported on containers. Note that while the same sysctls are + supported, no guarantees or checks are made about their + suitability for a clustered environment, and it's up to the user + to determine whether a given sysctl will work properly in a + Service. + type: "object" + additionalProperties: + type: "string" + # This option is not used by Windows containers + CapabilityAdd: + type: "array" + description: | + A list of kernel capabilities to add to the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + - "CAP_SYS_ADMIN" + - "CAP_SYS_CHROOT" + - "CAP_SYSLOG" + CapabilityDrop: + type: "array" + description: | + A list of kernel capabilities to drop from the default set + for the container. + items: + type: "string" + example: + - "CAP_NET_RAW" + Ulimits: + description: | + A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`" + type: "array" + items: + type: "object" + properties: + Name: + description: "Name of ulimit" + type: "string" + Soft: + description: "Soft limit" + type: "integer" + Hard: + description: "Hard limit" + type: "integer" + NetworkAttachmentSpec: + description: | + Read-only spec type for non-swarm containers attached to swarm overlay + networks. + + <p><br /></p> + + > **Note**: ContainerSpec, NetworkAttachmentSpec, and PluginSpec are + > mutually exclusive. PluginSpec is only used when the Runtime field + > is set to `plugin`. NetworkAttachmentSpec is used when the Runtime + > field is set to `attachment`. + type: "object" + properties: + ContainerID: + description: "ID of the container represented by this task" + type: "string" + Resources: + description: | + Resource requirements which apply to each individual container created + as part of the service. + type: "object" + properties: + Limits: + description: "Define resources limits." + $ref: "#/definitions/Limit" + Reservations: + description: "Define resources reservation." + $ref: "#/definitions/ResourceObject" + SwapBytes: + description: | + Amount of swap in bytes - can only be used together with a memory limit. + If not specified, the default behaviour is to grant a swap space twice + as big as the memory limit. + Set to -1 to enable unlimited swap. + type: "integer" + format: "int64" + minimum: -1 + x-nullable: true + x-omitempty: true + MemorySwappiness: + description: | + Tune the service's containers' memory swappiness (0 to 100). + If not specified, defaults to the containers' OS' default, generally 60, + or whatever value was predefined in the image. + Set to -1 to unset a previously set value. + type: "integer" + format: "int64" + minimum: -1 + maximum: 100 + x-nullable: true + x-omitempty: true + RestartPolicy: + description: | + Specification for the restart policy which applies to containers + created as part of this service. + type: "object" + properties: + Condition: + description: "Condition for restart." + type: "string" + enum: + - "none" + - "on-failure" + - "any" + Delay: + description: "Delay between restart attempts." + type: "integer" + format: "int64" + MaxAttempts: + description: | + Maximum attempts to restart a given container before giving up + (default value is 0, which is ignored). + type: "integer" + format: "int64" + default: 0 + Window: + description: | + Windows is the time window used to evaluate the restart policy + (default value is 0, which is unbounded). + type: "integer" + format: "int64" + default: 0 + Placement: + type: "object" + properties: + Constraints: + description: | + An array of constraint expressions to limit the set of nodes where + a task can be scheduled. Constraint expressions can either use a + _match_ (`==`) or _exclude_ (`!=`) rule. Multiple constraints find + nodes that satisfy every expression (AND match). Constraints can + match node or Docker Engine labels as follows: + + node attribute | matches | example + ---------------------|--------------------------------|----------------------------------------------- + `node.id` | Node ID | `node.id==2ivku8v2gvtg4` + `node.hostname` | Node hostname | `node.hostname!=node-2` + `node.role` | Node role (`manager`/`worker`) | `node.role==manager` + `node.platform.os` | Node operating system | `node.platform.os==windows` + `node.platform.arch` | Node architecture | `node.platform.arch==x86_64` + `node.labels` | User-defined node labels | `node.labels.security==high` + `engine.labels` | Docker Engine's labels | `engine.labels.operatingsystem==ubuntu-24.04` + + `engine.labels` apply to Docker Engine labels like operating system, + drivers, etc. Swarm administrators add `node.labels` for operational + purposes by using the [`node update endpoint`](#operation/NodeUpdate). + + type: "array" + items: + type: "string" + example: + - "node.hostname!=node3.corp.example.com" + - "node.role!=manager" + - "node.labels.type==production" + - "node.platform.os==linux" + - "node.platform.arch==x86_64" + Preferences: + description: | + Preferences provide a way to make the scheduler aware of factors + such as topology. They are provided in order from highest to + lowest precedence. + type: "array" + items: + type: "object" + properties: + Spread: + type: "object" + properties: + SpreadDescriptor: + description: | + label descriptor, such as `engine.labels.az`. + type: "string" + example: + - Spread: + SpreadDescriptor: "node.labels.datacenter" + - Spread: + SpreadDescriptor: "node.labels.rack" + MaxReplicas: + description: | + Maximum number of replicas for per node (default value is 0, which + is unlimited) + type: "integer" + format: "int64" + default: 0 + Platforms: + description: | + Platforms stores all the platforms that the service's image can + run on. This field is used in the platform filter for scheduling. + If empty, then the platform filter is off, meaning there are no + scheduling restrictions. + type: "array" + items: + $ref: "#/definitions/Platform" + ForceUpdate: + description: | + A counter that triggers an update even if no relevant parameters have + been changed. + type: "integer" + format: "uint64" + Runtime: + description: | + Runtime is the type of runtime specified for the task executor. + type: "string" + Networks: + description: "Specifies which networks the service should attach to." + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + LogDriver: + description: | + Specifies the log driver to use for tasks created from this spec. If + not present, the default one for the swarm will be used, finally + falling back to the engine default if not specified. + type: "object" + properties: + Name: + type: "string" + Options: + type: "object" + additionalProperties: + type: "string" + + TaskState: + type: "string" + enum: + - "new" + - "allocated" + - "pending" + - "assigned" + - "accepted" + - "preparing" + - "ready" + - "starting" + - "running" + - "complete" + - "shutdown" + - "failed" + - "rejected" + - "remove" + - "orphaned" + + ContainerStatus: + type: "object" + description: "represents the status of a container." + properties: + ContainerID: + type: "string" + PID: + type: "integer" + ExitCode: + type: "integer" + + PortStatus: + type: "object" + description: "represents the port status of a task's host ports whose service has published host ports" + properties: + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + TaskStatus: + type: "object" + description: "represents the status of a task." + properties: + Timestamp: + type: "string" + format: "dateTime" + State: + $ref: "#/definitions/TaskState" + Message: + type: "string" + Err: + type: "string" + ContainerStatus: + $ref: "#/definitions/ContainerStatus" + PortStatus: + $ref: "#/definitions/PortStatus" + + Task: + type: "object" + properties: + ID: + description: "The ID of the task." + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Name: + description: "Name of the task." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Spec: + $ref: "#/definitions/TaskSpec" + ServiceID: + description: "The ID of the service this task is part of." + type: "string" + Slot: + type: "integer" + NodeID: + description: "The ID of the node that this task is on." + type: "string" + AssignedGenericResources: + $ref: "#/definitions/GenericResources" + Status: + $ref: "#/definitions/TaskStatus" + DesiredState: + $ref: "#/definitions/TaskState" + JobIteration: + description: | + If the Service this Task belongs to is a job-mode service, contains + the JobIteration of the Service this Task was created for. Absent if + the Task was created for a Replicated or Global Service. + $ref: "#/definitions/ObjectVersion" + example: + ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + AssignedGenericResources: + - DiscreteResourceSpec: + Kind: "SSD" + Value: 3 + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID1" + - NamedResourceSpec: + Kind: "GPU" + Value: "UUID2" + + ServiceSpec: + description: "User modifiable configuration for a service." + type: object + properties: + Name: + description: "Name of the service." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + TaskTemplate: + $ref: "#/definitions/TaskSpec" + Mode: + description: "Scheduling mode for the service." + type: "object" + properties: + Replicated: + type: "object" + properties: + Replicas: + type: "integer" + format: "int64" + Global: + type: "object" + ReplicatedJob: + description: | + The mode used for services with a finite number of tasks that run + to a completed state. + type: "object" + properties: + MaxConcurrent: + description: | + The maximum number of replicas to run simultaneously. + type: "integer" + format: "int64" + default: 1 + TotalCompletions: + description: | + The total number of replicas desired to reach the Completed + state. If unset, will default to the value of `MaxConcurrent` + type: "integer" + format: "int64" + GlobalJob: + description: | + The mode used for services which run a task to the completed state + on each valid node. + type: "object" + UpdateConfig: + description: "Specification for the update strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be updated in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: "Amount of time between updates, in nanoseconds." + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an updated task fails to run, or stops running + during the update. + type: "string" + enum: + - "continue" + - "pause" + - "rollback" + Monitor: + description: | + Amount of time to monitor each updated task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during an update before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling out an updated task. Either + the old task is shut down before the new task is started, or the + new task is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + RollbackConfig: + description: "Specification for the rollback strategy of the service." + type: "object" + properties: + Parallelism: + description: | + Maximum number of tasks to be rolled back in one iteration (0 means + unlimited parallelism). + type: "integer" + format: "int64" + Delay: + description: | + Amount of time between rollback iterations, in nanoseconds. + type: "integer" + format: "int64" + FailureAction: + description: | + Action to take if an rolled back task fails to run, or stops + running during the rollback. + type: "string" + enum: + - "continue" + - "pause" + Monitor: + description: | + Amount of time to monitor each rolled back task for failures, in + nanoseconds. + type: "integer" + format: "int64" + MaxFailureRatio: + description: | + The fraction of tasks that may fail during a rollback before the + failure action is invoked, specified as a floating point number + between 0 and 1. + type: "number" + default: 0 + Order: + description: | + The order of operations when rolling back a task. Either the old + task is shut down before the new task is started, or the new task + is started before the old task is shut down. + type: "string" + enum: + - "stop-first" + - "start-first" + Networks: + description: | + Specifies which networks the service should attach to. + + Deprecated: This field is deprecated since v1.44. The Networks field in TaskSpec should be used instead. + type: "array" + items: + $ref: "#/definitions/NetworkAttachmentConfig" + + EndpointSpec: + $ref: "#/definitions/EndpointSpec" + + EndpointPortConfig: + type: "object" + properties: + Name: + type: "string" + Protocol: + type: "string" + enum: + - "tcp" + - "udp" + - "sctp" + TargetPort: + description: "The port inside the container." + type: "integer" + PublishedPort: + description: "The port on the swarm hosts." + type: "integer" + PublishMode: + description: | + The mode in which port is published. + + <p><br /></p> + + - "ingress" makes the target port accessible on every node, + regardless of whether there is a task for the service running on + that node or not. + - "host" bypasses the routing mesh and publish the port directly on + the swarm node where that service is running. + + type: "string" + enum: + - "ingress" + - "host" + default: "ingress" + example: "ingress" + + EndpointSpec: + description: "Properties that can be configured to access and load balance a service." + type: "object" + properties: + Mode: + description: | + The mode of resolution to use for internal load balancing between tasks. + type: "string" + enum: + - "vip" + - "dnsrr" + default: "vip" + Ports: + description: | + List of exposed ports that this service is accessible on from the + outside. Ports can only be provided if `vip` resolution mode is used. + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + + Service: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ServiceSpec" + Endpoint: + type: "object" + properties: + Spec: + $ref: "#/definitions/EndpointSpec" + Ports: + type: "array" + items: + $ref: "#/definitions/EndpointPortConfig" + VirtualIPs: + type: "array" + items: + type: "object" + properties: + NetworkID: + type: "string" + Addr: + type: "string" + UpdateStatus: + description: "The status of a service update." + type: "object" + properties: + State: + type: "string" + enum: + - "updating" + - "paused" + - "completed" + StartedAt: + type: "string" + format: "dateTime" + CompletedAt: + type: "string" + format: "dateTime" + Message: + type: "string" + ServiceStatus: + description: | + The status of the service's tasks. Provided only when requested as + part of a ServiceList operation. + type: "object" + properties: + RunningTasks: + description: | + The number of tasks for the service currently in the Running state. + type: "integer" + format: "uint64" + example: 7 + DesiredTasks: + description: | + The number of tasks for the service desired to be running. + For replicated services, this is the replica count from the + service spec. For global services, this is computed by taking + count of all tasks for the service with a Desired State other + than Shutdown. + type: "integer" + format: "uint64" + example: 10 + CompletedTasks: + description: | + The number of tasks for a job that are in the Completed state. + This field must be cross-referenced with the service type, as the + value of 0 may mean the service is not in a job mode, or it may + mean the job-mode service has no tasks yet Completed. + type: "integer" + format: "uint64" + JobStatus: + description: | + The status of the service when it is in one of ReplicatedJob or + GlobalJob modes. Absent on Replicated and Global mode services. The + JobIteration is an ObjectVersion, but unlike the Service's version, + does not need to be sent with an update request. + type: "object" + properties: + JobIteration: + description: | + JobIteration is a value increased each time a Job is executed, + successfully or otherwise. "Executed", in this case, means the + job as a whole has been started, not that an individual Task has + been launched. A job is "Executed" when its ServiceSpec is + updated. JobIteration can be used to disambiguate Tasks belonging + to different executions of a job. Though JobIteration will + increase with each subsequent execution, it may not necessarily + increase by 1, and so JobIteration should not be used to + $ref: "#/definitions/ObjectVersion" + LastExecution: + description: | + The last time, as observed by the server, that this job was + started. + type: "string" + format: "dateTime" + example: + ID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Version: + Index: 19 + CreatedAt: "2016-06-07T21:05:51.880065305Z" + UpdatedAt: "2016-06-07T21:07:29.962229872Z" + Spec: + Name: "hopeful_cori" + TaskTemplate: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Endpoint: + Spec: + Mode: "vip" + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + Ports: + - + Protocol: "tcp" + TargetPort: 6379 + PublishedPort: 30001 + VirtualIPs: + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.2/16" + - + NetworkID: "4qvuz4ko70xaltuqbt8956gd1" + Addr: "10.255.0.3/16" + + ImageDeleteResponseItem: + type: "object" + x-go-name: "DeleteResponse" + properties: + Untagged: + description: "The image ID of an image that was untagged" + type: "string" + Deleted: + description: "The image ID of an image that was deleted" + type: "string" + + ServiceCreateResponse: + type: "object" + description: | + contains the information returned to a client on the + creation of a new service. + properties: + ID: + description: "The ID of the created service." + type: "string" + x-nullable: false + example: "ak7w3gjqoa3kuz8xcpnyy0pvl" + Warnings: + description: | + Optional warning message. + + FIXME(thaJeztah): this should have "omitempty" in the generated type. + type: "array" + x-nullable: true + items: + type: "string" + example: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ServiceUpdateResponse: + type: "object" + properties: + Warnings: + description: "Optional warning messages" + type: "array" + items: + type: "string" + example: + Warnings: + - "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found" + + ContainerInspectResponse: + type: "object" + title: "ContainerInspectResponse" + x-go-name: "InspectResponse" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Created: + description: |- + Date and time at which the container was created, formatted in + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. + type: "string" + format: "dateTime" + x-nullable: true + example: "2025-02-17T17:43:39.64001363Z" + Path: + description: |- + The path to the command being run + type: "string" + example: "/bin/sh" + Args: + description: "The arguments to the command being run" + type: "array" + items: + type: "string" + example: + - "-c" + - "exit 9" + State: + $ref: "#/definitions/ContainerState" + Image: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ResolvConfPath: + description: |- + Location of the `/etc/resolv.conf` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/resolv.conf" + HostnamePath: + description: |- + Location of the `/etc/hostname` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hostname" + HostsPath: + description: |- + Location of the `/etc/hosts` generated for the container on the + host. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + example: "/var/lib/docker/containers/aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf/hosts" + LogPath: + description: |- + Location of the file used to buffer the container's logs. Depending on + the logging-driver used for the container, this field may be omitted. + + This file is managed through the docker daemon, and should not be + accessed or modified by other tools. + type: "string" + x-nullable: true + example: "/var/lib/docker/containers/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59/5b7c7e2b992aa426584ce6c47452756066be0e503a08b4516a433a54d2f69e59-json.log" + Name: + description: |- + The name associated with this container. + + For historic reasons, the name may be prefixed with a forward-slash (`/`). + type: "string" + example: "/funny_chatelet" + RestartCount: + description: |- + Number of times the container was restarted since it was created, + or since daemon was started. + type: "integer" + example: 0 + Driver: + description: |- + The storage-driver used for the container's filesystem (graph-driver + or snapshotter). + type: "string" + example: "overlayfs" + Platform: + description: |- + The platform (operating system) for which the container was created. + + This field was introduced for the experimental "LCOW" (Linux Containers + On Windows) features, which has been removed. In most cases, this field + is equal to the host's operating system (`linux` or `windows`). + type: "string" + example: "linux" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + description: |- + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + MountLabel: + description: |- + SELinux mount label set for the container. + type: "string" + example: "" + ProcessLabel: + description: |- + SELinux process label set for the container. + type: "string" + example: "" + AppArmorProfile: + description: |- + The AppArmor profile set for the container. + type: "string" + example: "" + ExecIDs: + description: |- + IDs of exec instances that are running in the container. + type: "array" + items: + type: "string" + x-nullable: true + example: + - "b35395de42bc8abd327f9dd65d913b9ba28c74d2f0734eeeae84fa1c616a0fca" + - "3fc1232e5cd20c8de182ed81178503dc6437f4e7ef12b52cc5e8de020652f1c4" + HostConfig: + $ref: "#/definitions/HostConfig" + GraphDriver: + $ref: "#/definitions/DriverData" + x-nullable: true + Storage: + $ref: "#/definitions/Storage" + x-nullable: true + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Mounts: + description: |- + List of mounts used by the container. + type: "array" + items: + $ref: "#/definitions/MountPoint" + Config: + $ref: "#/definitions/ContainerConfig" + NetworkSettings: + $ref: "#/definitions/NetworkSettings" + + ContainerSummary: + type: "object" + properties: + Id: + description: |- + The ID of this container as a 128-bit (64-character) hexadecimal string (32 bytes). + type: "string" + x-go-name: "ID" + minLength: 64 + maxLength: 64 + pattern: "^[0-9a-fA-F]{64}$" + example: "aa86eacfb3b3ed4cd362c1e88fc89a53908ad05fb3a4103bca3f9b28292d14bf" + Names: + description: |- + The names associated with this container. Most containers have a single + name, but when using legacy "links", the container can have multiple + names. + + For historic reasons, names are prefixed with a forward-slash (`/`). + type: "array" + items: + type: "string" + example: + - "/funny_chatelet" + Image: + description: |- + The name or ID of the image used to create the container. + + This field shows the image reference as was specified when creating the container, + which can be in its canonical form (e.g., `docker.io/library/ubuntu:latest` + or `docker.io/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`), + short form (e.g., `ubuntu:latest`)), or the ID(-prefix) of the image (e.g., `72297848456d`). + + The content of this field can be updated at runtime if the image used to + create the container is untagged, in which case the field is updated to + contain the the image ID (digest) it was resolved to in its canonical, + non-truncated form (e.g., `sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782`). + type: "string" + example: "docker.io/library/ubuntu:latest" + ImageID: + description: |- + The ID (digest) of the image that this container was created from. + type: "string" + example: "sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782" + ImageManifestDescriptor: + $ref: "#/definitions/OCIDescriptor" + x-nullable: true + description: | + OCI descriptor of the platform-specific manifest of the image + the container was created from. + + Note: Only available if the daemon provides a multi-platform + image store. + + This field is not populated in the `GET /system/df` endpoint. + Command: + description: "Command to run when starting the container" + type: "string" + example: "/bin/bash" + Created: + description: |- + Date and time at which the container was created as a Unix timestamp + (number of seconds since EPOCH). + type: "integer" + format: "int64" + example: "1739811096" + Ports: + description: |- + Port-mappings for the container. + type: "array" + items: + $ref: "#/definitions/PortSummary" + SizeRw: + description: |- + The size of files that have been created or changed by this container. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "122880" + SizeRootFs: + description: |- + The total size of all files in the read-only layers from the image + that the container uses. These layers can be shared between containers. + + This field is omitted by default, and only set when size is requested + in the API request. + type: "integer" + format: "int64" + x-nullable: true + example: "1653948416" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + State: + description: | + The state of this container. + type: "string" + enum: + - "created" + - "running" + - "paused" + - "restarting" + - "exited" + - "removing" + - "dead" + example: "running" + Status: + description: |- + Additional human-readable status of this container (e.g. `Exit 0`) + type: "string" + example: "Up 4 days" + HostConfig: + type: "object" + description: |- + Summary of host-specific runtime information of the container. This + is a reduced set of information in the container's "HostConfig" as + available in the container "inspect" response. + properties: + NetworkMode: + description: |- + Networking mode (`host`, `none`, `container:<id>`) or name of the + primary network the container is using. + + This field is primarily for backward compatibility. The container + can be connected to multiple networks for which information can be + found in the `NetworkSettings.Networks` field, which enumerates + settings per network. + type: "string" + example: "mynetwork" + Annotations: + description: |- + Arbitrary key-value metadata attached to the container. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + io.kubernetes.docker.type: "container" + io.kubernetes.sandbox.id: "3befe639bed0fd6afdd65fd1fa84506756f59360ec4adc270b0fdac9be22b4d3" + NetworkSettings: + description: |- + Summary of the container's network settings + type: "object" + properties: + Networks: + type: "object" + description: |- + Summary of network-settings for each network the container is + attached to. + additionalProperties: + $ref: "#/definitions/EndpointSettings" + Mounts: + type: "array" + description: |- + List of mounts used by the container. + items: + $ref: "#/definitions/MountPoint" + Health: + type: "object" + description: |- + Summary of health status + + Added in v1.52, before that version all container summary not include Health. + After this attribute introduced, it includes containers with no health checks configured, + or containers that are not running with none + properties: + Status: + type: "string" + description: |- + the health status of the container + enum: + - "none" + - "starting" + - "healthy" + - "unhealthy" + example: "healthy" + FailingStreak: + description: "FailingStreak is the number of consecutive failures" + type: "integer" + example: 0 + + ContainersDiskUsage: + type: "object" + x-go-name: "DiskUsage" + x-go-package: "github.com/moby/moby/api/types/container" + description: | + represents system data usage information for container resources. + properties: + ActiveCount: + description: | + Count of active containers. + type: "integer" + format: "int64" + example: 1 + TotalCount: + description: | + Count of all containers. + type: "integer" + format: "int64" + example: 4 + Reclaimable: + description: | + Disk space that can be reclaimed by removing inactive containers. + type: "integer" + format: "int64" + example: 12345678 + TotalSize: + description: | + Disk space in use by containers. + type: "integer" + format: "int64" + example: 98765432 + Items: + description: | + List of container summaries. + type: "array" + x-omitempty: true + items: + x-go-type: + type: Summary + + Driver: + description: "Driver represents a driver (network, logging, secrets)." + type: "object" + required: [Name] + properties: + Name: + description: "Name of the driver." + type: "string" + x-nullable: false + example: "some-driver" + Options: + description: "Key/value map of driver-specific options." + type: "object" + x-nullable: false + additionalProperties: + type: "string" + example: + OptionA: "value for driver-specific option A" + OptionB: "value for driver-specific option B" + + SecretSpec: + type: "object" + properties: + Name: + description: "User-defined name of the secret." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + Data: + description: | + Data is the data to store as a secret, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + It must be empty if the Driver field is set, in which case the data is + loaded from an external secret store. The maximum allowed size is 500KB, + as defined in [MaxSecretSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0/api/validation#MaxSecretSize). + + This field is only used to _create_ a secret, and is not returned by + other endpoints. + type: "string" + example: "" + Driver: + description: | + Name of the secrets driver used to fetch the secret's value from an + external secret store. + $ref: "#/definitions/Driver" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Secret: + type: "object" + properties: + ID: + type: "string" + example: "blt1owaxmitz71s9v5zh81zun" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: + type: "string" + format: "dateTime" + example: "2017-07-20T13:55:28.678958722Z" + Spec: + $ref: "#/definitions/SecretSpec" + + ConfigSpec: + type: "object" + properties: + Name: + description: "User-defined name of the config." + type: "string" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + Data: + description: | + Data is the data to store as a config, formatted as a standard base64-encoded + ([RFC 4648](https://tools.ietf.org/html/rfc4648#section-4)) string. + The maximum allowed size is 1000KB, as defined in [MaxConfigSize](https://pkg.go.dev/github.com/moby/swarmkit/v2@v2.0.0-20250103191802-8c1959736554/manager/controlapi#MaxConfigSize). + type: "string" + Templating: + description: | + Templating driver, if applicable + + Templating controls whether and how to evaluate the config payload as + a template. If no driver is set, no templating is used. + $ref: "#/definitions/Driver" + + Config: + type: "object" + properties: + ID: + type: "string" + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ConfigSpec" + + ContainerState: + description: | + ContainerState stores container's running state. It's part of ContainerJSONBase + and will be returned by the "inspect" command. + type: "object" + x-nullable: true + properties: + Status: + description: | + String representation of the container state. Can be one of "created", + "running", "paused", "restarting", "removing", "exited", or "dead". + type: "string" + enum: ["created", "running", "paused", "restarting", "removing", "exited", "dead"] + example: "running" + Running: + description: | + Whether this container is running. + + Note that a running container can be _paused_. The `Running` and `Paused` + booleans are not mutually exclusive: + + When pausing a container (on Linux), the freezer cgroup is used to suspend + all processes in the container. Freezing the process requires the process to + be running. As a result, paused containers are both `Running` _and_ `Paused`. + + Use the `Status` field instead to determine if a container's state is "running". + type: "boolean" + example: true + Paused: + description: "Whether this container is paused." + type: "boolean" + example: false + Restarting: + description: "Whether this container is restarting." + type: "boolean" + example: false + OOMKilled: + description: | + Whether a process within this container has been killed because it ran + out of memory since the container was last started. + type: "boolean" + example: false + Dead: + type: "boolean" + example: false + Pid: + description: "The process ID of this container" + type: "integer" + example: 1234 + ExitCode: + description: "The last exit code of this container" + type: "integer" + example: 0 + Error: + type: "string" + StartedAt: + description: "The time when this container was last started." + type: "string" + example: "2020-01-06T09:06:59.461876391Z" + FinishedAt: + description: "The time when this container last exited." + type: "string" + example: "2020-01-06T09:07:59.461876391Z" + Health: + $ref: "#/definitions/Health" + + ContainerCreateResponse: + description: "OK response to ContainerCreate operation" + type: "object" + title: "ContainerCreateResponse" + x-go-name: "CreateResponse" + required: [Id, Warnings] + properties: + Id: + description: "The ID of the created container" + type: "string" + x-nullable: false + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Warnings: + description: "Warnings encountered when creating the container" + type: "array" + x-nullable: false + items: + type: "string" + example: [] + + ContainerUpdateResponse: + type: "object" + title: "ContainerUpdateResponse" + x-go-name: "UpdateResponse" + description: |- + Response for a successful container-update. + properties: + Warnings: + type: "array" + description: |- + Warnings encountered when updating the container. + items: + type: "string" + example: ["Published ports are discarded when using host network mode"] + + ContainerStatsResponse: + description: | + Statistics sample for a container. + type: "object" + x-go-name: "StatsResponse" + title: "ContainerStatsResponse" + properties: + id: + description: | + ID of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + name: + description: | + Name of the container for which the stats were collected. + type: "string" + x-nullable: true + example: "boring_wozniak" + os_type: + description: | + OSType is the OS of the container ("linux" or "windows") to allow + platform-specific handling of stats. + type: "string" + x-nullable: true + example: "linux" + read: + description: | + Date and time at which this sample was collected. + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:22.165243637Z" + cpu_stats: + $ref: "#/definitions/ContainerCPUStats" + memory_stats: + $ref: "#/definitions/ContainerMemoryStats" + networks: + description: | + Network statistics for the container per interface. + + This field is omitted if the container has no networking enabled. + x-nullable: true + additionalProperties: + $ref: "#/definitions/ContainerNetworkStats" + example: + eth0: + rx_bytes: 5338 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 36 + tx_bytes: 648 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 8 + eth5: + rx_bytes: 4641 + rx_dropped: 0 + rx_errors: 0 + rx_packets: 26 + tx_bytes: 690 + tx_dropped: 0 + tx_errors: 0 + tx_packets: 9 + pids_stats: + $ref: "#/definitions/ContainerPidsStats" + blkio_stats: + $ref: "#/definitions/ContainerBlkioStats" + num_procs: + description: | + The number of processors on the system. + + This field is Windows-specific and always zero for Linux containers. + type: "integer" + format: "uint32" + example: 16 + storage_stats: + $ref: "#/definitions/ContainerStorageStats" + preread: + description: | + Date and time at which this first sample was collected. This field + is not propagated if the "one-shot" option is set. If the "one-shot" + option is set, this field may be omitted, empty, or set to a default + date (`0001-01-01T00:00:00Z`). + + The value is formatted as [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + with nano-seconds. + type: "string" + format: "date-time" + example: "2025-01-16T13:55:21.160452595Z" + precpu_stats: + $ref: "#/definitions/ContainerCPUStats" + + ContainerBlkioStats: + description: | + BlkioStats stores all IO service stats for data read and write. + + This type is Linux-specific and holds many fields that are specific to cgroups v1. + On a cgroup v2 host, all fields other than `io_service_bytes_recursive` + are omitted or `null`. + + This type is only populated on Linux and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStats" + x-nullable: true + properties: + io_service_bytes_recursive: + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_serviced_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_queue_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_service_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_wait_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_merged_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + io_time_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + sectors_recursive: + description: | + This field is only available when using Linux containers with + cgroups v1. It is omitted or `null` when using cgroups v2. + x-nullable: true + type: "array" + items: + $ref: "#/definitions/ContainerBlkioStatEntry" + example: + io_service_bytes_recursive: [ + {"major": 254, "minor": 0, "op": "read", "value": 7593984}, + {"major": 254, "minor": 0, "op": "write", "value": 100} + ] + io_serviced_recursive: null + io_queue_recursive: null + io_service_time_recursive: null + io_wait_time_recursive: null + io_merged_recursive: null + io_time_recursive: null + sectors_recursive: null + + ContainerBlkioStatEntry: + description: | + Blkio stats entry. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "BlkioStatEntry" + x-nullable: true + properties: + major: + type: "integer" + format: "uint64" + example: 254 + minor: + type: "integer" + format: "uint64" + example: 0 + op: + type: "string" + example: "read" + value: + type: "integer" + format: "uint64" + example: 7593984 + + ContainerCPUStats: + description: | + CPU related info of the container + type: "object" + x-go-name: "CPUStats" + x-nullable: true + properties: + cpu_usage: + $ref: "#/definitions/ContainerCPUUsage" + system_cpu_usage: + description: | + System Usage. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + online_cpus: + description: | + Number of online CPUs. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint32" + x-nullable: true + example: 5 + throttling_data: + $ref: "#/definitions/ContainerThrottlingData" + + ContainerCPUUsage: + description: | + All CPU stats aggregated since container inception. + type: "object" + x-go-name: "CPUUsage" + x-nullable: true + properties: + total_usage: + description: | + Total CPU time consumed in nanoseconds (Linux) or 100's of nanoseconds (Windows). + type: "integer" + format: "uint64" + example: 29912000 + percpu_usage: + description: | + Total CPU time (in nanoseconds) consumed per core (Linux). + + This field is Linux-specific when using cgroups v1. It is omitted + when using cgroups v2 and Windows containers. + type: "array" + x-nullable: true + items: + type: "integer" + format: "uint64" + example: 29912000 + + usage_in_kernelmode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in kernel mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 21994000 + usage_in_usermode: + description: | + Time (in nanoseconds) spent by tasks of the cgroup in user mode (Linux), + or time spent (in 100's of nanoseconds) by all container processes in + kernel mode (Windows). + + Not populated for Windows containers using Hyper-V isolation. + type: "integer" + format: "uint64" + example: 7918000 + + ContainerPidsStats: + description: | + PidsStats contains Linux-specific stats of a container's process-IDs (PIDs). + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "PidsStats" + x-nullable: true + properties: + current: + description: | + Current is the number of PIDs in the cgroup. + type: "integer" + format: "uint64" + x-nullable: true + example: 5 + limit: + description: | + Limit is the hard limit on the number of pids in the cgroup. + A "Limit" of 0 means that there is no limit. + type: "integer" + format: "uint64" + x-nullable: true + example: "18446744073709551615" + + ContainerThrottlingData: + description: | + CPU throttling stats of the container. + + This type is Linux-specific and omitted for Windows containers. + type: "object" + x-go-name: "ThrottlingData" + x-nullable: true + properties: + periods: + description: | + Number of periods with throttling active. + type: "integer" + format: "uint64" + example: 0 + throttled_periods: + description: | + Number of periods when the container hit its throttling limit. + type: "integer" + format: "uint64" + example: 0 + throttled_time: + description: | + Aggregated time (in nanoseconds) the container was throttled for. + type: "integer" + format: "uint64" + example: 0 + + ContainerMemoryStats: + description: | + Aggregates all memory stats since container inception on Linux. + Windows returns stats for commit and private working set only. + type: "object" + x-go-name: "MemoryStats" + properties: + usage: + description: | + Current `res_counter` usage for memory. + + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + max_usage: + description: | + Maximum usage ever recorded. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + stats: + description: | + All the stats exported via memory.stat. + + The fields in this object differ between cgroups v1 and v2. + On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available. + On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available. + + This field is Linux-specific and omitted for Windows containers. + type: "object" + additionalProperties: + type: "integer" + format: "uint64" + x-nullable: true + example: + { + "active_anon": 1572864, + "active_file": 5115904, + "anon": 1572864, + "anon_thp": 0, + "file": 7626752, + "file_dirty": 0, + "file_mapped": 2723840, + "file_writeback": 0, + "inactive_anon": 0, + "inactive_file": 2510848, + "kernel_stack": 16384, + "pgactivate": 0, + "pgdeactivate": 0, + "pgfault": 2042, + "pglazyfree": 0, + "pglazyfreed": 0, + "pgmajfault": 45, + "pgrefill": 0, + "pgscan": 0, + "pgsteal": 0, + "shmem": 0, + "slab": 1180928, + "slab_reclaimable": 725576, + "slab_unreclaimable": 455352, + "sock": 0, + "thp_collapse_alloc": 0, + "thp_fault_alloc": 1, + "unevictable": 0, + "workingset_activate": 0, + "workingset_nodereclaim": 0, + "workingset_refault": 0 + } + failcnt: + description: | + Number of times memory usage hits limits. + + This field is Linux-specific and only supported on cgroups v1. + It is omitted when using cgroups v2 and for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + limit: + description: | + This field is Linux-specific and omitted for Windows containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 8217579520 + commitbytes: + description: | + Committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + commitpeakbytes: + description: | + Peak committed bytes. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + privateworkingset: + description: | + Private working set. + + This field is Windows-specific and omitted for Linux containers. + type: "integer" + format: "uint64" + x-nullable: true + example: 0 + + ContainerNetworkStats: + description: | + Aggregates the network stats of one container + type: "object" + x-go-name: "NetworkStats" + x-nullable: true + properties: + rx_bytes: + description: | + Bytes received. Windows and Linux. + type: "integer" + format: "uint64" + example: 5338 + rx_packets: + description: | + Packets received. Windows and Linux. + type: "integer" + format: "uint64" + example: 36 + rx_errors: + description: | + Received errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + rx_dropped: + description: | + Incoming packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + tx_bytes: + description: | + Bytes sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 1200 + tx_packets: + description: | + Packets sent. Windows and Linux. + type: "integer" + format: "uint64" + example: 12 + tx_errors: + description: | + Sent errors. Not used on Windows. + + This field is Linux-specific and always zero for Windows containers. + type: "integer" + format: "uint64" + example: 0 + tx_dropped: + description: | + Outgoing packets dropped. Windows and Linux. + type: "integer" + format: "uint64" + example: 0 + endpoint_id: + description: | + Endpoint ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + instance_id: + description: | + Instance ID. Not used on Linux. + + This field is Windows-specific and omitted for Linux containers. + type: "string" + x-nullable: true + + ContainerStorageStats: + description: | + StorageStats is the disk I/O stats for read/write on Windows. + + This type is Windows-specific and omitted for Linux containers. + type: "object" + x-go-name: "StorageStats" + x-nullable: true + properties: + read_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + read_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_count_normalized: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + write_size_bytes: + type: "integer" + format: "uint64" + x-nullable: true + example: 7593984 + + ContainerTopResponse: + type: "object" + x-go-name: "TopResponse" + title: "ContainerTopResponse" + description: |- + Container "top" response. + properties: + Titles: + description: "The ps column titles" + type: "array" + items: + type: "string" + example: + Titles: + - "UID" + - "PID" + - "PPID" + - "C" + - "STIME" + - "TTY" + - "TIME" + - "CMD" + Processes: + description: |- + Each process running in the container, where each process + is an array of values corresponding to the titles. + type: "array" + items: + type: "array" + items: + type: "string" + example: + Processes: + - + - "root" + - "13642" + - "882" + - "0" + - "17:03" + - "pts/0" + - "00:00:00" + - "/bin/bash" + - + - "root" + - "13735" + - "13642" + - "0" + - "17:06" + - "pts/0" + - "00:00:00" + - "sleep 10" + + ContainerWaitResponse: + description: "OK response to ContainerWait operation" + type: "object" + x-go-name: "WaitResponse" + title: "ContainerWaitResponse" + required: [StatusCode] + properties: + StatusCode: + description: "Exit code of the container" + type: "integer" + format: "int64" + x-nullable: false + Error: + $ref: "#/definitions/ContainerWaitExitError" + + ContainerWaitExitError: + description: "container waiting error, if any" + type: "object" + x-go-name: "WaitExitError" + properties: + Message: + description: "Details of an error" + type: "string" + + SystemVersion: + type: "object" + description: | + Response of Engine API: GET "/version" + properties: + Platform: + type: "object" + required: [Name] + properties: + Name: + type: "string" + Components: + type: "array" + description: | + Information about system components + items: + type: "object" + x-go-name: ComponentVersion + required: [Name, Version] + properties: + Name: + description: | + Name of the component + type: "string" + example: "Engine" + Version: + description: | + Version of the component + type: "string" + x-nullable: false + example: "27.0.1" + Details: + description: | + Key/value pairs of strings with additional information about the + component. These values are intended for informational purposes + only, and their content is not defined, and not part of the API + specification. + + These messages can be printed by the client as information to the user. + type: "object" + x-nullable: true + Version: + description: "The version of the daemon" + type: "string" + example: "27.0.1" + ApiVersion: + description: | + The default (and highest) API version that is supported by the daemon + type: "string" + example: "1.47" + MinAPIVersion: + description: | + The minimum API version that is supported by the daemon + type: "string" + example: "1.24" + GitCommit: + description: | + The Git commit of the source code that was used to build the daemon + type: "string" + example: "48a66213fe" + GoVersion: + description: | + The version Go used to compile the daemon, and the version of the Go + runtime in use. + type: "string" + example: "go1.22.7" + Os: + description: | + The operating system that the daemon is running on ("linux" or "windows") + type: "string" + example: "linux" + Arch: + description: | + Architecture of the daemon, as returned by the Go runtime (`GOARCH`). + + A full list of possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "amd64" + KernelVersion: + description: | + The kernel version (`uname -r`) that the daemon is running on. + + This field is omitted when empty. + type: "string" + example: "6.8.0-31-generic" + Experimental: + description: | + Indicates if the daemon is started with experimental features enabled. + + This field is omitted when empty / false. + type: "boolean" + example: true + BuildTime: + description: | + The date and time that the daemon was compiled. + type: "string" + example: "2020-06-22T15:49:27.000000000+00:00" + + SystemInfo: + type: "object" + properties: + ID: + description: | + Unique identifier of the daemon. + + <p><br /></p> + + > **Note**: The format of the ID itself is not part of the API, and + > should not be considered stable. + type: "string" + example: "7TRN:IPZB:QYBB:VPBQ:UMPP:KARE:6ZNR:XE6T:7EWV:PKF4:ZOJD:TPYS" + Containers: + description: "Total number of containers on the host." + type: "integer" + example: 14 + ContainersRunning: + description: | + Number of containers with status `"running"`. + type: "integer" + example: 3 + ContainersPaused: + description: | + Number of containers with status `"paused"`. + type: "integer" + example: 1 + ContainersStopped: + description: | + Number of containers with status `"stopped"`. + type: "integer" + example: 10 + Images: + description: | + Total number of images on the host. + + Both _tagged_ and _untagged_ (dangling) images are counted. + type: "integer" + example: 508 + Driver: + description: "Name of the storage driver in use." + type: "string" + example: "overlay2" + DriverStatus: + description: | + Information specific to the storage driver, provided as + "label" / "value" pairs. + + This information is provided by the storage driver, and formatted + in a way consistent with the output of `docker info` on the command + line. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["Backing Filesystem", "extfs"] + - ["Supports d_type", "true"] + - ["Native Overlay Diff", "true"] + DockerRootDir: + description: | + Root directory of persistent Docker state. + + Defaults to `/var/lib/docker` on Linux, and `C:\ProgramData\docker` + on Windows. + type: "string" + example: "/var/lib/docker" + Plugins: + $ref: "#/definitions/PluginsInfo" + MemoryLimit: + description: "Indicates if the host has memory limit support enabled." + type: "boolean" + example: true + SwapLimit: + description: "Indicates if the host has memory swap limit support enabled." + type: "boolean" + example: true + CpuCfsPeriod: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) period is supported by + the host. + type: "boolean" + example: true + CpuCfsQuota: + description: | + Indicates if CPU CFS(Completely Fair Scheduler) quota is supported by + the host. + type: "boolean" + example: true + CPUShares: + description: | + Indicates if CPU Shares limiting is supported by the host. + type: "boolean" + example: true + CPUSet: + description: | + Indicates if CPUsets (cpuset.cpus, cpuset.mems) are supported by the host. + + See [cpuset(7)](https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt) + type: "boolean" + example: true + PidsLimit: + description: "Indicates if the host kernel has PID limit support enabled." + type: "boolean" + example: true + OomKillDisable: + description: "Indicates if OOM killer disable is supported on the host." + type: "boolean" + IPv4Forwarding: + description: "Indicates IPv4 forwarding is enabled." + type: "boolean" + example: true + Debug: + description: | + Indicates if the daemon is running in debug-mode / with debug-level + logging enabled. + type: "boolean" + example: true + NFd: + description: | + The total number of file Descriptors in use by the daemon process. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 64 + NGoroutines: + description: | + The number of goroutines that currently exist. + + This information is only returned if debug-mode is enabled. + type: "integer" + example: 174 + SystemTime: + description: | + Current system-time in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) + format with nano-seconds. + type: "string" + example: "2017-08-08T20:28:29.06202363Z" + LoggingDriver: + description: | + The logging driver to use as a default for new containers. + type: "string" + CgroupDriver: + description: | + The driver to use for managing cgroups. + type: "string" + enum: ["cgroupfs", "systemd", "none"] + default: "cgroupfs" + example: "cgroupfs" + CgroupVersion: + description: | + The version of the cgroup. + type: "string" + enum: ["1", "2"] + default: "1" + example: "1" + NEventsListener: + description: "Number of event listeners subscribed." + type: "integer" + example: 30 + KernelVersion: + description: | + Kernel version of the host. + + On Linux, this information obtained from `uname`. On Windows this + information is queried from the <kbd>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\</kbd> + registry value, for example _"10.0 14393 (14393.1198.amd64fre.rs1_release_sec.170427-1353)"_. + type: "string" + example: "6.8.0-31-generic" + OperatingSystem: + description: | + Name of the host's operating system, for example: "Ubuntu 24.04 LTS" + or "Windows Server 2016 Datacenter" + type: "string" + example: "Ubuntu 24.04 LTS" + OSVersion: + description: | + Version of the host's operating system + + <p><br /></p> + + > **Note**: The information returned in this field, including its + > very existence, and the formatting of values, should not be considered + > stable, and may change without notice. + type: "string" + example: "24.04" + OSType: + description: | + Generic type of the operating system of the host, as returned by the + Go runtime (`GOOS`). + + Currently returned values are "linux" and "windows". A full list of + possible values can be found in the [Go documentation](https://go.dev/doc/install/source#environment). + type: "string" + example: "linux" + Architecture: + description: | + Hardware architecture of the host, as returned by the operating system. + This is equivalent to the output of `uname -m` on Linux. + + Unlike `Arch` (from `/version`), this reports the machine's native + architecture, which can differ from the Go runtime architecture when + running a binary compiled for a different architecture (for example, + a 32-bit binary running on 64-bit hardware). + type: "string" + example: "x86_64" + NCPU: + description: | + The number of logical CPUs usable by the daemon. + + The number of available CPUs is checked by querying the operating + system when the daemon starts. Changes to operating system CPU + allocation after the daemon is started are not reflected. + type: "integer" + example: 4 + MemTotal: + description: | + Total amount of physical memory available on the host, in bytes. + type: "integer" + format: "int64" + example: 2095882240 + + IndexServerAddress: + description: | + Address / URL of the index server that is used for image search, + and as a default for user authentication for Docker Hub and Docker Cloud. + default: "https://index.docker.io/v1/" + type: "string" + example: "https://index.docker.io/v1/" + RegistryConfig: + $ref: "#/definitions/RegistryServiceConfig" + GenericResources: + $ref: "#/definitions/GenericResources" + HttpProxy: + description: | + HTTP-proxy configured for the daemon. This value is obtained from the + [`HTTP_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "http://xxxxx:xxxxx@proxy.corp.example.com:8080" + HttpsProxy: + description: | + HTTPS-proxy configured for the daemon. This value is obtained from the + [`HTTPS_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) environment variable. + Credentials ([user info component](https://tools.ietf.org/html/rfc3986#section-3.2.1)) in the proxy URL + are masked in the API response. + + Containers do not automatically inherit this configuration. + type: "string" + example: "https://xxxxx:xxxxx@proxy.corp.example.com:4443" + NoProxy: + description: | + Comma-separated list of domain extensions for which no proxy should be + used. This value is obtained from the [`NO_PROXY`](https://www.gnu.org/software/wget/manual/html_node/Proxies.html) + environment variable. + + Containers do not automatically inherit this configuration. + type: "string" + example: "*.local, 169.254/16" + Name: + description: "Hostname of the host." + type: "string" + example: "node5.corp.example.com" + Labels: + description: | + User-defined labels (key/value metadata) as set on the daemon. + + <p><br /></p> + + > **Note**: When part of a Swarm, nodes can both have _daemon_ labels, + > set through the daemon configuration, and _node_ labels, set from a + > manager node in the Swarm. Node labels are not included in this + > field. Node labels can be retrieved using the `/nodes/(id)` endpoint + > on a manager node in the Swarm. + type: "array" + items: + type: "string" + example: ["storage=ssd", "production"] + ExperimentalBuild: + description: | + Indicates if experimental features are enabled on the daemon. + type: "boolean" + example: true + ServerVersion: + description: | + Version string of the daemon. + type: "string" + example: "27.0.1" + Runtimes: + description: | + List of [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtimes configured on the daemon. Keys hold the "name" used to + reference the runtime. + + The Docker daemon relies on an OCI compliant runtime (invoked via the + `containerd` daemon) as its interface to the Linux kernel namespaces, + cgroups, and SELinux. + + The default runtime is `runc`, and automatically configured. Additional + runtimes can be configured by the user and will be listed here. + type: "object" + additionalProperties: + $ref: "#/definitions/Runtime" + default: + runc: + path: "runc" + example: + runc: + path: "runc" + runc-master: + path: "/go/bin/runc" + custom: + path: "/usr/local/bin/my-oci-runtime" + runtimeArgs: ["--debug", "--systemd-cgroup=false"] + DefaultRuntime: + description: | + Name of the default OCI runtime that is used when starting containers. + + The default can be overridden per-container at create time. + type: "string" + default: "runc" + example: "runc" + Swarm: + $ref: "#/definitions/SwarmInfo" + LiveRestoreEnabled: + description: | + Indicates if live restore is enabled. + + If enabled, containers are kept running when the daemon is shutdown + or upon daemon start if running containers are detected. + type: "boolean" + default: false + example: false + Isolation: + description: | + Represents the isolation technology to use as a default for containers. + The supported values are platform-specific. + + If no isolation value is specified on daemon start, on Windows client, + the default is `hyperv`, and on Windows server, the default is `process`. + + This option is currently not used on other platforms. + default: "default" + type: "string" + enum: + - "default" + - "hyperv" + - "process" + - "" + InitBinary: + description: | + Name and, optional, path of the `docker-init` binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "docker-init" + ContainerdCommit: + $ref: "#/definitions/Commit" + RuncCommit: + $ref: "#/definitions/Commit" + InitCommit: + $ref: "#/definitions/Commit" + SecurityOptions: + description: | + List of security features that are enabled on the daemon, such as + apparmor, seccomp, SELinux, user-namespaces (userns), rootless and + no-new-privileges. + + Additional configuration options for each security feature may + be present, and are included as a comma-separated list of key/value + pairs. + type: "array" + items: + type: "string" + example: + - "name=apparmor" + - "name=seccomp,profile=default" + - "name=selinux" + - "name=userns" + - "name=rootless" + ProductLicense: + description: | + Reports a summary of the product license on the daemon. + + If a commercial license has been applied to the daemon, information + such as number of nodes, and expiration are included. + type: "string" + example: "Community Engine" + DefaultAddressPools: + description: | + List of custom default address pools for local networks, which can be + specified in the daemon.json file or dockerd option. + + Example: a Base "10.10.0.0/16" with Size 24 will define the set of 256 + 10.10.[0-255].0/24 address pools. + type: "array" + items: + type: "object" + properties: + Base: + description: "The network address in CIDR format" + type: "string" + example: "10.10.0.0/16" + Size: + description: "The network pool size" + type: "integer" + example: "24" + FirewallBackend: + $ref: "#/definitions/FirewallInfo" + DiscoveredDevices: + description: | + List of devices discovered by device drivers. + + Each device includes information about its source driver, kind, name, + and additional driver-specific attributes. + type: "array" + items: + $ref: "#/definitions/DeviceInfo" + NRI: + $ref: "#/definitions/NRIInfo" + Warnings: + description: | + List of warnings / informational messages about missing features, or + issues related to the daemon configuration. + + These messages can be printed by the client as information to the user. + type: "array" + items: + type: "string" + example: + - "WARNING: No memory limit support" + CDISpecDirs: + description: | + List of directories where (Container Device Interface) CDI + specifications are located. + + These specifications define vendor-specific modifications to an OCI + runtime specification for a container being created. + + An empty list indicates that CDI device injection is disabled. + + Note that since using CDI device injection requires the daemon to have + experimental enabled. For non-experimental daemons an empty list will + always be returned. + type: "array" + items: + type: "string" + example: + - "/etc/cdi" + - "/var/run/cdi" + Containerd: + $ref: "#/definitions/ContainerdInfo" + + ContainerdInfo: + description: | + Information for connecting to the containerd instance that is used by the daemon. + This is included for debugging purposes only. + type: "object" + x-nullable: true + properties: + Address: + description: "The address of the containerd socket." + type: "string" + example: "/run/containerd/containerd.sock" + Namespaces: + description: | + The namespaces that the daemon uses for running containers and + plugins in containerd. These namespaces can be configured in the + daemon configuration, and are considered to be used exclusively + by the daemon, Tampering with the containerd instance may cause + unexpected behavior. + + As these namespaces are considered to be exclusively accessed + by the daemon, it is not recommended to change these values, + or to change them to a value that is used by other systems, + such as cri-containerd. + type: "object" + properties: + Containers: + description: | + The default containerd namespace used for containers managed + by the daemon. + + The default namespace for containers is "moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "moby" + example: "moby" + Plugins: + description: | + The default containerd namespace used for plugins managed by + the daemon. + + The default namespace for plugins is "plugins.moby", but will be + suffixed with the `<uid>.<gid>` of the remapped `root` if + user-namespaces are enabled and the containerd image-store + is used. + type: "string" + default: "plugins.moby" + example: "plugins.moby" + + FirewallInfo: + description: | + Information about the daemon's firewalling configuration. + + This field is currently only used on Linux, and omitted on other platforms. + type: "object" + x-nullable: true + properties: + Driver: + description: | + The name of the firewall backend driver. + type: "string" + example: "nftables" + Info: + description: | + Information about the firewall backend, provided as + "label" / "value" pairs. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "array" + items: + type: "array" + items: + type: "string" + example: + - ["ReloadedAt", "2025-01-01T00:00:00Z"] + + # PluginsInfo is a temp struct holding Plugins name + # registered with docker daemon. It is used by Info struct + PluginsInfo: + description: | + Available plugins per type. + + <p><br /></p> + + > **Note**: Only unmanaged (V1) plugins are included in this list. + > V1 plugins are "lazily" loaded, and are not returned in this list + > if there is no resource using the plugin. + type: "object" + properties: + Volume: + description: "Names of available volume-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["local"] + Network: + description: "Names of available network-drivers, and network-driver plugins." + type: "array" + items: + type: "string" + example: ["bridge", "host", "ipvlan", "macvlan", "null", "overlay"] + Authorization: + description: "Names of available authorization plugins." + type: "array" + items: + type: "string" + example: ["img-authz-plugin", "hbm"] + Log: + description: "Names of available logging-drivers, and logging-driver plugins." + type: "array" + items: + type: "string" + example: ["awslogs", "fluentd", "gcplogs", "gelf", "journald", "json-file", "splunk", "syslog"] + + + RegistryServiceConfig: + description: | + RegistryServiceConfig stores daemon registry services configuration. + type: "object" + x-nullable: true + properties: + InsecureRegistryCIDRs: + description: | + List of IP ranges of insecure registries, using the CIDR syntax + ([RFC 4632](https://tools.ietf.org/html/4632)). Insecure registries + accept un-encrypted (HTTP) and/or untrusted (HTTPS with certificates + from unknown CAs) communication. + + By default, local registries (`::1/128` and `127.0.0.0/8`) are configured as + insecure. All other registries are secure. Communicating with an + insecure registry is not possible if the daemon assumes that registry + is secure. + + This configuration override this behavior, insecure communication with + registries whose resolved IP address is within the subnet described by + the CIDR syntax. + + Registries can also be marked insecure by hostname. Those registries + are listed under `IndexConfigs` and have their `Secure` field set to + `false`. + + > **Warning**: Using this option can be useful when running a local + > registry, but introduces security vulnerabilities. This option + > should therefore ONLY be used for testing purposes. For increased + > security, users should add their CA to their system's list of trusted + > CAs instead of enabling this option. + type: "array" + items: + type: "string" + example: ["::1/128", "127.0.0.0/8"] + IndexConfigs: + type: "object" + additionalProperties: + $ref: "#/definitions/IndexInfo" + example: + "127.0.0.1:5000": + "Name": "127.0.0.1:5000" + "Mirrors": [] + "Secure": false + "Official": false + "[2001:db8:a0b:12f0::1]:80": + "Name": "[2001:db8:a0b:12f0::1]:80" + "Mirrors": [] + "Secure": false + "Official": false + "docker.io": + Name: "docker.io" + Mirrors: ["https://hub-mirror.corp.example.com:5000/"] + Secure: true + Official: true + "registry.internal.corp.example.com:3000": + Name: "registry.internal.corp.example.com:3000" + Mirrors: [] + Secure: false + Official: false + Mirrors: + description: | + List of registry URLs that act as a mirror for the official + (`docker.io`) registry. + + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://[2001:db8:a0b:12f0::1]/" + + IndexInfo: + description: + IndexInfo contains information about a registry. + type: "object" + x-nullable: true + properties: + Name: + description: | + Name of the registry, such as "docker.io". + type: "string" + example: "docker.io" + Mirrors: + description: | + List of mirrors, expressed as URIs. + type: "array" + items: + type: "string" + example: + - "https://hub-mirror.corp.example.com:5000/" + - "https://registry-2.docker.io/" + - "https://registry-3.docker.io/" + Secure: + description: | + Indicates if the registry is part of the list of insecure + registries. + + If `false`, the registry is insecure. Insecure registries accept + un-encrypted (HTTP) and/or untrusted (HTTPS with certificates from + unknown CAs) communication. + + > **Warning**: Insecure registries can be useful when running a local + > registry. However, because its use creates security vulnerabilities + > it should ONLY be enabled for testing purposes. For increased + > security, users should add their CA to their system's list of + > trusted CAs instead of enabling this option. + type: "boolean" + example: true + Official: + description: | + Indicates whether this is an official registry (i.e., Docker Hub / docker.io) + type: "boolean" + example: true + + Runtime: + description: | + Runtime describes an [OCI compliant](https://github.com/opencontainers/runtime-spec) + runtime. + + The runtime is invoked by the daemon via the `containerd` daemon. OCI + runtimes act as an interface to the Linux kernel namespaces, cgroups, + and SELinux. + type: "object" + properties: + path: + description: | + Name and, optional, path, of the OCI executable binary. + + If the path is omitted, the daemon searches the host's `$PATH` for the + binary and uses the first result. + type: "string" + example: "/usr/local/bin/my-oci-runtime" + runtimeArgs: + description: | + List of command-line arguments to pass to the runtime when invoked. + type: "array" + x-nullable: true + items: + type: "string" + example: ["--debug", "--systemd-cgroup=false"] + status: + description: | + Information specific to the runtime. + + While this API specification does not define data provided by runtimes, + the following well-known properties may be provided by runtimes: + + `org.opencontainers.runtime-spec.features`: features structure as defined + in the [OCI Runtime Specification](https://github.com/opencontainers/runtime-spec/blob/main/features.md), + in a JSON string representation. + + <p><br /></p> + + > **Note**: The information returned in this field, including the + > formatting of values and labels, should not be considered stable, + > and may change without notice. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "org.opencontainers.runtime-spec.features": "{\"ociVersionMin\":\"1.0.0\",\"ociVersionMax\":\"1.1.0\",\"...\":\"...\"}" + + Commit: + description: | + Commit holds the Git-commit (SHA1) that a binary was built from, as + reported in the version-string of external tools, such as `containerd`, + or `runC`. + type: "object" + properties: + ID: + description: "Actual commit ID of external tool." + type: "string" + example: "cfb82a876ecc11b5ca0977d1733adbe58599088a" + + SwarmInfo: + description: | + Represents generic information about swarm. + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + default: "" + example: "k67qz4598weg5unwwffg6z1m1" + NodeAddr: + description: | + IP address at which this node can be reached by other nodes in the + swarm. + type: "string" + default: "" + example: "10.0.0.46" + LocalNodeState: + $ref: "#/definitions/LocalNodeState" + ControlAvailable: + type: "boolean" + default: false + example: true + Error: + type: "string" + default: "" + RemoteManagers: + description: | + List of ID's and addresses of other managers in the swarm. + type: "array" + default: null + x-nullable: true + items: + $ref: "#/definitions/PeerNode" + example: + - NodeID: "71izy0goik036k48jg985xnds" + Addr: "10.0.0.158:2377" + - NodeID: "79y6h1o4gv8n120drcprv5nmc" + Addr: "10.0.0.159:2377" + - NodeID: "k67qz4598weg5unwwffg6z1m1" + Addr: "10.0.0.46:2377" + Nodes: + description: "Total number of nodes in the swarm." + type: "integer" + x-nullable: true + example: 4 + Managers: + description: "Total number of managers in the swarm." + type: "integer" + x-nullable: true + example: 3 + Cluster: + $ref: "#/definitions/ClusterInfo" + + LocalNodeState: + description: "Current local status of this node." + type: "string" + default: "" + enum: + - "" + - "inactive" + - "pending" + - "active" + - "error" + - "locked" + example: "active" + + PeerNode: + description: "Represents a peer-node in the swarm" + type: "object" + properties: + NodeID: + description: "Unique identifier of for this node in the swarm." + type: "string" + Addr: + description: | + IP address and ports at which this node can be reached. + type: "string" + + NetworkAttachmentConfig: + description: | + Specifies how a service should be attached to a particular network. + type: "object" + properties: + Target: + description: | + The target network for attachment. Must be a network name or ID. + type: "string" + Aliases: + description: | + Discoverable alternate names for the service on this network. + type: "array" + items: + type: "string" + DriverOpts: + description: | + Driver attachment options for the network target. + type: "object" + additionalProperties: + type: "string" + + EventActor: + description: | + Actor describes something that generates events, like a container, network, + or a volume. + type: "object" + properties: + ID: + description: "The ID of the object emitting the event" + type: "string" + example: "ede54ee1afda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c743" + Attributes: + description: | + Various key/value attributes of the object, depending on its type. + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-label-value" + image: "alpine:latest" + name: "my-container" + + EventMessage: + description: | + EventMessage represents the information an event contains. + type: "object" + title: "SystemEventsResponse" + properties: + Type: + description: "The type of object emitting the event" + type: "string" + enum: ["builder", "config", "container", "daemon", "image", "network", "node", "plugin", "secret", "service", "volume"] + example: "container" + Action: + description: "The type of event" + type: "string" + example: "create" + Actor: + $ref: "#/definitions/EventActor" + scope: + description: | + Scope of the event. Engine events are `local` scope. Cluster (Swarm) + events are `swarm` scope. + type: "string" + enum: ["local", "swarm"] + time: + description: "Timestamp of event" + type: "integer" + format: "int64" + example: 1629574695 + timeNano: + description: "Timestamp of event, with nanosecond accuracy" + type: "integer" + format: "int64" + example: 1629574695515050031 + + OCIDescriptor: + type: "object" + x-go-name: Descriptor + description: | + A descriptor struct containing digest, media type, and size, as defined in + the [OCI Content Descriptors Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md). + properties: + mediaType: + description: | + The media type of the object this schema refers to. + type: "string" + example: "application/vnd.oci.image.manifest.v1+json" + digest: + description: | + The digest of the targeted content. + type: "string" + example: "sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96" + size: + description: | + The size in bytes of the blob. + type: "integer" + format: "int64" + example: 424 + urls: + description: |- + List of URLs from which this object MAY be downloaded. + type: "array" + items: + type: "string" + format: "uri" + x-nullable: true + annotations: + description: |- + Arbitrary metadata relating to the targeted content. + type: "object" + x-nullable: true + additionalProperties: + type: "string" + example: + "com.docker.official-images.bashbrew.arch": "amd64" + "org.opencontainers.image.base.digest": "sha256:0d0ef5c914d3ea700147da1bd050c59edb8bb12ca312f3800b29d7c8087eabd8" + "org.opencontainers.image.base.name": "scratch" + "org.opencontainers.image.created": "2025-01-27T00:00:00Z" + "org.opencontainers.image.revision": "9fabb4bad5138435b01857e2fe9363e2dc5f6a79" + "org.opencontainers.image.source": "https://git.launchpad.net/cloud-images/+oci/ubuntu-base" + "org.opencontainers.image.url": "https://hub.docker.com/_/ubuntu" + "org.opencontainers.image.version": "24.04" + data: + type: string + x-nullable: true + description: |- + Data is an embedding of the targeted content. This is encoded as a base64 + string when marshalled to JSON (automatically, by encoding/json). If + present, Data can be used directly to avoid fetching the targeted content. + example: null + platform: + $ref: "#/definitions/OCIPlatform" + artifactType: + description: |- + ArtifactType is the IANA media type of this artifact. + type: "string" + x-nullable: true + example: null + + OCIPlatform: + type: "object" + x-go-name: Platform + x-nullable: true + description: | + Describes the platform which the image in the manifest runs on, as defined + in the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.0.1/image-index.md). + properties: + architecture: + description: | + The CPU architecture, for example `amd64` or `ppc64`. + type: "string" + example: "arm" + os: + description: | + The operating system, for example `linux` or `windows`. + type: "string" + example: "windows" + os.version: + description: | + Optional field specifying the operating system version, for example on + Windows `10.0.19041.1165`. + type: "string" + example: "10.0.19041.1165" + os.features: + description: | + Optional field specifying an array of strings, each listing a required + OS feature (for example on Windows `win32k`). + type: "array" + items: + type: "string" + example: + - "win32k" + variant: + description: | + Optional field specifying a variant of the CPU, for example `v7` to + specify ARMv7 when architecture is `arm`. + type: "string" + example: "v7" + + DistributionInspect: + type: "object" + x-go-name: DistributionInspect + title: "DistributionInspectResponse" + required: [Descriptor, Platforms] + description: | + Describes the result obtained from contacting the registry to retrieve + image metadata. + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Platforms: + type: "array" + description: | + An array containing all platforms supported by the image. + items: + $ref: "#/definitions/OCIPlatform" + + ClusterVolume: + type: "object" + description: | + Options and information specific to, and only present on, Swarm CSI + cluster volumes. + properties: + ID: + type: "string" + description: | + The Swarm ID of this volume. Because cluster volumes are Swarm + objects, they have an ID, unlike non-cluster volumes. This ID can + be used to refer to the Volume instead of the name. + Version: + $ref: "#/definitions/ObjectVersion" + CreatedAt: + type: "string" + format: "dateTime" + UpdatedAt: + type: "string" + format: "dateTime" + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + Info: + type: "object" + description: | + Information about the global status of the volume. + properties: + CapacityBytes: + type: "integer" + format: "int64" + description: | + The capacity of the volume in bytes. A value of 0 indicates that + the capacity is unknown. + VolumeContext: + type: "object" + description: | + A map of strings to strings returned from the storage plugin when + the volume is created. + additionalProperties: + type: "string" + VolumeID: + type: "string" + description: | + The ID of the volume as returned by the CSI storage plugin. This + is distinct from the volume's ID as provided by Docker. This ID + is never used by the user when communicating with Docker to refer + to this volume. If the ID is blank, then the Volume has not been + successfully created in the plugin yet. + AccessibleTopology: + type: "array" + description: | + The topology this volume is actually accessible from. + items: + $ref: "#/definitions/Topology" + PublishStatus: + type: "array" + description: | + The status of the volume as it pertains to its publishing and use on + specific nodes + items: + type: "object" + properties: + NodeID: + type: "string" + description: | + The ID of the Swarm node the volume is published on. + State: + type: "string" + description: | + The published state of the volume. + * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. + * `published` The volume is published successfully to the node. + * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. + * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. + enum: + - "pending-publish" + - "published" + - "pending-node-unpublish" + - "pending-controller-unpublish" + PublishContext: + type: "object" + description: | + A map of strings to strings returned by the CSI controller + plugin when a volume is published. + additionalProperties: + type: "string" + + ClusterVolumeSpec: + type: "object" + description: | + Cluster-specific options used to create the volume. + properties: + Group: + type: "string" + description: | + Group defines the volume group of this volume. Volumes belonging to + the same group can be referred to by group name when creating + Services. Referring to a volume by group instructs Swarm to treat + volumes in that group interchangeably for the purpose of scheduling. + Volumes with an empty string for a group technically all belong to + the same, emptystring group. + AccessMode: + type: "object" + description: | + Defines how the volume is used by tasks. + properties: + Scope: + type: "string" + description: | + The set of nodes this volume can be used on at one time. + - `single` The volume may only be scheduled to one node at a time. + - `multi` the volume may be scheduled to any supported number of nodes at a time. + default: "single" + enum: ["single", "multi"] + x-nullable: false + Sharing: + type: "string" + description: | + The number and way that different tasks can use this volume + at one time. + - `none` The volume may only be used by one task at a time. + - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly + - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. + - `all` The volume may have any number of readers and writers. + default: "none" + enum: ["none", "readonly", "onewriter", "all"] + x-nullable: false + MountVolume: + type: "object" + description: | + Options for using this volume as a Mount-type volume. + + Either MountVolume or BlockVolume, but not both, must be + present. + properties: + FsType: + type: "string" + description: | + Specifies the filesystem type for the mount volume. + Optional. + MountFlags: + type: "array" + description: | + Flags to pass when mounting the volume. Optional. + items: + type: "string" + BlockVolume: + type: "object" + description: | + Options for using this volume as a Block-type volume. + Intentionally empty. + Secrets: + type: "array" + description: | + Swarm Secrets that are passed to the CSI storage plugin when + operating on this volume. + items: + type: "object" + description: | + One cluster volume secret entry. Defines a key-value pair that + is passed to the plugin. + properties: + Key: + type: "string" + description: | + Key is the name of the key of the key-value pair passed to + the plugin. + Secret: + type: "string" + description: | + Secret is the swarm Secret object from which to read data. + This can be a Secret name or ID. The Secret data is + retrieved by swarm and used as the value of the key-value + pair passed to the plugin. + AccessibilityRequirements: + type: "object" + description: | + Requirements for the accessible topology of the volume. These + fields are optional. For an in-depth description of what these + fields mean, see the CSI specification. + properties: + Requisite: + type: "array" + description: | + A list of required topologies, at least one of which the + volume must be accessible from. + items: + $ref: "#/definitions/Topology" + Preferred: + type: "array" + description: | + A list of topologies that the volume should attempt to be + provisioned in. + items: + $ref: "#/definitions/Topology" + CapacityRange: + type: "object" + description: | + The desired capacity that the volume should be created with. If + empty, the plugin will decide the capacity. + properties: + RequiredBytes: + type: "integer" + format: "int64" + description: | + The volume must be at least this big. The value of 0 + indicates an unspecified minimum + LimitBytes: + type: "integer" + format: "int64" + description: | + The volume must not be bigger than this. The value of 0 + indicates an unspecified maximum. + Availability: + type: "string" + description: | + The availability of the volume for use in tasks. + - `active` The volume is fully available for scheduling on the cluster + - `pause` No new workloads should use the volume, but existing workloads are not stopped. + - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. + default: "active" + x-nullable: false + enum: + - "active" + - "pause" + - "drain" + + Topology: + description: | + A map of topological domains to topological segments. For in depth + details, see documentation for the Topology object in the CSI + specification. + type: "object" + properties: + Segments: + type: "object" + additionalProperties: + type: "string" + + AttestationStatement: + x-go-name: "AttestationStatement" + description: | + AttestationStatement is a single in-toto statement attached to an image. + type: "object" + required: ["Descriptor", "PredicateType"] + properties: + Descriptor: + $ref: "#/definitions/OCIDescriptor" + PredicateType: + description: The in-toto predicate type URI of this statement. + type: "string" + example: "https://slsa.dev/provenance/v0.2" + Statement: + description: | + The verbatim in-toto statement JSON. Only included when the caller + opts in via the `statement=true` query parameter; otherwise absent. + type: "object" + x-nullable: true + ImageManifestSummary: + x-go-name: "ManifestSummary" + description: | + ImageManifestSummary represents a summary of an image manifest. + type: "object" + required: ["ID", "Descriptor", "Available", "Size", "Kind"] + properties: + ID: + description: | + ID is the content-addressable ID of an image and is the same as the + digest of the image manifest. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + Descriptor: + $ref: "#/definitions/OCIDescriptor" + Available: + description: Indicates whether all the child content (image config, layers) is fully available locally. + type: "boolean" + example: true + Size: + type: "object" + x-nullable: false + required: ["Content", "Total"] + properties: + Total: + type: "integer" + format: "int64" + example: 8213251 + description: | + Total is the total size (in bytes) of all the locally present + data (both distributable and non-distributable) that's related to + this manifest and its children. + This equal to the sum of [Content] size AND all the sizes in the + [Size] struct present in the Kind-specific data struct. + For example, for an image kind (Kind == "image") + this would include the size of the image content and unpacked + image snapshots ([Size.Content] + [ImageData.Size.Unpacked]). + Content: + description: | + Content is the size (in bytes) of all the locally present + content in the content store (e.g. image config, layers) + referenced by this manifest and its children. + This only includes blobs in the content store. + type: "integer" + format: "int64" + example: 3987495 + Kind: + type: "string" + example: "image" + enum: + - "image" + - "attestation" + - "unknown" + description: | + The kind of the manifest. + + kind | description + -------------|----------------------------------------------------------- + image | Image manifest that can be used to start a container. + attestation | Attestation manifest produced by the Buildkit builder for a specific image manifest. + ImageData: + description: | + The image data for the image manifest. + This field is only populated when Kind is "image". + type: "object" + x-nullable: true + x-omitempty: true + required: ["Platform", "Containers", "Size", "UnpackedSize"] + properties: + Platform: + $ref: "#/definitions/OCIPlatform" + description: | + OCI platform of the image. This will be the platform specified in the + manifest descriptor from the index/manifest list. + If it's not available, it will be obtained from the image config. + Identity: + description: | + Identity holds information about the identity and origin of this image. + For image list responses, this can duplicate Build/Pull fields across + image manifests, because those parts are image-level metadata. + x-nullable: true + $ref: "#/definitions/Identity" + Containers: + description: | + The IDs of the containers that are using this image. + type: "array" + items: + type: "string" + example: ["ede54ee1fda366ab42f824e8a5ffd195155d853ceaec74a927f249ea270c7430", "abadbce344c096744d8d6071a90d474d28af8f1034b5ea9fb03c3f4bfc6d005e"] + Size: + type: "object" + x-nullable: false + required: ["Unpacked"] + properties: + Unpacked: + type: "integer" + format: "int64" + example: 3987495 + description: | + Unpacked is the size (in bytes) of the locally unpacked + (uncompressed) image content that's directly usable by the containers + running this image. + It's independent of the distributable content - e.g. + the image might still have an unpacked data that's still used by + some container even when the distributable/compressed content is + already gone. + AttestationData: + description: | + The image data for the attestation manifest. + This field is only populated when Kind is "attestation". + type: "object" + x-nullable: true + x-omitempty: true + required: ["For"] + properties: + For: + description: | + The digest of the image manifest that this attestation is for. + type: "string" + example: "sha256:95869fbcf224d947ace8d61d0e931d49e31bb7fc67fffbbe9c3198c33aa8e93f" + +paths: + /containers/json: + get: + summary: "List containers" + description: | + Returns a list of containers. For details on the format, see the + [inspect endpoint](#operation/ContainerInspect). + + Note that it uses a different, smaller representation of a container + than inspecting a single container. For example, the list of linked + containers is not propagated . + operationId: "ContainerList" + produces: + - "application/json" + parameters: + - name: "all" + in: "query" + description: | + Return all containers. By default, only running containers are shown. + type: "boolean" + default: false + - name: "limit" + in: "query" + description: | + Return this number of most recently created containers, including + non-running ones. + type: "integer" + - name: "size" + in: "query" + description: | + Return the size of container as fields `SizeRw` and `SizeRootFs`. + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + Filters to process on the container list, encoded as JSON (a + `map[string][]string`). For example, `{"status": ["paused"]}` will + only return paused containers. + + Available filters: + + - `ancestor`=(`<image-name>[:<tag>]`, `<image id>`, or `<image@digest>`) + - `before`=(`<container id>` or `<container name>`) + - `expose`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `exited=<int>` containers with exit code of `<int>` + - `health`=(`starting`|`healthy`|`unhealthy`|`none`) + - `id=<ID>` a container's ID + - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + - `is-task=`(`true`|`false`) + - `label=key` or `label="key=value"` of a container label + - `name=<name>` a container's name + - `network`=(`<network id>` or `<network name>`) + - `publish`=(`<port>[/<proto>]`|`<startport-endport>/[<proto>]`) + - `since`=(`<container id>` or `<container name>`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) + - `volume`=(`<volume name>` or `<mount point destination>`) + type: "string" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/ContainerSummary" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/create: + post: + summary: "Create a container" + operationId: "ContainerCreate" + consumes: + - "application/json" + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "name" + in: "query" + description: | + Assign the specified name to the container. Must match + `/?[a-zA-Z0-9][a-zA-Z0-9_.-]+`. + type: "string" + pattern: "^/?[a-zA-Z0-9][a-zA-Z0-9_.-]+$" + - name: "platform" + in: "query" + description: | + Platform in the format `os[/arch[/variant]]` used for image lookup. + + When specified, the daemon checks if the requested image is present + in the local image cache with the given OS and Architecture, and + otherwise returns a `404` status. + + If the option is not set, the host's native OS and Architecture are + used to look up the image in the image cache. However, if no platform + is passed and the given image does exist in the local image cache, + but its OS or architecture does not match, the container is created + with the available image, and a warning is added to the `Warnings` + field in the response, for example; + + WARNING: The requested image's platform (linux/arm64/v8) does not + match the detected host platform (linux/amd64) and no + specific platform was requested + + type: "string" + default: "" + - name: "body" + in: "body" + description: "Container to create" + schema: + allOf: + - $ref: "#/definitions/ContainerConfig" + - type: "object" + properties: + HostConfig: + $ref: "#/definitions/HostConfig" + NetworkingConfig: + $ref: "#/definitions/NetworkingConfig" + example: + Hostname: "" + Domainname: "" + User: "" + AttachStdin: false + AttachStdout: true + AttachStderr: true + Tty: false + OpenStdin: false + StdinOnce: false + Env: + - "FOO=bar" + - "BAZ=quux" + Cmd: + - "date" + Entrypoint: "" + Image: "ubuntu" + Labels: + com.example.vendor: "Acme" + com.example.license: "GPL" + com.example.version: "1.0" + Volumes: + /volumes/data: {} + WorkingDir: "" + NetworkDisabled: false + ExposedPorts: + 22/tcp: {} + StopSignal: "SIGTERM" + StopTimeout: 10 + HostConfig: + Binds: + - "/tmp:/tmp" + Links: + - "redis3:redis" + Memory: 0 + MemorySwap: 0 + MemoryReservation: 0 + NanoCpus: 500000 + CpuPercent: 80 + CpuShares: 512 + CpuPeriod: 100000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpuQuota: 50000 + CpusetCpus: "0,1" + CpusetMems: "0,1" + MaximumIOps: 0 + MaximumIOBps: 0 + BlkioWeight: 300 + BlkioWeightDevice: + - {} + BlkioDeviceReadBps: + - {} + BlkioDeviceReadIOps: + - {} + BlkioDeviceWriteBps: + - {} + BlkioDeviceWriteIOps: + - {} + DeviceRequests: + - Driver: "nvidia" + Count: -1 + DeviceIDs": ["0", "1", "GPU-fef8089b-4820-abfc-e83e-94318197576e"] + Capabilities: [["gpu", "nvidia", "compute"]] + Options: + property1: "string" + property2: "string" + MemorySwappiness: 60 + OomKillDisable: false + OomScoreAdj: 500 + PidMode: "" + PidsLimit: 0 + PortBindings: + 22/tcp: + - HostPort: "11022" + PublishAllPorts: false + Privileged: false + ReadonlyRootfs: false + Dns: + - "8.8.8.8" + DnsOptions: + - "" + DnsSearch: + - "" + VolumesFrom: + - "parent" + - "other:ro" + CapAdd: + - "NET_ADMIN" + CapDrop: + - "MKNOD" + GroupAdd: + - "newgroup" + RestartPolicy: + Name: "" + MaximumRetryCount: 0 + AutoRemove: true + NetworkMode: "bridge" + Devices: [] + Ulimits: + - {} + LogConfig: + Type: "json-file" + Config: {} + SecurityOpt: [] + StorageOpt: {} + CgroupParent: "" + VolumeDriver: "" + ShmSize: 67108864 + NetworkingConfig: + EndpointsConfig: + isolated_nw: + IPAMConfig: + IPv4Address: "172.20.30.33" + IPv6Address: "2001:db8:abcd::3033" + LinkLocalIPs: + - "169.254.34.68" + - "fe80::3468" + Links: + - "container_1" + - "container_2" + Aliases: + - "server_x" + - "server_y" + database_nw: {} + + required: true + responses: + 201: + description: "Container created successfully" + schema: + $ref: "#/definitions/ContainerCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /containers/{id}/json: + get: + summary: "Inspect a container" + description: "Return low-level information about a container." + operationId: "ContainerInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerInspectResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "size" + in: "query" + type: "boolean" + default: false + description: "Return the size of container as fields `SizeRw` and `SizeRootFs`" + tags: ["Container"] + /containers/{id}/top: + get: + summary: "List processes running inside a container" + description: | + On Unix systems, this is done by running the `ps` command. This endpoint + is not supported on Windows. + operationId: "ContainerTop" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerTopResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "ps_args" + in: "query" + description: "The arguments to pass to `ps`. For example, `aux`" + type: "string" + default: "-ef" + tags: ["Container"] + /containers/{id}/logs: + get: + summary: "Get container logs" + description: | + Get `stdout` and `stderr` logs from a container. + + Note: This endpoint works only for containers with the `json-file` or + `journald` logging driver. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ContainerLogs" + responses: + 200: + description: | + logs returned as a stream in response body. + For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach). + Note that unlike the attach endpoint, the logs endpoint does not + upgrade the connection and does not set Content-Type. + schema: + type: "string" + format: "binary" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "until" + in: "query" + description: "Only return logs before this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Container"] + /containers/{id}/changes: + get: + summary: "Get changes on a container’s filesystem" + description: | + Returns which files in a container's filesystem have been added, deleted, + or modified. The `Kind` of modification can be one of: + + - `0`: Modified ("C") + - `1`: Added ("A") + - `2`: Deleted ("D") + operationId: "ContainerChanges" + produces: ["application/json"] + responses: + 200: + description: "The list of changes" + schema: + type: "array" + items: + $ref: "#/definitions/FilesystemChange" + examples: + application/json: + - Path: "/dev" + Kind: 0 + - Path: "/dev/kmsg" + Kind: 1 + - Path: "/test" + Kind: 1 + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/export: + get: + summary: "Export a container" + description: "Export the contents of a container as a tarball." + operationId: "ContainerExport" + produces: + - "application/octet-stream" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/stats: + get: + summary: "Get container stats based on resource usage" + description: | + This endpoint returns a live stream of a container’s resource usage + statistics. + + The `precpu_stats` is the CPU statistic of the *previous* read, and is + used to calculate the CPU usage percentage. It is not an exact copy + of the `cpu_stats` field. + + If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is + nil then for compatibility with older daemons the length of the + corresponding `cpu_usage.percpu_usage` array should be used. + + On a cgroup v2 host, the following fields are not set + * `blkio_stats`: all fields other than `io_service_bytes_recursive` + * `cpu_stats`: `cpu_usage.percpu_usage` + * `memory_stats`: `max_usage` and `failcnt` + Also, `memory_stats.stats` fields are incompatible with cgroup v1. + + To calculate the values shown by the `stats` command of the docker cli tool + the following formulas can be used: + * used_memory = `memory_stats.usage - memory_stats.stats.cache` (cgroups v1) + * used_memory = `memory_stats.usage - memory_stats.stats.inactive_file` (cgroups v2) + * available_memory = `memory_stats.limit` + * Memory usage % = `(used_memory / available_memory) * 100.0` + * cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage` + * system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage` + * number_cpus = `length(cpu_stats.cpu_usage.percpu_usage)` or `cpu_stats.online_cpus` + * CPU usage % = `(cpu_delta / system_cpu_delta) * number_cpus * 100.0` + operationId: "ContainerStats" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ContainerStatsResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "stream" + in: "query" + description: | + Stream the output. If false, the stats will be output once and then + it will disconnect. + type: "boolean" + default: true + - name: "one-shot" + in: "query" + description: | + Only get a single stat instead of waiting for 2 cycles. Must be used + with `stream=false`. + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/resize: + post: + summary: "Resize a container TTY" + description: "Resize the TTY for a container." + operationId: "ContainerResize" + consumes: + - "application/octet-stream" + produces: + - "text/plain" + responses: + 200: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "cannot resize container" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Container"] + /containers/{id}/start: + post: + summary: "Start a container" + operationId: "ContainerStart" + responses: + 204: + description: "no error" + 304: + description: "container already started" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container. Format is a + single character `[a-Z]` or `ctrl-<value>` where `<value>` is one + of: `a-z`, `@`, `^`, `[`, `,` or `_`. + type: "string" + tags: ["Container"] + /containers/{id}/stop: + post: + summary: "Stop a container" + operationId: "ContainerStop" + responses: + 204: + description: "no error" + 304: + description: "container already stopped" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/restart: + post: + summary: "Restart a container" + operationId: "ContainerRestart" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + - name: "t" + in: "query" + description: "Number of seconds to wait before killing the container" + type: "integer" + tags: ["Container"] + /containers/{id}/kill: + post: + summary: "Kill a container" + description: | + Send a POSIX signal to a container, defaulting to killing to the + container. + operationId: "ContainerKill" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is not running" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "Container d37cde0fe4ad63c3a7252023b2f9800282894247d145cb5933ddf6e52cc03a28 is not running" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "signal" + in: "query" + description: | + Signal to send to the container as an integer or string (e.g. `SIGINT`). + type: "string" + default: "SIGKILL" + tags: ["Container"] + /containers/{id}/update: + post: + summary: "Update a container" + description: | + Change various configuration options of a container without having to + recreate it. + operationId: "ContainerUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "The container has been updated." + schema: + $ref: "#/definitions/ContainerUpdateResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "update" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/Resources" + - type: "object" + properties: + RestartPolicy: + $ref: "#/definitions/RestartPolicy" + example: + BlkioWeight: 300 + CpuShares: 512 + CpuPeriod: 100000 + CpuQuota: 50000 + CpuRealtimePeriod: 1000000 + CpuRealtimeRuntime: 10000 + CpusetCpus: "0,1" + CpusetMems: "0" + Memory: 314572800 + MemorySwap: 514288000 + MemoryReservation: 209715200 + RestartPolicy: + MaximumRetryCount: 4 + Name: "on-failure" + tags: ["Container"] + /containers/{id}/rename: + post: + summary: "Rename a container" + operationId: "ContainerRename" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "name already in use" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "name" + in: "query" + required: true + description: "New name for the container" + type: "string" + tags: ["Container"] + /containers/{id}/pause: + post: + summary: "Pause a container" + description: | + Use the freezer cgroup to suspend all processes in a container. + + Traditionally, when suspending a process the `SIGSTOP` signal is used, + which is observable by the process being suspended. With the freezer + cgroup the process is unaware, and unable to capture, that it is being + suspended, and subsequently resumed. + operationId: "ContainerPause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/unpause: + post: + summary: "Unpause a container" + description: "Resume a container which has been paused." + operationId: "ContainerUnpause" + responses: + 204: + description: "no error" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + tags: ["Container"] + /containers/{id}/attach: + post: + summary: "Attach to a container" + description: | + Attach to a container to read its output or send it input. You can attach + to the same container multiple times and you can reattach to containers + that have been detached. + + Either the `stream` or `logs` parameter must be `true` for this endpoint + to do anything. + + See the [documentation for the `docker attach` command](https://docs.docker.com/engine/reference/commandline/attach/) + for more details. + + ### Hijacking + + This endpoint hijacks the HTTP connection to transport `stdin`, `stdout`, + and `stderr` on the same socket. + + This is the response from the daemon for an attach request: + + ``` + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + [STREAM] + ``` + + After the headers and two new lines, the TCP connection can now be used + for raw, bidirectional communication between the client and server. + + To hint potential proxies about connection hijacking, the Docker client + can also optionally send connection upgrade headers. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /containers/16253994b7c4/attach?stream=1&stdout=1 HTTP/1.1 + Upgrade: tcp + Connection: Upgrade + ``` + + The Docker daemon will respond with a `101 UPGRADED` response, and will + similarly follow with the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Content-Type: application/vnd.docker.raw-stream + Connection: Upgrade + Upgrade: tcp + + [STREAM] + ``` + + ### Stream format + + When the TTY setting is disabled in [`POST /containers/create`](#operation/ContainerCreate), + the HTTP Content-Type header is set to application/vnd.docker.multiplexed-stream + and the stream over the hijacked connected is multiplexed to separate out + `stdout` and `stderr`. The stream consists of a series of frames, each + containing a header and a payload. + + The header contains the information which the stream writes (`stdout` or + `stderr`). It also contains the size of the associated frame encoded in + the last four bytes (`uint32`). + + It is encoded on the first eight bytes like this: + + ```go + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + ``` + + `STREAM_TYPE` can be: + + - 0: `stdin` (is written on `stdout`) + - 1: `stdout` + - 2: `stderr` + + `SIZE1, SIZE2, SIZE3, SIZE4` are the four bytes of the `uint32` size + encoded as big endian. + + Following the header is the payload, which is the specified number of + bytes of `STREAM_TYPE`. + + The simplest way to implement this protocol is the following: + + 1. Read 8 bytes. + 2. Choose `stdout` or `stderr` depending on the first byte. + 3. Extract the frame size from the last four bytes. + 4. Read the extracted size and output it on the correct output. + 5. Goto 1. + + ### Stream format when using a TTY + + When the TTY setting is enabled in [`POST /containers/create`](#operation/ContainerCreate), + the stream is not multiplexed. The data exchanged over the hijacked + connection is simply the raw data from the process PTY and client's + `stdin`. + + operationId: "ContainerAttach" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,` or `_`. + type: "string" + - name: "logs" + in: "query" + description: | + Replay previous logs from the container. + + This is useful for attaching to a container that has started and you + want to output everything since the container started. + + If `stream` is also enabled, once all the previous output has been + returned, it will seamlessly transition into streaming current + output. + type: "boolean" + default: false + - name: "stream" + in: "query" + description: | + Stream attached streams from the time the request was made onwards. + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/attach/ws: + get: + summary: "Attach to a container via a websocket" + operationId: "ContainerAttachWebsocket" + responses: + 101: + description: "no error, hints proxy about hijacking" + 200: + description: "no error, no upgrade header found" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "detachKeys" + in: "query" + description: | + Override the key sequence for detaching a container.Format is a single + character `[a-Z]` or `ctrl-<value>` where `<value>` is one of: `a-z`, + `@`, `^`, `[`, `,`, or `_`. + type: "string" + - name: "logs" + in: "query" + description: "Return logs" + type: "boolean" + default: false + - name: "stream" + in: "query" + description: "Return stream" + type: "boolean" + default: false + - name: "stdin" + in: "query" + description: "Attach to `stdin`" + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Attach to `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Attach to `stderr`" + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/wait: + post: + summary: "Wait for a container" + description: "Block until a container stops, then returns the exit code." + operationId: "ContainerWait" + produces: ["application/json"] + responses: + 200: + description: "The container has exit." + schema: + $ref: "#/definitions/ContainerWaitResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "condition" + in: "query" + description: | + Wait until a container state reaches the given condition. + + Defaults to `not-running` if omitted or empty. + type: "string" + enum: + - "not-running" + - "next-exit" + - "removed" + default: "not-running" + tags: ["Container"] + /containers/{id}: + delete: + summary: "Remove a container" + operationId: "ContainerDelete" + responses: + 204: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "conflict" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: | + You cannot remove a running container: c2ada9df5af8. Stop the + container before attempting removal or force remove + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "v" + in: "query" + description: "Remove anonymous volumes associated with the container." + type: "boolean" + default: false + - name: "force" + in: "query" + description: "If the container is running, kill it before removing it." + type: "boolean" + default: false + - name: "link" + in: "query" + description: "Remove the specified link associated with the container." + type: "boolean" + default: false + tags: ["Container"] + /containers/{id}/archive: + head: + summary: "Get information about files in a container" + description: | + A response header `X-Docker-Container-Path-Stat` is returned, containing + a base64 - encoded JSON object with some filesystem header information + about the path. + operationId: "ContainerArchiveInfo" + responses: + 200: + description: "no error" + headers: + X-Docker-Container-Path-Stat: + type: "string" + description: | + A base64 - encoded JSON object with some filesystem header + information about the path + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + get: + summary: "Get an archive of a filesystem resource in a container" + description: "Get a tar archive of a resource in the filesystem of container id." + operationId: "ContainerArchive" + produces: ["application/x-tar"] + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Container or path does not exist" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Resource in the container’s filesystem to archive." + type: "string" + tags: ["Container"] + put: + summary: "Extract an archive of files or folders to a directory in a container" + description: | + Upload a tar archive to be extracted to a path in the filesystem of container id. + `path` parameter is asserted to be a directory. If it exists as a file, 400 error + will be returned with message "not a directory". + operationId: "PutContainerArchive" + consumes: ["application/x-tar", "application/octet-stream"] + responses: + 200: + description: "The content was extracted successfully" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "not a directory" + 403: + description: "Permission denied, the volume or container rootfs is marked as read-only." + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such container or path does not exist inside the container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the container" + type: "string" + - name: "path" + in: "query" + required: true + description: "Path to a directory in the container to extract the archive’s contents into. " + type: "string" + - name: "noOverwriteDirNonDir" + in: "query" + description: | + If `1`, `true`, or `True` then it will be an error if unpacking the + given content would cause an existing directory to be replaced with + a non-directory and vice versa. + type: "string" + - name: "copyUIDGID" + in: "query" + description: | + If `1`, `true`, then it will copy UID/GID maps to the dest file or + dir + type: "string" + - name: "inputStream" + in: "body" + required: true + description: | + The input stream must be a tar archive compressed with one of the + following algorithms: `identity` (no compression), `gzip`, `bzip2`, + or `xz`. + schema: + type: "string" + format: "binary" + tags: ["Container"] + /containers/prune: + post: + summary: "Delete stopped containers" + produces: + - "application/json" + operationId: "ContainerPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune containers created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune containers with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ContainerPruneResponse" + properties: + ContainersDeleted: + description: "Container IDs that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Container"] + /images/json: + get: + summary: "List Images" + description: "Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image." + operationId: "ImageList" + produces: + - "application/json" + responses: + 200: + description: "Summary image data for the images matching the query" + schema: + type: "array" + items: + $ref: "#/definitions/ImageSummary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "all" + in: "query" + description: "Show all images. Only images from a final layer (no children) are shown by default." + type: "boolean" + default: false + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the images list. + + Available filters: + + - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `dangling=true` + - `label=key` or `label="key=value"` of an image label + - `reference`=(`<image-name>[:<tag>]`) + - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) + - `until=<timestamp>` + type: "string" + - name: "shared-size" + in: "query" + description: "Compute and show shared size as a `SharedSize` field on each image." + type: "boolean" + default: false + - name: "digests" + in: "query" + description: "Show digest information as a `RepoDigests` field on each image." + type: "boolean" + default: false + - name: "manifests" + in: "query" + description: "Include `Manifests` in the image summary." + type: "boolean" + default: false + - name: "identity" + in: "query" + description: "Include `Identity` in each manifest summary. Requires `manifests=1`." + type: "boolean" + default: false + tags: ["Image"] + /build: + post: + summary: "Build an image" + description: | + Build an image from a tar archive with a `Dockerfile` in it. + + The `Dockerfile` specifies how the image is built from the tar archive. It is typically in the archive's root, but can be at a different path or have a different name by specifying the `dockerfile` parameter. [See the `Dockerfile` reference for more information](https://docs.docker.com/engine/reference/builder/). + + The Docker daemon performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. After that, each instruction is run one-by-one until the ID of the new image is output. + + The build is canceled if the client drops the connection by quitting or being killed. + operationId: "ImageBuild" + consumes: + - "application/octet-stream" + produces: + - "application/json" + parameters: + - name: "inputStream" + in: "body" + description: "A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz." + schema: + type: "string" + format: "binary" + - name: "dockerfile" + in: "query" + description: "Path within the build context to the `Dockerfile`. This is ignored if `remote` is specified and points to an external `Dockerfile`." + type: "string" + default: "Dockerfile" + - name: "t" + in: "query" + description: "A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default `latest` value is assumed. You can provide several `t` parameters." + type: "string" + - name: "extrahosts" + in: "query" + description: "Extra hosts to add to /etc/hosts" + type: "string" + - name: "remote" + in: "query" + description: "A Git repository URI or HTTP/HTTPS context URI. If the URI points to a single text file, the file’s contents are placed into a file called `Dockerfile` and the image is built from that file. If the URI points to a tarball, the file is downloaded by the daemon and the contents therein used as the context for the build. If the URI points to a tarball and the `dockerfile` parameter is also specified, there must be a file with the corresponding path inside the tarball." + type: "string" + - name: "q" + in: "query" + description: "Suppress verbose build output." + type: "boolean" + default: false + - name: "nocache" + in: "query" + description: "Do not use the cache when building the image." + type: "boolean" + default: false + - name: "cachefrom" + in: "query" + description: "JSON array of images used for build cache resolution." + type: "string" + - name: "pull" + in: "query" + description: "Attempt to pull the image even if an older image exists locally." + type: "string" + - name: "rm" + in: "query" + description: "Remove intermediate containers after a successful build." + type: "boolean" + default: true + - name: "forcerm" + in: "query" + description: "Always remove intermediate containers, even upon failure." + type: "boolean" + default: false + - name: "memory" + in: "query" + description: "Set memory limit for build." + type: "integer" + - name: "memswap" + in: "query" + description: "Total memory (memory + swap). Set as `-1` to disable swap." + type: "integer" + - name: "cpushares" + in: "query" + description: "CPU shares (relative weight)." + type: "integer" + - name: "cpusetcpus" + in: "query" + description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)." + type: "string" + - name: "cpuperiod" + in: "query" + description: "The length of a CPU period in microseconds." + type: "integer" + - name: "cpuquota" + in: "query" + description: "Microseconds of CPU time that the container can get in a CPU period." + type: "integer" + - name: "buildargs" + in: "query" + description: > + JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker + uses the buildargs as the environment context for commands run via the `Dockerfile` RUN + instruction, or for variable expansion in other `Dockerfile` instructions. This is not meant for + passing secret values. + + + For example, the build arg `FOO=bar` would become `{"FOO":"bar"}` in JSON. This would result in the + query parameter `buildargs={"FOO":"bar"}`. Note that `{"FOO":"bar"}` should be URI component encoded. + + + [Read more about the buildargs instruction.](https://docs.docker.com/engine/reference/builder/#arg) + type: "string" + - name: "shmsize" + in: "query" + description: "Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB." + type: "integer" + - name: "squash" + in: "query" + description: "Squash the resulting images layers into a single layer. *(Experimental release only.)*" + type: "boolean" + - name: "labels" + in: "query" + description: "Arbitrary key/value labels to set on the image, as a JSON map of string pairs." + type: "string" + - name: "networkmode" + in: "query" + description: | + Sets the networking mode for the run commands during build. Supported + standard values are: `bridge`, `host`, `none`, and `container:<name|id>`. + Any other value is taken as a custom network's name or ID to which this + container should connect to. + type: "string" + - name: "Content-type" + in: "header" + type: "string" + enum: + - "application/x-tar" + default: "application/x-tar" + - name: "X-Registry-Config" + in: "header" + description: | + This is a base64-encoded JSON object with auth configurations for multiple registries that a build may refer to. + + The key is a registry URL, and the value is an auth configuration object, [as described in the authentication section](#section/Authentication). For example: + + ``` + { + "docker.example.com": { + "username": "janedoe", + "password": "hunter2" + }, + "https://index.docker.io/v1/": { + "username": "mobydock", + "password": "conta1n3rize14" + } + } + ``` + + Only the registry domain name (and port if not the default 443) are required. However, for legacy reasons, the Docker Hub registry must be specified with both a `https://` prefix and a `/v1/` suffix even though Docker will prefer to use the v2 registry API. + type: "string" + - name: "platform" + in: "query" + description: "Platform in the format os[/arch[/variant]]" + type: "string" + default: "" + - name: "target" + in: "query" + description: "Target build stage" + type: "string" + default: "" + - name: "outputs" + in: "query" + description: | + BuildKit output configuration in the format of a stringified JSON array of objects. + Each object must have two top-level properties: `Type` and `Attrs`. + The `Type` property must be set to 'moby'. + The `Attrs` property is a map of attributes for the BuildKit output configuration. + See https://docs.docker.com/build/exporters/oci-docker/ for more information. + + Example: + + ``` + [{"Type":"moby","Attrs":{"type":"image","force-compression":"true","compression":"zstd"}}] + ``` + type: "string" + default: "" + - name: "version" + in: "query" + type: "string" + default: "1" + enum: ["1", "2"] + description: | + Version of the builder backend to use. + + - `1` is the first generation classic (deprecated) builder in the Docker daemon (default) + - `2` is [BuildKit](https://github.com/moby/buildkit) + responses: + 200: + description: "no error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /build/prune: + post: + summary: "Delete builder cache" + produces: + - "application/json" + operationId: "BuildPrune" + parameters: + - name: "reserved-space" + in: "query" + description: "Amount of disk space in bytes to keep for cache" + type: "integer" + format: "int64" + - name: "max-used-space" + in: "query" + description: "Maximum amount of disk space allowed to keep for cache" + type: "integer" + format: "int64" + - name: "min-free-space" + in: "query" + description: "Target amount of free disk space after pruning" + type: "integer" + format: "int64" + - name: "all" + in: "query" + type: "boolean" + description: "Remove all types of build cache" + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the list of build cache objects. + + Available filters: + + - `until=<timestamp>` remove cache older than `<timestamp>`. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon's local time. + - `id=<id>` + - `parent=<id>` + - `type=<string>` + - `description=<string>` + - `inuse` + - `shared` + - `private` + responses: + 200: + description: "No error" + schema: + type: "object" + title: "BuildPruneResponse" + properties: + CachesDeleted: + type: "array" + items: + description: "ID of build cache object" + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /images/create: + post: + summary: "Create an image" + description: "Pull or import an image." + operationId: "ImageCreate" + consumes: + - "text/plain" + - "application/octet-stream" + produces: + - "application/json" + responses: + 200: + description: "no error" + 404: + description: "repository does not exist or no read access" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "fromImage" + in: "query" + description: | + Name of the image to pull. If the name includes a tag or digest, specific behavior applies: + + - If only `fromImage` includes a tag, that tag is used. + - If both `fromImage` and `tag` are provided, `tag` takes precedence. + - If `fromImage` includes a digest, the image is pulled by digest, and `tag` is ignored. + - If neither a tag nor digest is specified, all tags are pulled. + type: "string" + - name: "fromSrc" + in: "query" + description: "Source to import. The value may be a URL from which the image can be retrieved or `-` to read the image from the request body. This parameter may only be used when importing an image." + type: "string" + - name: "repo" + in: "query" + description: "Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image." + type: "string" + - name: "tag" + in: "query" + description: "Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled." + type: "string" + - name: "message" + in: "query" + description: "Set commit message for imported image." + type: "string" + - name: "inputImage" + in: "body" + description: "Image content if the value `-` has been specified in fromSrc query parameter" + schema: + type: "string" + required: false + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "changes" + in: "query" + description: | + Apply `Dockerfile` instructions to the image that is created, + for example: `changes=ENV DEBUG=true`. + Note that `ENV DEBUG=true` should be URI component encoded. + + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` + type: "array" + items: + type: "string" + - name: "platform" + in: "query" + description: | + Platform in the format os[/arch[/variant]]. + + When used in combination with the `fromImage` option, the daemon checks + if the given image is present in the local image cache with the given + OS and Architecture, and otherwise attempts to pull the image. If the + option is not set, the host's native OS and Architecture are used. + If the given image does not exist in the local image cache, the daemon + attempts to pull the image with the host's native OS and Architecture. + If the given image does exists in the local image cache, but its OS or + architecture does not match, a warning is produced. + + When used with the `fromSrc` option to import an image from an archive, + this option sets the platform information for the imported image. If + the option is not set, the host's native OS and Architecture are used + for the imported image. + type: "string" + default: "" + tags: ["Image"] + /images/{name}/json: + get: + summary: "Inspect an image" + description: "Return low-level information about an image." + operationId: "ImageInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/ImageInspect" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "manifests" + in: "query" + description: |- + Include Manifests in the image summary. + + The `manifests` and `platform` options are mutually exclusive, and + an error is produced if both are set. + type: "boolean" + default: false + required: false + - name: "platform" + type: "string" + in: "query" + description: |- + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show inspect. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + The `platform` and `manifests` options are mutually exclusive, and + an error is produced if both are set. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/attestations: + get: + summary: "Get attestation statements for an image" + description: | + Return the in-toto attestation statements attached to the image for the + given platform. The daemon locates the attestation manifest(s) that + reference the matching platform image manifest, reads their statement + layers, and returns the verbatim statement JSON together with layer + metadata. + + If the image has no attestations an empty array is returned. + operationId: "ImageAttestations" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/AttestationStatement" + 400: + description: "Bad parameter (e.g. malformed `platform` value)" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image, or no manifest found for the requested platform" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + 501: + description: | + The daemon's image backend does not support attestations. This + is returned by the legacy (graphdriver) image store, which does + not preserve OCI image indexes. + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: |- + JSON-encoded OCI platform to select the image variant whose + attestations to return. + If omitted, the daemon's default (host) platform is used. + + Only one platform value is currently accepted; passing more than + one returns an error. The parameter is declared as an array so the + wire shape can accept multiple values in the future without an + API version bump. + + Example: `{"os": "linux", "architecture": "amd64"}` + required: false + - name: "type" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: |- + In-toto predicate type URI to filter returned statements. May be + repeated to accept any of several predicate types. If omitted, all + statements are returned. + + Example: `type=https://slsa.dev/provenance/v0.2&type=https://spdx.dev/Document` + required: false + - name: "statement" + type: "boolean" + in: "query" + description: |- + Include the verbatim in-toto statement body in each returned + entry. Defaults to false; when omitted or false, only the + descriptor and predicate type are returned and statement blobs + are not read. + default: false + required: false + tags: ["Image"] + /images/{name}/history: + get: + summary: "Get the history of an image" + description: "Return parent layers of an image." + operationId: "ImageHistory" + produces: ["application/json"] + responses: + 200: + description: "List of image layers" + schema: + type: "array" + items: + $ref: "#/definitions/ImageHistoryResponseItem" + examples: + application/json: + - Id: "3db9c44f45209632d6050b35958829c3a2aa256d81b9a7be45b362ff85c54710" + Created: 1398108230 + CreatedBy: "/bin/sh -c #(nop) ADD file:eb15dbd63394e063b805a3c32ca7bf0266ef64676d5a6fab4801f2e81e2a5148 in /" + Tags: + - "ubuntu:lucid" + - "ubuntu:10.04" + Size: 182964289 + Comment: "" + - Id: "6cfa4d1f33fb861d4d114f43b25abd0ac737509268065cdfd69d544a59c85ab8" + Created: 1398108222 + CreatedBy: "/bin/sh -c #(nop) MAINTAINER Tianon Gravi <admwiggin@gmail.com> - mkimage-debootstrap.sh -i iproute,iputils-ping,ubuntu-minimal -t lucid.tar.xz lucid http://archive.ubuntu.com/ubuntu/" + Tags: [] + Size: 0 + Comment: "" + - Id: "511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158" + Created: 1371157430 + CreatedBy: "" + Tags: + - "scratch12:latest" + - "scratch:latest" + Size: 0 + Comment: "Imported from -" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant. + If omitted, it defaults to any locally available platform, + prioritizing the daemon's host platform. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to show the history for. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/{name}/push: + post: + summary: "Push an image" + description: | + Push an image to a registry. + + If you wish to push an image on to a private registry, that image must + already have a tag which references the registry. For example, + `registry.example.com/myimage:latest`. + + The push is cancelled if the HTTP connection is closed. + operationId: "ImagePush" + consumes: + - "application/octet-stream" + responses: + 200: + description: "No error" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + Name of the image to push. For example, `registry.example.com/myimage`. + The image must be present in the local image store with the same name. + + The name should be provided without tag; if a tag is provided, it + is ignored. For example, `registry.example.com/myimage:latest` is + considered equivalent to `registry.example.com/myimage`. + + Use the `tag` parameter to specify the tag to push. + type: "string" + required: true + - name: "tag" + in: "query" + description: | + Tag of the image to push. For example, `latest`. If no tag is provided, + all tags of the given image that are present in the local image store + are pushed. + type: "string" + - name: "platform" + type: "string" + in: "query" + description: | + JSON-encoded OCI platform to select the platform-variant to push. + If not provided, all available variants will attempt to be pushed. + + If the daemon provides a multi-platform image store, this selects + the platform-variant to push to the registry. If the image is + a single-platform image, or if the multi-platform image does not + provide a variant matching the given platform, an error is returned. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + required: true + tags: ["Image"] + /images/{name}/tag: + post: + summary: "Tag an image" + description: | + Create a tag that refers to a source image. + + This creates an additional reference (tag) to the source image. The tag + can include a different repository name and/or tag. If the repository + or tag already exists, it will be overwritten. + operationId: "ImageTag" + responses: + 201: + description: "No error" + 400: + description: "Bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID to tag." + type: "string" + required: true + - name: "repo" + in: "query" + description: "The repository to tag in. For example, `someuser/someimage`." + type: "string" + - name: "tag" + in: "query" + description: "The name of the new tag." + type: "string" + tags: ["Image"] + /images/{name}: + delete: + summary: "Remove an image" + description: | + Remove an image, along with any untagged parent images that were + referenced by that image. + + Images can't be removed if they have descendant images, are being + used by a running container or are being used by a build. + operationId: "ImageDelete" + produces: ["application/json"] + responses: + 200: + description: "The image was deleted successfully" + schema: + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + examples: + application/json: + - Untagged: "3e2f21a89f" + - Deleted: "3e2f21a89f" + - Deleted: "53b4f83ac9" + 404: + description: "No such image" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Conflict" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "force" + in: "query" + description: "Remove the image even if it is being used by stopped containers or has other tags" + type: "boolean" + default: false + - name: "noprune" + in: "query" + description: "Do not delete untagged parent images" + type: "boolean" + default: false + - name: "platforms" + in: "query" + description: | + Select platform-specific content to delete. + Multiple values are accepted. + Each platform is a OCI platform encoded as a JSON string. + type: "array" + items: + # This should be OCIPlatform + # but $ref is not supported for array in query in Swagger 2.0 + # $ref: "#/definitions/OCIPlatform" + type: "string" + tags: ["Image"] + /images/search: + get: + summary: "Search images" + description: "Search for an image on Docker Hub." + operationId: "ImageSearch" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + type: "object" + title: "ImageSearchResponseItem" + properties: + description: + type: "string" + is_official: + type: "boolean" + is_automated: + description: | + Whether this repository has automated builds enabled. + + <p><br /></p> + + > **Deprecated**: This field is deprecated and will always be "false". + type: "boolean" + example: false + name: + type: "string" + star_count: + type: "integer" + examples: + application/json: + - description: "A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size!" + is_official: true + is_automated: false + name: "alpine" + star_count: 10093 + - description: "Busybox base image." + is_official: true + is_automated: false + name: "Busybox base image." + star_count: 3037 + - description: "The PostgreSQL object-relational database system provides reliability and data integrity." + is_official: true + is_automated: false + name: "postgres" + star_count: 12408 + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "term" + in: "query" + description: "Term to search" + type: "string" + required: true + - name: "limit" + in: "query" + description: "Maximum number of results to return" + type: "integer" + - name: "filters" + in: "query" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: + + - `is-official=(true|false)` + - `stars=<number>` Matches images that has at least 'number' stars. + type: "string" + tags: ["Image"] + /images/prune: + post: + summary: "Delete unused images" + produces: + - "application/json" + operationId: "ImagePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), prune only + unused *and* untagged images. When set to `false` + (or `0`), all unused images are pruned. + - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ImagePruneResponse" + properties: + ImagesDeleted: + description: "Images that were deleted" + type: "array" + items: + $ref: "#/definitions/ImageDeleteResponseItem" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Image"] + /auth: + post: + summary: "Check auth configuration" + description: | + Validate credentials for a registry and, if available, get an identity + token for accessing the registry without password. + operationId: "SystemAuth" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "An identity token was generated successfully." + schema: + $ref: "#/definitions/AuthResponse" + 204: + description: "No error" + 401: + description: "Auth error" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "authConfig" + in: "body" + description: "Authentication to check" + schema: + $ref: "#/definitions/AuthConfig" + tags: ["System"] + /info: + get: + summary: "Get system information" + operationId: "SystemInfo" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/SystemInfo" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /version: + get: + summary: "Get version" + description: "Returns the version of Docker that is running and various information about the system that Docker is running on." + operationId: "SystemVersion" + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/SystemVersion" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /_ping: + get: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPing" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "OK" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: | + Default version of docker image builder + + The default on Linux is version "2" (BuildKit), but the daemon + can be configured to recommend version "1" (classic Builder). + Windows does not yet support BuildKit for native Windows images, + and uses "1" (classic builder) as a default. + + This value is a recommendation as advertised by the daemon, and + it is up to the client to choose which builder to use. + default: "2" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + headers: + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + tags: ["System"] + head: + summary: "Ping" + description: "This is a dummy endpoint you can use to test if the server is accessible." + operationId: "SystemPingHead" + produces: ["text/plain"] + responses: + 200: + description: "no error" + schema: + type: "string" + example: "(empty)" + headers: + Api-Version: + type: "string" + description: "Max API Version the server supports" + Builder-Version: + type: "string" + description: "Default version of docker image builder" + Docker-Experimental: + type: "boolean" + description: "If the server is running with experimental mode enabled" + Swarm: + type: "string" + enum: ["inactive", "pending", "error", "locked", "active/worker", "active/manager"] + description: | + Contains information about Swarm status of the daemon, + and if the daemon is acting as a manager or worker node. + default: "inactive" + Cache-Control: + type: "string" + default: "no-cache, no-store, must-revalidate" + Pragma: + type: "string" + default: "no-cache" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["System"] + /commit: + post: + summary: "Create a new image from a container" + operationId: "ImageCommit" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "containerConfig" + in: "body" + description: "The container configuration" + schema: + $ref: "#/definitions/ContainerConfig" + - name: "container" + in: "query" + description: "The ID or name of the container to commit" + type: "string" + - name: "repo" + in: "query" + description: "Repository name for the created image" + type: "string" + - name: "tag" + in: "query" + description: "Tag name for the create image" + type: "string" + - name: "comment" + in: "query" + description: "Commit message" + type: "string" + - name: "author" + in: "query" + description: "Author of the image (e.g., `John Hannibal Smith <hannibal@a-team.com>`)" + type: "string" + - name: "pause" + in: "query" + description: "Whether to pause the container before committing" + type: "boolean" + default: true + - name: "changes" + in: "query" + description: "`Dockerfile` instructions to apply while committing" + type: "string" + tags: ["Image"] + /events: + get: + summary: "Monitor events" + description: | + Stream real-time events from the server. + + Various objects within Docker report events when something happens to them. + + Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` + + Images report these events: `create`, `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` + + Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` + + Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` + + The Docker daemon reports these events: `reload` + + Services report these events: `create`, `update`, and `remove` + + Nodes report these events: `create`, `update`, and `remove` + + Secrets report these events: `create`, `update`, and `remove` + + Configs report these events: `create`, `update`, and `remove` + + The Builder reports `prune` events + + operationId: "SystemEvents" + produces: + - "application/jsonl" + - "application/x-ndjson" + - "application/json-seq" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/EventMessage" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "since" + in: "query" + description: "Show events created since this timestamp then stream new events." + type: "string" + - name: "until" + in: "query" + description: "Show events created until this timestamp then stop streaming." + type: "string" + - name: "filters" + in: "query" + description: | + A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: + + - `config=<string>` config name or ID + - `container=<string>` container name or ID + - `daemon=<string>` daemon name or ID + - `event=<string>` event type + - `image=<string>` image name or ID + - `label=<string>` image or container label + - `network=<string>` network name or ID + - `node=<string>` node ID + - `plugin`=<string> plugin name or ID + - `scope`=<string> local or swarm + - `secret=<string>` secret name or ID + - `service=<string>` service name or ID + - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` + - `volume=<string>` volume name + type: "string" + tags: ["System"] + /system/df: + get: + summary: "Get data usage information" + operationId: "SystemDataUsage" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "SystemDataUsageResponse" + properties: + ImageUsage: + $ref: "#/definitions/ImagesDiskUsage" + ContainerUsage: + $ref: "#/definitions/ContainersDiskUsage" + VolumeUsage: + $ref: "#/definitions/VolumesDiskUsage" + BuildCacheUsage: + $ref: "#/definitions/BuildCacheDiskUsage" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "type" + in: "query" + description: | + Object types, for which to compute and return data. + type: "array" + collectionFormat: multi + items: + type: "string" + enum: ["container", "image", "volume", "build-cache"] + - name: "verbose" + in: "query" + description: | + Show detailed information on space usage. + type: "boolean" + default: false + tags: ["System"] + /images/{name}/get: + get: + summary: "Export an image" + description: | + Get a tarball containing all images and metadata for a repository. + + If `name` is a specific name and tag (e.g. `ubuntu:latest`), then only that image (and its parents) are returned. If `name` is an image ID, similarly only that image (and its parents) are returned, but with the exclusion of the `repositories` file in the tarball, as there were no image names referenced. + + ### Image tarball format + + An image tarball contains [Content as defined in the OCI Image Layout Specification](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-layout.md#content). + + Additionally, includes the manifest.json file associated with a backwards compatible docker save format. + + If the tarball defines a repository, the tarball should also include a `repositories` file at the root that contains a list of repository and tag names mapped to layer IDs. + + ```json + { + "hello-world": { + "latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1" + } + } + ``` + operationId: "ImageGet" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or ID" + type: "string" + required: true + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform describing a platform which will be used + to select a platform-specific image to be saved if the image is + multi-platform. + If not provided, the full multi-platform image will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/get: + get: + summary: "Export several images" + description: | + Get a tarball containing all images and metadata for several image + repositories. + + For each value of the `names` parameter: if it is a specific name and + tag (e.g. `ubuntu:latest`), then only that image (and its parents) are + returned; if it is an image ID, similarly only that image (and its parents) + are returned and there would be no names referenced in the 'repositories' + file for this image ID. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageGetAll" + produces: + - "application/x-tar" + responses: + 200: + description: "no error" + schema: + type: "string" + format: "binary" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "names" + in: "query" + description: "Image names to filter by" + type: "array" + items: + type: "string" + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to be saved if the image is + multi-platform. If not provided, the full multi-platform image + will be saved. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /images/load: + post: + summary: "Import images" + description: | + Load a set of images and tags into a repository. + + For details on the format, see the [export image endpoint](#operation/ImageGet). + operationId: "ImageLoad" + consumes: + - "application/x-tar" + produces: + - "application/json" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "imagesTarball" + in: "body" + description: "Tar archive containing images" + schema: + type: "string" + format: "binary" + - name: "quiet" + in: "query" + description: "Suppress progress details during load." + type: "boolean" + default: false + - name: "platform" + type: "array" + items: + type: "string" + collectionFormat: "multi" + in: "query" + description: | + JSON encoded OCI platform(s) which will be used to select the + platform-specific image(s) to load if the image is + multi-platform. If not provided, the full multi-platform image + will be loaded. + + Example: `{"os": "linux", "architecture": "arm", "variant": "v5"}` + tags: ["Image"] + /containers/{id}/exec: + post: + summary: "Create an exec instance" + description: "Run a command inside a running container." + operationId: "ContainerExec" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 404: + description: "no such container" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such container: c2ada9df5af8" + 409: + description: "container is paused" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execConfig" + in: "body" + description: "Exec configuration" + schema: + type: "object" + title: "ExecConfig" + properties: + AttachStdin: + type: "boolean" + description: "Attach to `stdin` of the exec command." + AttachStdout: + type: "boolean" + description: "Attach to `stdout` of the exec command." + AttachStderr: + type: "boolean" + description: "Attach to `stderr` of the exec command." + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + DetachKeys: + type: "string" + description: | + Override the key sequence for detaching a container. Format is + a single character `[a-Z]` or `ctrl-<value>` where `<value>` + is one of: `a-z`, `@`, `^`, `[`, `,` or `_`. + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + Env: + description: | + A list of environment variables in the form `["VAR=value", ...]`. + type: "array" + items: + type: "string" + Cmd: + type: "array" + description: "Command to run, as a string or array of strings." + items: + type: "string" + Privileged: + type: "boolean" + description: "Runs the exec process with extended privileges." + default: false + User: + type: "string" + description: | + The user, and optionally, group to run the exec process inside + the container. Format is one of: `user`, `user:group`, `uid`, + or `uid:gid`. + WorkingDir: + type: "string" + description: | + The working directory for the exec process inside the container. + example: + AttachStdin: false + AttachStdout: true + AttachStderr: true + DetachKeys: "ctrl-p,ctrl-q" + Tty: false + Cmd: + - "date" + Env: + - "FOO=bar" + - "BAZ=quux" + required: true + - name: "id" + in: "path" + description: "ID or name of container" + type: "string" + required: true + tags: ["Exec"] + /exec/{id}/start: + post: + summary: "Start an exec instance" + description: | + Starts a previously set up exec instance. If detach is true, this endpoint + returns immediately after starting the command. Otherwise, it sets up an + interactive session with the command. + operationId: "ExecStart" + consumes: + - "application/json" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "No error" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Container is stopped or paused" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "execStartConfig" + in: "body" + schema: + type: "object" + title: "ExecStartConfig" + properties: + Detach: + type: "boolean" + description: "Detach from the command." + example: false + Tty: + type: "boolean" + description: "Allocate a pseudo-TTY." + example: true + ConsoleSize: + type: "array" + description: "Initial console size, as an `[height, width]` array." + x-nullable: true + minItems: 2 + maxItems: 2 + items: + type: "integer" + minimum: 0 + example: [80, 64] + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + /exec/{id}/resize: + post: + summary: "Resize an exec instance" + description: | + Resize the TTY session used by an exec instance. This endpoint only works + if `tty` was specified as part of creating and starting the exec instance. + operationId: "ExecResize" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + - name: "h" + in: "query" + required: true + description: "Height of the TTY session in characters" + type: "integer" + - name: "w" + in: "query" + required: true + description: "Width of the TTY session in characters" + type: "integer" + tags: ["Exec"] + /exec/{id}/json: + get: + summary: "Inspect an exec instance" + description: "Return low-level information about an exec instance." + operationId: "ExecInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "ExecInspectResponse" + properties: + CanRemove: + type: "boolean" + DetachKeys: + type: "string" + ID: + type: "string" + Running: + type: "boolean" + ExitCode: + type: "integer" + ProcessConfig: + $ref: "#/definitions/ProcessConfig" + OpenStdin: + type: "boolean" + OpenStderr: + type: "boolean" + OpenStdout: + type: "boolean" + ContainerID: + type: "string" + Pid: + type: "integer" + description: "The system process ID for the exec process." + examples: + application/json: + CanRemove: false + ContainerID: "b53ee82b53a40c7dca428523e34f741f3abc51d9f297a14ff874bf761b995126" + DetachKeys: "" + ExitCode: 2 + ID: "f33bbfb39f5b142420f4759b2348913bd4a8d1a6d7fd56499cb41a1bb91d7b3b" + OpenStderr: true + OpenStdin: true + OpenStdout: true + ProcessConfig: + arguments: + - "-c" + - "exit 2" + entrypoint: "sh" + privileged: false + tty: true + user: "1000" + Running: false + Pid: 42000 + 404: + description: "No such exec instance" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Exec instance ID" + required: true + type: "string" + tags: ["Exec"] + + /volumes: + get: + summary: "List volumes" + operationId: "VolumeList" + produces: ["application/json"] + responses: + 200: + description: "Summary volume data that matches the query" + schema: + $ref: "#/definitions/VolumeListResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to + process on the volumes list. Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + volumes that are not in use by a container. When set to `false` + (or `0`), only volumes that are in use by one or more + containers are returned. + - `driver=<volume-driver-name>` Matches volumes based on their driver. + - `label=<key>` or `label=<key>:<value>` Matches volumes based on + the presence of a `label` alone or a `label` and a value. + - `name=<volume-name>` Matches all or part of a volume name. + type: "string" + format: "json" + tags: ["Volume"] + + /volumes/create: + post: + summary: "Create a volume" + operationId: "VolumeCreate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 201: + description: "The volume was created successfully" + schema: + $ref: "#/definitions/Volume" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "volumeConfig" + in: "body" + required: true + description: "Volume configuration" + schema: + $ref: "#/definitions/VolumeCreateRequest" + tags: ["Volume"] + + /volumes/{name}: + get: + summary: "Inspect a volume" + operationId: "VolumeInspect" + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/Volume" + 404: + description: "No such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + tags: ["Volume"] + + put: + summary: | + "Update a volume. Valid only for Swarm cluster volumes" + operationId: "VolumeUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such volume" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "The name or ID of the volume" + type: "string" + required: true + - name: "body" + in: "body" + schema: + # though the schema for is an object that contains only a + # ClusterVolumeSpec, wrapping the ClusterVolumeSpec in this object + # means that if, later on, we support things like changing the + # labels, we can do so without duplicating that information to the + # ClusterVolumeSpec. + type: "object" + description: "Volume configuration" + properties: + Spec: + $ref: "#/definitions/ClusterVolumeSpec" + description: | + The spec of the volume to update. Currently, only Availability may + change. All other fields must remain unchanged. + - name: "version" + in: "query" + description: | + The version number of the volume being updated. This is required to + avoid conflicting writes. Found in the volume's `ClusterVolume` + field. + type: "integer" + format: "int64" + required: true + tags: ["Volume"] + + delete: + summary: "Remove a volume" + description: "Instruct the driver to remove the volume." + operationId: "VolumeDelete" + responses: + 204: + description: "The volume was removed" + 404: + description: "No such volume or volume driver" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "Volume is in use and cannot be removed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + required: true + description: "Volume name or ID" + type: "string" + - name: "force" + in: "query" + description: "Force the removal of the volume" + type: "boolean" + default: false + tags: ["Volume"] + + /volumes/prune: + post: + summary: "Delete unused volumes" + produces: + - "application/json" + operationId: "VolumePrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune volumes with (or without, in case `label!=...` is used) the specified labels. + - `all` (`all=true`) - Consider all (local) volumes for pruning and not just anonymous volumes. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "VolumePruneResponse" + properties: + VolumesDeleted: + description: "Volumes that were deleted" + type: "array" + items: + type: "string" + SpaceReclaimed: + description: "Disk space reclaimed in bytes" + type: "integer" + format: "int64" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Volume"] + /networks: + get: + summary: "List networks" + description: | + Returns a list of networks. For details on the format, see the + [network inspect endpoint](#operation/NetworkInspect). + + Note that it uses a different, smaller representation of a network than + inspecting a single network. For example, the list of containers attached + to the network is not propagated in API versions 1.28 and up. + operationId: "NetworkList" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/NetworkSummary" + examples: + application/json: + - Name: "bridge" + Id: "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566" + Created: "2016-10-19T06:21:00.416543526Z" + Scope: "local" + Driver: "bridge" + EnableIPv4: true + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: + - + Subnet: "172.17.0.0/16" + Options: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + - Name: "none" + Id: "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "null" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + - Name: "host" + Id: "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e" + Created: "0001-01-01T00:00:00Z" + Scope: "local" + Driver: "host" + EnableIPv4: false + EnableIPv6: false + Internal: false + Attachable: false + Ingress: false + IPAM: + Driver: "default" + Config: [] + Containers: {} + Options: {} + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + JSON encoded value of the filters (a `map[string][]string`) to process + on the networks list. + + Available filters: + + - `dangling=<boolean>` When set to `true` (or `1`), returns all + networks that are not in use by a container. When set to `false` + (or `0`), only networks that are in use by one or more + containers are returned. + - `driver=<driver-name>` Matches a network's driver. + - `id=<network-id>` Matches all or part of a network ID. + - `label=<key>` or `label=<key>=<value>` of a network label. + - `name=<network-name>` Matches all or part of a network name. + - `scope=["swarm"|"global"|"local"]` Filters networks by scope (`swarm`, `global`, or `local`). + - `type=["custom"|"builtin"]` Filters networks by type. The `custom` keyword returns all user-defined networks. + type: "string" + tags: ["Network"] + + /networks/{id}: + get: + summary: "Inspect a network" + operationId: "NetworkInspect" + produces: + - "application/json" + responses: + 200: + description: "No error" + schema: + $ref: "#/definitions/NetworkInspect" + 404: + description: "Network not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "verbose" + in: "query" + description: "Detailed inspect output for troubleshooting" + type: "boolean" + default: false + - name: "scope" + in: "query" + description: "Filter the network by scope (swarm, global, or local)" + type: "string" + tags: ["Network"] + + delete: + summary: "Remove a network" + operationId: "NetworkDelete" + responses: + 204: + description: "No error" + 403: + description: "operation not supported for pre-defined networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such network" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + tags: ["Network"] + + /networks/create: + post: + summary: "Create a network" + operationId: "NetworkCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "Network created successfully" + schema: + $ref: "#/definitions/NetworkCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: | + Forbidden operation. This happens when trying to create a network named after a pre-defined network, + or when trying to create an overlay network on a daemon which is not part of a Swarm cluster. + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "plugin not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "networkConfig" + in: "body" + description: "Network configuration" + required: true + schema: + type: "object" + title: "NetworkCreateRequest" + required: ["Name"] + properties: + Name: + description: "The network's name." + type: "string" + example: "my_network" + Driver: + description: "Name of the network driver plugin to use." + type: "string" + default: "bridge" + example: "bridge" + Scope: + description: | + The level at which the network exists (e.g. `swarm` for cluster-wide + or `local` for machine level). + type: "string" + Internal: + description: "Restrict external access to the network." + type: "boolean" + Attachable: + description: | + Globally scoped network is manually attachable by regular + containers from workers in swarm mode. + type: "boolean" + example: true + Ingress: + description: | + Ingress network is the network which provides the routing-mesh + in swarm mode. + type: "boolean" + example: false + ConfigOnly: + description: | + Creates a config-only network. Config-only networks are placeholder + networks for network configurations to be used by other networks. + Config-only networks cannot be used directly to run containers + or services. + type: "boolean" + default: false + example: false + ConfigFrom: + description: | + Specifies the source which will provide the configuration for + this network. The specified network must be an existing + config-only network; see ConfigOnly. + $ref: "#/definitions/ConfigReference" + IPAM: + description: "Optional custom IP scheme for the network." + $ref: "#/definitions/IPAM" + EnableIPv4: + description: "Enable IPv4 on the network." + type: "boolean" + example: true + EnableIPv6: + description: "Enable IPv6 on the network." + type: "boolean" + example: true + Options: + description: "Network specific options to be used by the drivers." + type: "object" + additionalProperties: + type: "string" + example: + com.docker.network.bridge.default_bridge: "true" + com.docker.network.bridge.enable_icc: "true" + com.docker.network.bridge.enable_ip_masquerade: "true" + com.docker.network.bridge.host_binding_ipv4: "0.0.0.0" + com.docker.network.bridge.name: "docker0" + com.docker.network.driver.mtu: "1500" + Labels: + description: "User-defined key/value metadata." + type: "object" + additionalProperties: + type: "string" + example: + com.example.some-label: "some-value" + com.example.some-other-label: "some-other-value" + tags: ["Network"] + + /networks/{id}/connect: + post: + summary: "Connect a container to a network" + description: "The network must be either a local-scoped network or a swarm-scoped network with the `attachable` option set. A network cannot be re-attached to a running container" + operationId: "NetworkConnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "Operation forbidden" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkConnectRequest" + tags: ["Network"] + + /networks/{id}/disconnect: + post: + summary: "Disconnect a container from a network" + operationId: "NetworkDisconnect" + consumes: + - "application/json" + responses: + 200: + description: "No error" + 403: + description: "Operation not supported for swarm scoped networks" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "Network or container not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "Network ID or name" + required: true + type: "string" + - name: "container" + in: "body" + required: true + schema: + $ref: "#/definitions/NetworkDisconnectRequest" + tags: ["Network"] + /networks/prune: + post: + summary: "Delete unused networks" + produces: + - "application/json" + operationId: "NetworkPrune" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the prune list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `until=<timestamp>` Prune networks created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. + - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels. + type: "string" + responses: + 200: + description: "No error" + schema: + type: "object" + title: "NetworkPruneResponse" + properties: + NetworksDeleted: + description: "Networks that were deleted" + type: "array" + items: + type: "string" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Network"] + /plugins: + get: + summary: "List plugins" + operationId: "PluginList" + description: "Returns information about installed plugins." + produces: ["application/json"] + responses: + 200: + description: "No error" + schema: + type: "array" + items: + $ref: "#/definitions/Plugin" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the plugin list. + + Available filters: + + - `capability=<capability name>` + - `enable=<true>|<false>` + tags: ["Plugin"] + + /plugins/privileges: + get: + summary: "Get plugin privileges" + operationId: "GetPluginPrivileges" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: + - "Plugin" + + /plugins/pull: + post: + summary: "Install a plugin" + operationId: "PluginPull" + description: | + Pulls and installs a plugin. After the plugin is installed, it can be + enabled using the [`POST /plugins/{name}/enable` endpoint](#operation/PostPluginsEnable). + produces: + - "application/json" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "remote" + in: "query" + description: | + Remote reference for plugin to install. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "name" + in: "query" + description: | + Local name for the pulled plugin. + + The `:latest` tag is optional, and is used as the default if omitted. + required: false + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/{name}/json: + get: + summary: "Inspect a plugin" + operationId: "PluginInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + tags: ["Plugin"] + /plugins/{name}: + delete: + summary: "Remove a plugin" + operationId: "PluginDelete" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Plugin" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Disable the plugin before removing. This may result in issues if the + plugin is in use by a container. + type: "boolean" + default: false + tags: ["Plugin"] + /plugins/{name}/enable: + post: + summary: "Enable a plugin" + operationId: "PluginEnable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "timeout" + in: "query" + description: "Set the HTTP client timeout (in seconds)" + type: "integer" + default: 0 + tags: ["Plugin"] + /plugins/{name}/disable: + post: + summary: "Disable a plugin" + operationId: "PluginDisable" + responses: + 200: + description: "no error" + 404: + description: "plugin is not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "force" + in: "query" + description: | + Force disable a plugin even if still in use. + required: false + type: "boolean" + tags: ["Plugin"] + /plugins/{name}/upgrade: + post: + summary: "Upgrade a plugin" + operationId: "PluginUpgrade" + responses: + 204: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "remote" + in: "query" + description: | + Remote reference to upgrade to. + + The `:latest` tag is optional, and is used as the default if omitted. + required: true + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration to use when pulling a plugin + from a registry. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + $ref: "#/definitions/PluginPrivilege" + example: + - Name: "network" + Description: "" + Value: + - "host" + - Name: "mount" + Description: "" + Value: + - "/data" + - Name: "device" + Description: "" + Value: + - "/dev/cpu_dma_latency" + tags: ["Plugin"] + /plugins/create: + post: + summary: "Create a plugin" + operationId: "PluginCreate" + consumes: + - "application/x-tar" + responses: + 204: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "query" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "tarContext" + in: "body" + description: "Path to tar containing plugin rootfs and manifest" + schema: + type: "string" + format: "binary" + tags: ["Plugin"] + /plugins/{name}/push: + post: + summary: "Push a plugin" + operationId: "PluginPush" + description: | + Push a plugin to the registry. + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + responses: + 200: + description: "no error" + 404: + description: "plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /plugins/{name}/set: + post: + summary: "Configure a plugin" + operationId: "PluginSet" + consumes: + - "application/json" + parameters: + - name: "name" + in: "path" + description: | + The name of the plugin. The `:latest` tag is optional, and is the + default if omitted. + required: true + type: "string" + - name: "body" + in: "body" + schema: + type: "array" + items: + type: "string" + example: ["DEBUG=1"] + responses: + 204: + description: "No error" + 404: + description: "Plugin not installed" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Plugin"] + /nodes: + get: + summary: "List nodes" + operationId: "NodeList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Node" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + description: | + Filters to process on the nodes list, encoded as JSON (a `map[string][]string`). + + Available filters: + - `id=<node id>` + - `label=<engine label>` + - `membership=`(`accepted`|`pending`)` + - `name=<node name>` + - `node.label=<node label>` + - `role=`(`manager`|`worker`)` + type: "string" + tags: ["Node"] + /nodes/{id}: + get: + summary: "Inspect a node" + operationId: "NodeInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Node" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + tags: ["Node"] + delete: + summary: "Delete a node" + operationId: "NodeDelete" + responses: + 200: + description: "no error" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the node" + type: "string" + required: true + - name: "force" + in: "query" + description: "Force remove a node from the swarm" + default: false + type: "boolean" + tags: ["Node"] + /nodes/{id}/update: + post: + summary: "Update a node" + operationId: "NodeUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such node" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID of the node" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/NodeSpec" + - name: "version" + in: "query" + description: | + The version number of the node object being updated. This is required + to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Node"] + /swarm: + get: + summary: "Inspect swarm" + operationId: "SwarmInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Swarm" + 404: + description: "no such swarm" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/init: + post: + summary: "Initialize a new swarm" + operationId: "SwarmInit" + produces: + - "application/json" + - "text/plain" + responses: + 200: + description: "no error" + schema: + description: "The node ID" + type: "string" + example: "7v2t30z9blmxuhnyo6s4cpenp" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmInitRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication, as well + as determining the networking interface used for the VXLAN + Tunnel Endpoint (VTEP). This can either be an address/port + combination in the form `192.168.1.1:4567`, or an interface + followed by a port number, like `eth0:4567`. If the port number + is omitted, the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + type: "string" + DataPathPort: + description: | + DataPathPort specifies the data path port number for data traffic. + Acceptable port range is 1024 to 49151. + if no port is set or is set to 0, default port 4789 will be used. + type: "integer" + format: "uint32" + DefaultAddrPool: + description: | + Default Address Pool specifies default subnet pools for global + scope networks. + type: "array" + items: + type: "string" + example: ["10.10.0.0/16", "20.20.0.0/16"] + ForceNewCluster: + description: "Force creation of a new swarm." + type: "boolean" + SubnetSize: + description: | + SubnetSize specifies the subnet size of the networks created + from the default subnet pool. + type: "integer" + format: "uint32" + Spec: + $ref: "#/definitions/SwarmSpec" + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathPort: 4789 + DefaultAddrPool: ["10.10.0.0/8", "20.20.0.0/8"] + SubnetSize: 24 + ForceNewCluster: false + Spec: + Orchestration: {} + Raft: {} + Dispatcher: {} + CAConfig: {} + EncryptionConfig: + AutoLockManagers: false + tags: ["Swarm"] + /swarm/join: + post: + summary: "Join an existing swarm" + operationId: "SwarmJoin" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is already part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmJoinRequest" + properties: + ListenAddr: + description: | + Listen address used for inter-manager communication if the node + gets promoted to manager, as well as determining the networking + interface used for the VXLAN Tunnel Endpoint (VTEP). This is + required for joining a swarm. If the port number is omitted, + the default swarm listening port is used. + type: "string" + AdvertiseAddr: + description: | + Externally reachable address advertised to other nodes. This + can either be an address/port combination in the form + `192.168.1.1:4567`, or an interface followed by a port number, + like `eth0:4567`. If the port number is omitted, the port + number from the listen address is used. If `AdvertiseAddr` is + not specified, it will be automatically detected when possible. + type: "string" + DataPathAddr: + description: | + Address or interface to use for data path traffic (format: + `<ip|interface>`), for example, `192.168.1.1`, or an interface, + like `eth0`. If `DataPathAddr` is unspecified, the same address + as `AdvertiseAddr` is used. + + The `DataPathAddr` specifies the address that global scope + network drivers will publish towards other nodes in order to + reach the containers running on this node. Using this parameter + it is possible to separate the container data traffic from the + management traffic of the cluster. + + type: "string" + RemoteAddrs: + description: | + Addresses of manager nodes already participating in the swarm. + type: "array" + items: + type: "string" + JoinToken: + description: "Secret token for joining this swarm." + type: "string" + required: [ListenAddr, RemoteAddrs, JoinToken] + example: + ListenAddr: "0.0.0.0:2377" + AdvertiseAddr: "192.168.1.1:2377" + DataPathAddr: "192.168.1.1" + RemoteAddrs: + - "node1:2377" + JoinToken: "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2" + tags: ["Swarm"] + /swarm/leave: + post: + summary: "Leave a swarm" + operationId: "SwarmLeave" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "force" + description: | + Force leave swarm, even if this is the last manager or that it will + break the cluster. + in: "query" + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/update: + post: + summary: "Update a swarm" + operationId: "SwarmUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + $ref: "#/definitions/SwarmSpec" + - name: "version" + in: "query" + description: | + The version number of the swarm object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + - name: "rotateWorkerToken" + in: "query" + description: "Rotate the worker join token." + type: "boolean" + default: false + - name: "rotateManagerToken" + in: "query" + description: "Rotate the manager join token." + type: "boolean" + default: false + - name: "rotateManagerUnlockKey" + in: "query" + description: "Rotate the manager unlock key." + type: "boolean" + default: false + tags: ["Swarm"] + /swarm/unlockkey: + get: + summary: "Get the unlock key" + operationId: "SwarmUnlockkey" + consumes: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "object" + title: "UnlockKeyResponse" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /swarm/unlock: + post: + summary: "Unlock a locked manager" + operationId: "SwarmUnlock" + consumes: + - "application/json" + produces: + - "application/json" + parameters: + - name: "body" + in: "body" + required: true + schema: + type: "object" + title: "SwarmUnlockRequest" + properties: + UnlockKey: + description: "The swarm's unlock key." + type: "string" + example: + UnlockKey: "SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8" + responses: + 200: + description: "no error" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Swarm"] + /services: + get: + summary: "List services" + operationId: "ServiceList" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Service" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the services list. + + Available filters: + + - `id=<service id>` + - `label=<service label>` + - `mode=["replicated"|"global"]` + - `name=<service name>` + - name: "status" + in: "query" + type: "boolean" + description: | + Include service status, with count of running and desired tasks. + tags: ["Service"] + /services/create: + post: + summary: "Create a service" + operationId: "ServiceCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/ServiceCreateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 403: + description: "network is not eligible for services" + schema: + $ref: "#/definitions/ErrorResponse" + 409: + description: "name conflicts with an existing service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "web" + TaskTemplate: + ContainerSpec: + Image: "nginx:alpine" + Mounts: + - + ReadOnly: true + Source: "web-data" + Target: "/usr/share/nginx/html" + Type: "volume" + VolumeOptions: + DriverConfig: {} + Labels: + com.example.something: "something-value" + Hosts: ["10.10.10.10 host1", "ABCD:EF01:2345:6789:ABCD:EF01:2345:6789 host2"] + User: "33" + DNSConfig: + Nameservers: ["8.8.8.8"] + Search: ["example.org"] + Options: ["timeout:3"] + Secrets: + - + File: + Name: "www.example.org.key" + UID: "33" + GID: "33" + Mode: 384 + SecretID: "fpjqlhnwb19zds35k8wn80lq9" + SecretName: "example_org_domain_key" + OomScoreAdj: 0 + LogDriver: + Name: "json-file" + Options: + max-file: "3" + max-size: "10M" + Placement: {} + Resources: + Limits: + MemoryBytes: 104857600 + Reservations: {} + RestartPolicy: + Condition: "on-failure" + Delay: 10000000000 + MaxAttempts: 10 + Mode: + Replicated: + Replicas: 4 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Ports: + - + Protocol: "tcp" + PublishedPort: 8080 + TargetPort: 80 + Labels: + foo: "bar" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + tags: ["Service"] + /services/{id}: + get: + summary: "Inspect a service" + operationId: "ServiceInspect" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Service" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "insertDefaults" + in: "query" + description: "Fill empty fields with default values." + type: "boolean" + default: false + tags: ["Service"] + delete: + summary: "Delete a service" + operationId: "ServiceDelete" + responses: + 200: + description: "no error" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + tags: ["Service"] + /services/{id}/update: + post: + summary: "Update a service" + operationId: "ServiceUpdate" + consumes: ["application/json"] + produces: ["application/json"] + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/ServiceUpdateResponse" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID or name of service." + required: true + type: "string" + - name: "body" + in: "body" + required: true + schema: + allOf: + - $ref: "#/definitions/ServiceSpec" + - type: "object" + example: + Name: "top" + TaskTemplate: + ContainerSpec: + Image: "busybox" + Args: + - "top" + OomScoreAdj: 0 + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ForceUpdate: 0 + Mode: + Replicated: + Replicas: 1 + UpdateConfig: + Parallelism: 2 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + RollbackConfig: + Parallelism: 1 + Delay: 1000000000 + FailureAction: "pause" + Monitor: 15000000000 + MaxFailureRatio: 0.15 + EndpointSpec: + Mode: "vip" + + - name: "version" + in: "query" + description: | + The version number of the service object being updated. This is + required to avoid conflicting writes. + This version number should be the value as currently set on the + service *before* the update. You can find the current version by + calling `GET /services/{id}` + required: true + type: "integer" + - name: "registryAuthFrom" + in: "query" + description: | + If the `X-Registry-Auth` header is not specified, this parameter + indicates where to find registry authorization credentials. + type: "string" + enum: ["spec", "previous-spec"] + default: "spec" + - name: "rollback" + in: "query" + description: | + Set to this parameter to `previous` to cause a server-side rollback + to the previous service spec. The supplied spec will be ignored in + this case. + type: "string" + - name: "X-Registry-Auth" + in: "header" + description: | + A base64url-encoded auth configuration for pulling from private + registries. + + Refer to the [authentication section](#section/Authentication) for + details. + type: "string" + + tags: ["Service"] + /services/{id}/logs: + get: + summary: "Get service logs" + description: | + Get `stdout` and `stderr` logs from a service. See also + [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + operationId: "ServiceLogs" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such service" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such service: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID or name of the service" + type: "string" + - name: "details" + in: "query" + description: "Show service context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Service"] + /tasks: + get: + summary: "List tasks" + operationId: "TaskList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Task" + example: + - ID: "0kzzo1i0y4jz6027t0k7aezc7" + Version: + Index: 71 + CreatedAt: "2016-06-07T21:07:31.171892745Z" + UpdatedAt: "2016-06-07T21:07:31.376370513Z" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:31.290032978Z" + State: "running" + Message: "started" + ContainerStatus: + ContainerID: "e5d62702a1b48d01c3e02ca1e0212a250801fa8d67caca0b6f35919ebc12f035" + PID: 677 + DesiredState: "running" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.10/16" + - ID: "1yljwbmlr8er2waf8orvqpwms" + Version: + Index: 30 + CreatedAt: "2016-06-07T21:07:30.019104782Z" + UpdatedAt: "2016-06-07T21:07:30.231958098Z" + Name: "hopeful_cori" + Spec: + ContainerSpec: + Image: "redis" + Resources: + Limits: {} + Reservations: {} + RestartPolicy: + Condition: "any" + MaxAttempts: 0 + Placement: {} + ServiceID: "9mnpnzenvg8p8tdbtq4wvbkcz" + Slot: 1 + NodeID: "60gvrl6tm78dmak4yl7srz94v" + Status: + Timestamp: "2016-06-07T21:07:30.202183143Z" + State: "shutdown" + Message: "shutdown" + ContainerStatus: + ContainerID: "1cf8d63d18e79668b0004a4be4c6ee58cddfad2dae29506d8781581d0688a213" + DesiredState: "shutdown" + NetworksAttachments: + - Network: + ID: "4qvuz4ko70xaltuqbt8956gd1" + Version: + Index: 18 + CreatedAt: "2016-06-07T20:31:11.912919752Z" + UpdatedAt: "2016-06-07T21:07:29.955277358Z" + Spec: + Name: "ingress" + Labels: + com.docker.swarm.internal: "true" + DriverConfiguration: {} + IPAMOptions: + Driver: {} + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + DriverState: + Name: "overlay" + Options: + com.docker.network.driver.overlay.vxlanid_list: "256" + IPAMOptions: + Driver: + Name: "default" + Configs: + - Subnet: "10.255.0.0/16" + Gateway: "10.255.0.1" + Addresses: + - "10.255.0.5/16" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the tasks list. + + Available filters: + + - `desired-state=(running | shutdown | accepted)` + - `id=<task id>` + - `label=key` or `label="key=value"` + - `name=<task name>` + - `node=<node id or name>` + - `service=<service name>` + tags: ["Task"] + /tasks/{id}: + get: + summary: "Inspect a task" + operationId: "TaskInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Task" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "ID of the task" + required: true + type: "string" + tags: ["Task"] + /tasks/{id}/logs: + get: + summary: "Get task logs" + description: | + Get `stdout` and `stderr` logs from a task. + See also [`/containers/{id}/logs`](#operation/ContainerLogs). + + **Note**: This endpoint works only for services with the `local`, + `json-file` or `journald` logging drivers. + operationId: "TaskLogs" + produces: + - "application/vnd.docker.raw-stream" + - "application/vnd.docker.multiplexed-stream" + responses: + 200: + description: "logs returned as a stream in response body" + schema: + type: "string" + format: "binary" + 404: + description: "no such task" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such task: c2ada9df5af8" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + description: "ID of the task" + type: "string" + - name: "details" + in: "query" + description: "Show task context and extra details provided to logs." + type: "boolean" + default: false + - name: "follow" + in: "query" + description: "Keep connection after returning logs." + type: "boolean" + default: false + - name: "stdout" + in: "query" + description: "Return logs from `stdout`" + type: "boolean" + default: false + - name: "stderr" + in: "query" + description: "Return logs from `stderr`" + type: "boolean" + default: false + - name: "since" + in: "query" + description: "Only return logs since this time, as a UNIX timestamp" + type: "integer" + default: 0 + - name: "timestamps" + in: "query" + description: "Add timestamps to every log line" + type: "boolean" + default: false + - name: "tail" + in: "query" + description: | + Only return this number of log lines from the end of the logs. + Specify as an integer or `all` to output all log lines. + type: "string" + default: "all" + tags: ["Task"] + /secrets: + get: + summary: "List secrets" + operationId: "SecretList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Secret" + example: + - ID: "blt1owaxmitz71s9v5zh81zun" + Version: + Index: 85 + CreatedAt: "2017-07-20T13:55:28.678958722Z" + UpdatedAt: "2017-07-20T13:55:28.678958722Z" + Spec: + Name: "mysql-passwd" + Labels: + some.label: "some.value" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the secrets list. + + Available filters: + + - `id=<secret id>` + - `label=<key> or label=<key>=value` + - `name=<secret name>` + - `names=<secret name>` + tags: ["Secret"] + /secrets/create: + post: + summary: "Create a secret" + operationId: "SecretCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/SecretSpec" + - type: "object" + example: + Name: "app-key.crt" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + tags: ["Secret"] + /secrets/{id}: + get: + summary: "Inspect a secret" + operationId: "SecretInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Secret" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + Labels: + foo: "bar" + Driver: + Name: "secret-bucket" + Options: + OptionA: "value for driver option A" + OptionB: "value for driver option B" + + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + delete: + summary: "Delete a secret" + operationId: "SecretDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "secret not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the secret" + tags: ["Secret"] + /secrets/{id}/update: + post: + summary: "Update a Secret" + operationId: "SecretUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such secret" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the secret" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/SecretSpec" + description: | + The spec of the secret to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [SecretInspect endpoint](#operation/SecretInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the secret object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Secret"] + /configs: + get: + summary: "List configs" + operationId: "ConfigList" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + type: "array" + items: + $ref: "#/definitions/Config" + example: + - ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "server.conf" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "filters" + in: "query" + type: "string" + description: | + A JSON encoded value of the filters (a `map[string][]string`) to + process on the configs list. + + Available filters: + + - `id=<config id>` + - `label=<key> or label=<key>=value` + - `name=<config name>` + - `names=<config name>` + tags: ["Config"] + /configs/create: + post: + summary: "Create a config" + operationId: "ConfigCreate" + consumes: + - "application/json" + produces: + - "application/json" + responses: + 201: + description: "no error" + schema: + $ref: "#/definitions/IDResponse" + 409: + description: "name conflicts with an existing object" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "body" + in: "body" + schema: + allOf: + - $ref: "#/definitions/ConfigSpec" + - type: "object" + example: + Name: "server.conf" + Labels: + foo: "bar" + Data: "VEhJUyBJUyBOT1QgQSBSRUFMIENFUlRJRklDQVRFCg==" + tags: ["Config"] + /configs/{id}: + get: + summary: "Inspect a config" + operationId: "ConfigInspect" + produces: + - "application/json" + responses: + 200: + description: "no error" + schema: + $ref: "#/definitions/Config" + examples: + application/json: + ID: "ktnbjxoalbkvbvedmg1urrz8h" + Version: + Index: 11 + CreatedAt: "2016-11-05T01:20:17.327670065Z" + UpdatedAt: "2016-11-05T01:20:17.327670065Z" + Spec: + Name: "app-dev.crt" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + delete: + summary: "Delete a config" + operationId: "ConfigDelete" + produces: + - "application/json" + responses: + 204: + description: "no error" + 404: + description: "config not found" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + required: true + type: "string" + description: "ID of the config" + tags: ["Config"] + /configs/{id}/update: + post: + summary: "Update a Config" + operationId: "ConfigUpdate" + responses: + 200: + description: "no error" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 404: + description: "no such config" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + 503: + description: "node is not part of a swarm" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "id" + in: "path" + description: "The ID or name of the config" + type: "string" + required: true + - name: "body" + in: "body" + schema: + $ref: "#/definitions/ConfigSpec" + description: | + The spec of the config to update. Currently, only the Labels field + can be updated. All other fields must remain unchanged from the + [ConfigInspect endpoint](#operation/ConfigInspect) response values. + - name: "version" + in: "query" + description: | + The version number of the config object being updated. This is + required to avoid conflicting writes. + type: "integer" + format: "int64" + required: true + tags: ["Config"] + /distribution/{name}/json: + get: + summary: "Get image information from the registry" + description: | + Return image digest and platform information by contacting the registry. + operationId: "DistributionInspect" + produces: + - "application/json" + responses: + 200: + description: "descriptor and platform information" + schema: + $ref: "#/definitions/DistributionInspect" + 401: + description: "Failed authentication or no image found" + schema: + $ref: "#/definitions/ErrorResponse" + examples: + application/json: + message: "No such image: someimage (tag: latest)" + 500: + description: "Server error" + schema: + $ref: "#/definitions/ErrorResponse" + parameters: + - name: "name" + in: "path" + description: "Image name or id" + type: "string" + required: true + tags: ["Distribution"] + /session: + post: + summary: "Initialize interactive session" + description: | + Start a new interactive session with a server. Session allows server to + call back to the client for advanced capabilities. + + > **Deprecated**: This endpoint is deprecated and will be removed in a future version. + > Server should support gRPC directly on the listening socket. + + ### Hijacking + + This endpoint hijacks the HTTP connection to HTTP2 transport that allows + the client to expose gPRC services on that connection. + + For example, the client sends this request to upgrade the connection: + + ``` + POST /session HTTP/1.1 + Upgrade: h2c + Connection: Upgrade + ``` + + The Docker daemon responds with a `101 UPGRADED` response follow with + the raw stream: + + ``` + HTTP/1.1 101 UPGRADED + Connection: Upgrade + Upgrade: h2c + ``` + operationId: "Session" + produces: + - "application/vnd.docker.raw-stream" + responses: + 101: + description: "no error, hijacking successful" + 400: + description: "bad parameter" + schema: + $ref: "#/definitions/ErrorResponse" + 500: + description: "server error" + schema: + $ref: "#/definitions/ErrorResponse" + tags: ["Session"] diff --git a/_vendor/github.com/moby/moby/api/docs/v1.6.md b/_vendor/github.com/moby/moby/api/docs/v1.6.md new file mode 100644 index 000000000000..dd9c6ded9e4d --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.6.md @@ -0,0 +1,1261 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.6" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.6 + +# 1. Brief introduction + + - The Remote API has replaced rcli + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout, stdin` + and `stderr` + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "base:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "base:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "base:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "base:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "ExposedPorts":{}, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"base", + "Volumes":{}, + "VolumesFrom":"", + "WorkingDir":"" + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Query Parameters: + +   + +- **name** – container name to use + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + + **More Complex Example request, in 2 steps.** **First, use create to + expose a Private Port, which can be bound back to a Public Port a + startup**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Cmd":[ + "/usr/sbin/sshd","-D" + ], + "Image":"image-with-sshd", + "ExposedPorts":{"22/tcp":{}} + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + + **Second, start (using the ID returned above) the image we just + created, mapping the ssh port 22 to something on the host**: + + POST /containers/e90e34656806/start HTTP/1.1 + Content-Type: application/json + + { + "PortBindings": { "22/tcp": [{ "HostPort": "11022" }]} + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain; charset=utf-8 + Content-Length: 0 + + **Now you can ssh into your new container on port 11022.** + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "ExposedPorts": {}, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "base", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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 + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +   + +- **signal** – Signal to send to the container (integer). When no + set, SIGKILL is assumed and the call will waits for the + container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/(format)` + +List images `format` could be json or viz (json default) + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Repository":"base", + "Tag":"ubuntu-12.10", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + }, + { + "Repository":"base", + "Tag":"ubuntu-quantal", + "Id":"b750fe79269d", + "Created":1364102658, + "Size":24653, + "VirtualSize":180116135 + } + ] + +**Example request**: + + GET /images/viz HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + + digraph docker { + "d82cbacda43a" -> "074be284591f" + "1496068ca813" -> "08306dc45919" + "08306dc45919" -> "0e7893146ac2" + "b750fe79269d" -> "1496068ca813" + base -> "27cf78414709" [style=invis] + "f71189fff3de" -> "9a33b36209ed" + "27cf78414709" -> "b750fe79269d" + "0e7893146ac2" -> "d6434d954665" + "d6434d954665" -> "d82cbacda43a" + base -> "e9aa60c60128" [style=invis] + "074be284591f" -> "f71189fff3de" + "b750fe79269d" [label="b750fe79269d\nbase",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "e9aa60c60128" [label="e9aa60c60128\nbase2",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + "9a33b36209ed" [label="9a33b36209ed\ntest",shape=box,fillcolor="paleturquoise",style="filled,rounded"]; + base [style=invisible] + } + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by defaul + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=base HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/base/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "ExposedPorts":{}, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"base", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/base/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} ... + + > The `X-Registry-Auth` header can be used to + > include a base64-encoded AuthConfig object. + +Status Codes: + +- **200** – no error :statuscode 404: no such image :statuscode + 500: server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com) + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Name":"cespare/sshd", + "Description":"" + }, + { + "Name":"johnfuller/sshd", + "Description":"" + }, + { + "Name":"dhrp/mongodb-sshd", + "Description":"" + } + ] + + :query term: term to search + :statuscode 200: no error + :statuscode 500: server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + + {{ STREAM }} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + The archive must include a file called Dockerfile at its root. I + may include any number of other files, which will be accessible in + the build context (See the ADD build command). + + The Content-type header should be set to "application/tar". + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Cmd": ["cat", "/world"], + "ExposedPorts":{"22/tcp":{}} + } + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.7.md b/_vendor/github.com/moby/moby/api/docs/v1.7.md new file mode 100644 index 000000000000..8a7334266786 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.7.md @@ -0,0 +1,1249 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.7" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.7 + +# 1. Brief introduction + + - The Remote API has replaced rcli + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout, stdin` + and `stderr` + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "base:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "base:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "base:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "base:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"base", + "Volumes":{ + "/tmp": {} + }, + "VolumesFrom":"", + "WorkingDir":"", + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +- **config** – the container's configuration + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "base", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {} + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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 + } + + Binds need to reference Volumes that were defined during container + creation. + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +- **hostConfig** – the container's host configuration (optional) + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.7.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=base HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pulling..."} + {"status":"Pulling", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/base/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"base", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/base/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Pushing..."} + {"status":"Pushing", "progress":"1/? (n/a)"} + {"error":"Invalid..."} + ... + + Request Headers: + +   + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {{ STREAM }} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image + + Request Headers: + +   + +- **Content-type** – should be set to + `"application/tar"`. + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **run** – config automatically applied when the image is run. + (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]}) + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + :statuscode 200: no error + :statuscode 500: server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +**Example request** + + POST /images/load + + Tarball in body + + **Example response**: + + .. sourcecode:: http + + HTTP/1.1 200 OK + + :statuscode 200: no error + :statuscode 500: server error + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + +- Create the container + +- If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + +- Start the container + +- If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + +- If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.8.md b/_vendor/github.com/moby/moby/api/docs/v1.8.md new file mode 100644 index 000000000000..62324df8e167 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.8.md @@ -0,0 +1,1325 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.8" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.8 + +# 1. Brief introduction + + - The Remote API has replaced rcli + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout, stdin` + and `stderr` + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "base:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "base:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "base:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "base:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "CpuShares":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"base", + "Volumes":{ + "/tmp": {} + }, + "VolumesFrom":"", + "WorkingDir":"", + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +   + +- **Hostname** – Container host name +- **User** – Username or UID +- **Memory** – Memory Limit in bytes +- **CpuShares** – CPU shares (relative weight) +- **AttachStdin** – 1/True/true or 0/False/false, attach to + standard input. Default false +- **AttachStdout** – 1/True/true or 0/False/false, attach to + standard output. Default false +- **AttachStderr** – 1/True/true or 0/False/false, attach to + standard error. Default false +- **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. + Default false +- **OpenStdin** – 1/True/true or 0/False/false, keep stdin open + even if not attached. Default false + +Query Parameters: + +   + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "base", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": null, + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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 + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **Binds** – Create a bind mount to a directory or file with + [host-path]:[container-path]:[rw|ro]. If a directory + "container-path" is missing, then docker creates a new volume. +- **LxcConf** – Map of custom lxc options +- **PortBindings** – Expose ports from the container, optionally + publishing them via the HostPort flag +- **PublishAllPorts** – 1/True/true or 0/False/false, publish all + exposed ports to the host interfaces. Default false +- **Privileged** – 1/True/true or 0/False/false, give extended + privileges to this container. Default false + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create` + ](docker_remote_api_v1.9.md#create-a-container), + the stream is the raw data from the process PTY and client's stdin. + When the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List Images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=base HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)", "progressDetail":{"current":1}} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/base/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"base", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/base/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + Request Headers: + +   + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name)` + +Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile via stdin + +`POST /build` + +Build an image from Dockerfile via stdin + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#dockerbuilder)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image + + Request Headers: + +   + +- **Content-type** – should be set to + `"application/tar"`. +- **X-Registry-Auth** – base64-encoded AuthConfig objec + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") +- **run** – config automatically applied when the image is run. + (ex: {"Cmd": ["cat", "/world"], "PortSpecs":["22"]}) + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, +or via polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository +specified by `name`. +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run`: + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + - Try to pull it + - Then retry to create the container + + - Start the container + + - If you are not in detached mode: + - Attach to the container, using logs=1 (to have stdout and + stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + - Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS Requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/api/docs/v1.9.md b/_vendor/github.com/moby/moby/api/docs/v1.9.md new file mode 100644 index 000000000000..ae18deb4c6f1 --- /dev/null +++ b/_vendor/github.com/moby/moby/api/docs/v1.9.md @@ -0,0 +1,1358 @@ +<!--[metadata]> ++++ +draft = true +title = "Remote API v1.9" +description = "API Documentation for Docker" +keywords = ["API, Docker, rcli, REST, documentation"] +[menu.main] +parent="smn_remoteapi" ++++ +<![end-metadata]--> + +# Docker Remote API v1.9 + +# 1. Brief introduction + + - The Remote API has replaced rcli + - The daemon listens on `unix:///var/run/docker.sock` but you can bind + Docker to another host/port or a Unix socket. + - The API tends to be REST, but for some complex commands, like `attach` + or `pull`, the HTTP connection is hijacked to transport `stdout, stdin` + and `stderr` + +# 2. Endpoints + +## 2.1 Containers + +### List containers + +`GET /containers/json` + +List containers. + +**Example request**: + + GET /containers/json?all=1&before=8dfafdbc3a40&size=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "8dfafdbc3a40", + "Image": "base:latest", + "Command": "echo 1", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [{"PrivatePort": 2222, "PublicPort": 3333, "Type": "tcp"}], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "9cd87474be90", + "Image": "base:latest", + "Command": "echo 222222", + "Created": 1367854155, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + }, + { + "Id": "3176a2479c92", + "Image": "base:latest", + "Command": "echo 3333333333333333", + "Created": 1367854154, + "Status": "Exit 0", + "Ports":[], + "SizeRw":12288, + "SizeRootFs":0 + }, + { + "Id": "4cb07b47f9fb", + "Image": "base:latest", + "Command": "echo 444444444444444444444444444444444", + "Created": 1367854152, + "Status": "Exit 0", + "Ports": [], + "SizeRw": 12288, + "SizeRootFs": 0 + } + ] + +Query Parameters: + +   + +- **all** – 1/True/true or 0/False/false, Show all containers. + Only running containers are shown by default (i.e., this defaults to false) +- **limit** – Show `limit` last created containers, include non-running ones. +- **since** – Show only containers created since Id, include non-running ones. +- **before** – Show only containers created before Id, include non-running ones. +- **size** – 1/True/true or 0/False/false, Show the containers sizes + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **500** – server error + +### Create a container + +`POST /containers/create` + +Create a container + +**Example request**: + + POST /containers/create HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "CpuShares":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Dns":null, + "Image":"base", + "Volumes":{ + "/tmp": {} + }, + "VolumesFrom":"", + "WorkingDir":"", + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/json + + { + "Id":"e90e34656806" + "Warnings":[] + } + +Json Parameters: + +   + +- **Hostname** – Container host name +- **User** – Username or UID +- **Memory** – Memory Limit in bytes +- **CpuShares** – CPU shares (relative weight) +- **AttachStdin** – 1/True/true or 0/False/false, attach to + standard input. Default false +- **AttachStdout** – 1/True/true or 0/False/false, attach to + standard output. Default false +- **AttachStderr** – 1/True/true or 0/False/false, attach to + standard error. Default false +- **Tty** – 1/True/true or 0/False/false, allocate a pseudo-tty. + Default false +- **OpenStdin** – 1/True/true or 0/False/false, keep stdin open + even if not attached. Default false + +Query Parameters: + +   + +- **name** – Assign the specified name to the container. Mus + match `/?[a-zA-Z0-9_-]+`. + +Status Codes: + +- **201** – no error +- **404** – no such container +- **406** – impossible to attach (container not running) +- **500** – server error + +### Inspect a container + +`GET /containers/(id)/json` + +Return low-level information on the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Id": "4fa6e0f0c6786287e131c3852c58a2e01cc697a68231826813597e4994f1d6e2", + "Created": "2013-05-07T14:51:42.041847+02:00", + "Path": "date", + "Args": [], + "Config": { + "Hostname": "4fa6e0f0c678", + "User": "", + "Memory": 0, + "MemorySwap": 0, + "AttachStdin": false, + "AttachStdout": true, + "AttachStderr": true, + "PortSpecs": null, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "date" + ], + "Dns": null, + "Image": "base", + "Volumes": {}, + "VolumesFrom": "", + "WorkingDir": "" + }, + "State": { + "Running": false, + "Pid": 0, + "ExitCode": 0, + "StartedAt": "2013-05-07T14:51:42.087658+02:01360", + "Ghost": false + }, + "Image": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "NetworkSettings": { + "IpAddress": "", + "IpPrefixLen": 0, + "Gateway": "", + "Bridge": "", + "PortMapping": null + }, + "SysInitPath": "/home/kitty/go/src/github.com/docker/docker/bin/docker", + "ResolvConfPath": "/etc/resolv.conf", + "Volumes": {}, + "HostConfig": { + "Binds": null, + "ContainerIDFile": "", + "LxcConf": [], + "Privileged": false, + "PortBindings": { + "80/tcp": [ + { + "HostIp": "0.0.0.0", + "HostPort": "49153" + } + ] + }, + "Links": null, + "PublishAllPorts": false + } + } + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### List processes running inside a container + +`GET /containers/(id)/top` + +List processes running inside the container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/top HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Titles": [ + "USER", + "PID", + "%CPU", + "%MEM", + "VSZ", + "RSS", + "TTY", + "STAT", + "START", + "TIME", + "COMMAND" + ], + "Processes": [ + ["root","20147","0.0","0.1","18060","1864","pts/4","S","10:06","0:00","bash"], + ["root","20271","0.0","0.0","4312","352","pts/4","S+","10:07","0:00","sleep","10"] + ] + } + +Query Parameters: + +- **ps_args** – ps arguments to use (e.g., aux) + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Inspect changes on a container's filesystem + +`GET /containers/(id)/changes` + +Inspect changes on container `id`'s filesystem + +**Example request**: + + GET /containers/4fa6e0f0c678/changes HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Path": "/dev", + "Kind": 0 + }, + { + "Path": "/dev/kmsg", + "Kind": 1 + }, + { + "Path": "/test", + "Kind": 1 + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Export a container + +`GET /containers/(id)/export` + +Export the contents of container `id` + +**Example request**: + + GET /containers/4fa6e0f0c678/export HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Start a container + +`POST /containers/(id)/start` + +Start the container `id` + +**Example request**: + + 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 + } + +**Example response**: + + HTTP/1.1 204 No Content + Content-Type: text/plain + +Json Parameters: + +   + +- **Binds** – Create a bind mount to a directory or file with + [host-path]:[container-path]:[rw|ro]. If a directory + "container-path" is missing, then docker creates a new volume. +- **LxcConf** – Map of custom lxc options +- **PortBindings** – Expose ports from the container, optionally + publishing them via the HostPort flag +- **PublishAllPorts** – 1/True/true or 0/False/false, publish all + exposed ports to the host interfaces. Default false +- **Privileged** – 1/True/true or 0/False/false, give extended + privileges to this container. Default false + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Stop a container + +`POST /containers/(id)/stop` + +Stop the container `id` + +**Example request**: + + POST /containers/e90e34656806/stop?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 OK + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Restart a container + +`POST /containers/(id)/restart` + +Restart the container `id` + +**Example request**: + + POST /containers/e90e34656806/restart?t=5 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **t** – number of seconds to wait before killing the container + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Kill a container + +`POST /containers/(id)/kill` + +Kill the container `id` + +**Example request**: + + POST /containers/e90e34656806/kill HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters + +- **signal** - Signal to send to the container: integer or string like "SIGINT". + When not set, SIGKILL is assumed and the call will wait for the container to exit. + +Status Codes: + +- **204** – no error +- **404** – no such container +- **500** – server error + +### Attach to a container + +`POST /containers/(id)/attach` + +Attach to the container `id` + +**Example request**: + + POST /containers/16253994b7c4/attach?logs=1&stream=0&stdout=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/vnd.docker.raw-stream + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Defaul + false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + + **Stream details**: + + When using the TTY setting is enabled in + [`POST /containers/create`](#create-a-container), the + stream is the raw data from the process PTY and client's stdin. When + the TTY is disabled, then the stream is multiplexed to separate + stdout and stderr. + + The format is a **Header** and a **Payload** (frame). + + **HEADER** + + The header will contain the information on which stream write the + stream (stdout or stderr). It also contain the size of the + associated frame encoded on the last 4 bytes (uint32). + + It is encoded on the first 8 bytes like this: + + header := [8]byte{STREAM_TYPE, 0, 0, 0, SIZE1, SIZE2, SIZE3, SIZE4} + + `STREAM_TYPE` can be: + +- 0: stdin (will be written on stdout) +- 1: stdout +- 2: stderr + + `SIZE1, SIZE2, SIZE3, SIZE4` are the 4 bytes of + the uint32 size encoded as big endian. + + **PAYLOAD** + + The payload is the raw stream. + + **IMPLEMENTATION** + + The simplest way to implement the Attach protocol is the following: + + 1. Read 8 bytes + 2. chose stdout or stderr depending on the first byte + 3. Extract the frame size from the last 4 bytes + 4. Read the extracted size and output it on the correct output + 5. Goto 1) + +### Attach to a container (websocket) + +`GET /containers/(id)/attach/ws` + +Attach to the container `id` via websocket + +Implements websocket protocol handshake according to [RFC 6455](http://tools.ietf.org/html/rfc6455) + +**Example request** + + GET /containers/e90e34656806/attach/ws?logs=0&stream=1&stdin=1&stdout=1&stderr=1 HTTP/1.1 + +**Example response** + + {{ STREAM }} + +Query Parameters: + +- **logs** – 1/True/true or 0/False/false, return logs. Default false +- **stream** – 1/True/true or 0/False/false, return stream. + Default false +- **stdin** – 1/True/true or 0/False/false, if stream=true, attach + to stdin. Default false +- **stdout** – 1/True/true or 0/False/false, if logs=true, return + stdout log, if stream=true, attach to stdout. Default false +- **stderr** – 1/True/true or 0/False/false, if logs=true, return + stderr log, if stream=true, attach to stderr. Default false + +Status Codes: + +- **200** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Wait a container + +`POST /containers/(id)/wait` + +Block until container `id` stops, then returns the exit code + +**Example request**: + + POST /containers/16253994b7c4/wait HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"StatusCode": 0} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +### Remove a container + +`DELETE /containers/(id)` + +Remove the container `id` from the filesystem + +**Example request**: + + DELETE /containers/16253994b7c4?v=1 HTTP/1.1 + +**Example response**: + + HTTP/1.1 204 No Content + +Query Parameters: + +- **v** – 1/True/true or 0/False/false, Remove the volumes + associated to the container. Default false + +Status Codes: + +- **204** – no error +- **400** – bad parameter +- **404** – no such container +- **500** – server error + +### Copy files or folders from a container + +`POST /containers/(id)/copy` + +Copy files or folders of container `id` + +**Example request**: + + POST /containers/4fa6e0f0c678/copy HTTP/1.1 + Content-Type: application/json + + { + "Resource": "test.txt" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/octet-stream + + {{ TAR STREAM }} + +Status Codes: + +- **200** – no error +- **404** – no such container +- **500** – server error + +## 2.2 Images + +### List images + +`GET /images/json` + +**Example request**: + + GET /images/json?all=0 HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "RepoTags": [ + "ubuntu:12.04", + "ubuntu:precise", + "ubuntu:latest" + ], + "Id": "8dbd9e392a964056420e5d58ca5cc376ef18e2de93b5cc90e868a1bbc8318c1c", + "Created": 1365714795, + "Size": 131506275, + "VirtualSize": 131506275 + }, + { + "RepoTags": [ + "ubuntu:12.10", + "ubuntu:quantal" + ], + "ParentId": "27cf784147099545", + "Id": "b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "Created": 1364102658, + "Size": 24653, + "VirtualSize": 180116135 + } + ] + +### Create an image + +`POST /images/create` + +Create an image, either by pull it from the registry or by importing i + +**Example request**: + + POST /images/create?fromImage=base HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pulling..."} + {"status": "Pulling", "progress": "1 B/ 100 B", "progressDetail": {"current": 1, "total": 100}} + {"error": "Invalid..."} + ... + + When using this endpoint to pull an image from the registry, the + `X-Registry-Auth` header can be used to include + a base64-encoded AuthConfig object. + +Query Parameters: + +- **fromImage** – name of the image to pull +- **fromSrc** – source to import, - means stdin +- **repo** – repository +- **tag** – tag +- **registry** – the registry to pull from + +Request Headers: + +- **X-Registry-Auth** – base64-encoded AuthConfig object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Insert a file in an image + +`POST /images/(name)/insert` + +Insert a file from `url` in the image `name` at `path` + +**Example request**: + + POST /images/test/insert?path=/usr&url=myurl HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status":"Inserting..."} + {"status":"Inserting", "progress":"1/? (n/a)", "progressDetail":{"current":1}} + {"error":"Invalid..."} + ... + +Query Parameters: + +- **url** – The url from where the file is taken +- **path** – The path where the file is stored + +Status Codes: + +- **200** – no error +- **500** – server error + +### Inspect an image + +`GET /images/(name)/json` + +Return low-level information on the image `name` + +**Example request**: + + GET /images/base/json HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "id":"b750fe79269d2ec9a3c593ef05b4332b1d1a02a62b4accb2c21d589ff2f5f2dc", + "parent":"27cf784147099545", + "created":"2013-03-23T22:24:18.818426-07:00", + "container":"3d67245a8d72ecf13f33dffac9f79dcdf70f75acb84d308770391510e0c23ad0", + "container_config": + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":false, + "AttachStderr":false, + "PortSpecs":null, + "Tty":true, + "OpenStdin":true, + "StdinOnce":false, + "Env":null, + "Cmd": ["/bin/bash"], + "Dns":null, + "Image":"base", + "Volumes":null, + "VolumesFrom":"", + "WorkingDir":"" + }, + "Size": 6824592 + } + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Get the history of an image + +`GET /images/(name)/history` + +Return the history of the image `name` + +**Example request**: + + GET /images/base/history HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "b750fe79269d", + "Created": 1364102658, + "CreatedBy": "/bin/bash" + }, + { + "Id": "27cf78414709", + "Created": 1364068391, + "CreatedBy": "" + } + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Push an image on the registry + +`POST /images/(name)/push` + +Push the image `name` on the registry + +**Example request**: + + POST /images/test/push HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "Pushing..."} + {"status": "Pushing", "progress": "1/? (n/a)", "progressDetail": {"current": 1}}} + {"error": "Invalid..."} + ... + + Request Headers: + +   + +- **X-Registry-Auth** – include a base64-encoded AuthConfig + object. + +Status Codes: + +- **200** – no error +- **404** – no such image +- **500** – server error + +### Tag an image into a repository + +`POST /images/(name)/tag` + +Tag the image `name` into a repository + +**Example request**: + + POST /images/test/tag?repo=myrepo&force=0&tag=v42 HTTP/1.1 + +**Example response**: + + HTTP/1.1 201 OK + +Query Parameters: + +- **repo** – The repository to tag in +- **force** – 1/True/true or 0/False/false, default false +- **tag** - The new tag name + +Status Codes: + +- **201** – no error +- **400** – bad parameter +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Remove an image + +`DELETE /images/(name*) +: Remove the image `name` from the filesystem + +**Example request**: + + DELETE /images/test HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-type: application/json + + [ + {"Untagged": "3e2f21a89f"}, + {"Deleted": "3e2f21a89f"}, + {"Deleted": "53b4f83ac9"} + ] + +Status Codes: + +- **200** – no error +- **404** – no such image +- **409** – conflict +- **500** – server error + +### Search images + +`GET /images/search` + +Search for an image on [Docker Hub](https://hub.docker.com). + +> **Note**: +> The response keys have changed from API v1.6 to reflect the JSON +> sent by the registry server to the docker daemon's request. + +**Example request**: + + GET /images/search?term=sshd HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "wma55/u1210sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "jdswinbank/sshd", + "star_count": 0 + }, + { + "description": "", + "is_official": false, + "is_trusted": false, + "name": "vgauthier/sshd", + "star_count": 0 + } + ... + ] + +Query Parameters: + +- **term** – term to search + +Status Codes: + +- **200** – no error +- **500** – server error + +## 2.3 Misc + +### Build an image from Dockerfile + +`POST /build` + +Build an image from Dockerfile using a POST body. + +**Example request**: + + POST /build HTTP/1.1 + + {{ TAR STREAM }} + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"stream": "Step 1..."} + {"stream": "..."} + {"error": "Error...", "errorDetail": {"code": 123, "message": "Error..."}} + + The stream must be a tar archive compressed with one of the + following algorithms: identity (no compression), gzip, bzip2, xz. + + The archive must include a file called `Dockerfile` + at its root. It may include any number of other files, + which will be accessible in the build context (See the [*ADD build + command*](../../reference/builder.md#add)). + +Query Parameters: + +- **t** – repository name (and optionally a tag) to be applied to + the resulting image in case of success +- **remote** – build source URI (git or HTTPS/HTTP) +- **q** – suppress verbose build output +- **nocache** – do not use the cache when building the image +- **rm** – Remove intermediate containers after a successful build + + Request Headers: + +- **Content-type** – should be set to `"application/tar"`. +- **X-Registry-Config** – base64-encoded ConfigFile object + +Status Codes: + +- **200** – no error +- **500** – server error + +### Check auth configuration + +`POST /auth` + +Get the default username and email + +**Example request**: + + POST /auth HTTP/1.1 + Content-Type: application/json + + { + "username":" hannibal", + "password: "xxxx", + "email": "hannibal@a-team.com", + "serveraddress": "https://index.docker.io/v1/" + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: text/plain + +Status Codes: + +- **200** – no error +- **204** – no error +- **500** – server error + +### Display system-wide information + +`GET /info` + +Display system-wide information + +**Example request**: + + GET /info HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Containers":11, + "Images":16, + "Debug":false, + "NFd": 11, + "NGoroutines":21, + "MemoryLimit":true, + "SwapLimit":false, + "IPv4Forwarding":true + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Show the Docker version information + +`GET /version` + +Show the docker version information + +**Example request**: + + GET /version HTTP/1.1 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "Version":"0.2.2", + "GitCommit":"5a2a5cc+CHANGES", + "GoVersion":"go1.0.3" + } + +Status Codes: + +- **200** – no error +- **500** – server error + +### Create a new image from a container's changes + +`POST /commit` + +Create a new image from a container's changes + +**Example request**: + + POST /commit?container=44c004db4b17&m=message&repo=myrepo HTTP/1.1 + Content-Type: application/json + + { + "Hostname":"", + "User":"", + "Memory":0, + "MemorySwap":0, + "AttachStdin":false, + "AttachStdout":true, + "AttachStderr":true, + "PortSpecs":null, + "Tty":false, + "OpenStdin":false, + "StdinOnce":false, + "Env":null, + "Cmd":[ + "date" + ], + "Volumes":{ + "/tmp": {} + }, + "WorkingDir":"", + "DisableNetwork": false, + "ExposedPorts":{ + "22/tcp": {} + } + } + +**Example response**: + + HTTP/1.1 201 Created + Content-Type: application/vnd.docker.raw-stream + + {"Id": "596069db4bf5"} + +Json Parameters: + +- **config** - the container's configuration + +Query Parameters: + +- **container** – source container +- **repo** – repository +- **tag** – tag +- **m** – commit message +- **author** – author (e.g., "John Hannibal Smith + <[hannibal@a-team.com](mailto:hannibal%40a-team.com)>") + +Status Codes: + +- **201** – no error +- **404** – no such container +- **500** – server error + +### Monitor Docker's events + +`GET /events` + +Get events from docker, either in real time via streaming, or via +polling (using since). + +Docker containers will report the following events: + + create, destroy, die, export, kill, pause, restart, start, stop, unpause + +and Docker images will report: + + untag, delete + +**Example request**: + + GET /events?since=1374067924 + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + {"status": "create", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "start", "id": "dfdf82bd3881","from": "base:latest", "time":1374067924} + {"status": "stop", "id": "dfdf82bd3881","from": "base:latest", "time":1374067966} + {"status": "destroy", "id": "dfdf82bd3881","from": "base:latest", "time":1374067970} + +Query Parameters: + +- **since** – timestamp used for polling + +Status Codes: + +- **200** – no error +- **500** – server error + +### Get a tarball containing all images and tags in a repository + +`GET /images/(name)/get` + +Get a tarball containing all images and metadata for the repository specified by `name`. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + GET /images/ubuntu/get + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/x-tar + + Binary data stream + +Status Codes: + +- **200** – no error +- **500** – server error + +### Load a tarball with a set of images and tags into docker + +`POST /images/load` + +Load a set of images and tags into the docker repository. + +See the [image tarball format](#image-tarball-format) for more details. + +**Example request** + + POST /images/load + + Tarball in body + +**Example response**: + + HTTP/1.1 200 OK + +Status Codes: + +- **200** – no error +- **500** – server error + +### Image tarball format + +An image tarball contains one directory per image layer (named using its long ID), +each containing three files: + +1. `VERSION`: currently `1.0` - the file format version +2. `json`: detailed layer information, similar to `docker inspect layer_id` +3. `layer.tar`: A tarfile containing the filesystem changes in this layer + +The `layer.tar` file will contain `aufs` style `.wh..wh.aufs` files and directories +for storing attribute changes and deletions. + +If the tarball defines a repository, there will also be a `repositories` file at +the root that contains a list of repository and tag names mapped to layer IDs. + +``` +{"hello-world": + {"latest": "565a9d68a73f6706862bfe8409a7f659776d4d60a8d096eb4a3cbce6999cc2a1"} +} +``` + +# 3. Going further + +## 3.1 Inside `docker run` + +Here are the steps of `docker run` : + + - Create the container + + - If the status code is 404, it means the image doesn't exist: + +- Try to pull it +- Then retry to create the container + + - Start the container + + - If you are not in detached mode: + +- Attach to the container, using logs=1 (to have stdout and +- stderr from the container's start) and stream=1 + + - If in detached mode or only stdin is attached: + +- Display the container's id + +## 3.2 Hijacking + +In this version of the API, /attach, uses hijacking to transport stdin, +stdout and stderr on the same socket. This might change in the future. + +## 3.3 CORS requests + +To enable cross origin requests to the remote api add the flag +"--api-enable-cors" when running docker in daemon mode. + + $ docker -d -H="192.168.1.9:2375" --api-enable-cors diff --git a/_vendor/github.com/moby/moby/docs/api/version-history.md b/_vendor/github.com/moby/moby/docs/api/version-history.md deleted file mode 100644 index 3184e42d7372..000000000000 --- a/_vendor/github.com/moby/moby/docs/api/version-history.md +++ /dev/null @@ -1,991 +0,0 @@ ---- -title: "Engine API version history" -description: "Documentation of changes that have been made to Engine API." -keywords: "API, Docker, rcli, REST, documentation" ---- - -<!-- This file is maintained within the moby/moby GitHub - repository at https://github.com/moby/moby/. Make all - pull requests against that repo. If you see this file in - another repository, consider it read-only there, as it will - periodically be overwritten by the definitive file. Pull - requests which include edits to this file in other repositories - will be rejected. ---> - -## v1.49 API changes - -[Docker Engine API v1.49](https://docs.docker.com/reference/api/engine/version/v1.49/) documentation - -* `GET /images/{name}/json` now supports a `platform` parameter (JSON - encoded OCI Platform type) allowing to specify a platform of the multi-platform - image to inspect. - This option is mutually exclusive with the `manifests` option. -* `GET /info` now returns a `FirewallBackend` containing information about - the daemon's firewalling configuration. -* Deprecated: The `AllowNondistributableArtifactsCIDRs` and `AllowNondistributableArtifactsHostnames` - fields in the `RegistryConfig` struct in the `GET /info` response are omitted - in API v1.49. -* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and - `InitCommit.Expected` fields in the `GET /info` endpoint were deprecated - in API v1.48, and are now omitted in API v1.49. - -## v1.48 API changes - -[Docker Engine API v1.48](https://docs.docker.com/reference/api/engine/version/v1.48/) documentation - -* Deprecated: The "error" and "progress" fields in streaming responses for - endpoints that return a JSON progress response, such as `POST /images/create`, - `POST /images/{name}/push`, and `POST /build` are deprecated. These fields - were marked deprecated in API v1.4 (docker v0.6.0) and API v1.8 (docker v0.7.1) - respectively, but still returned. These fields will be left empty or will - be omitted in a future API version. Users should use the information in the - `errorDetail` and `progressDetail` fields instead. -* Deprecated: The "allow-nondistributable-artifacts" daemon configuration is - deprecated and enabled by default. The `AllowNondistributableArtifactsCIDRs` - and `AllowNondistributableArtifactsHostnames` fields in the `RegistryConfig` - struct in the `GET /info` response will now always be `null` and will be - omitted in API v1.49. -* Deprecated: The `BridgeNfIptables` and `BridgeNfIp6tables` fields in the - `GET /info` response are now always be `false` and will be omitted in API - v1.49. The netfilter module is now loaded on-demand, and no longer during - daemon startup, making these fields obsolete. -* `GET /images/{name}/history` now supports a `platform` parameter (JSON - encoded OCI Platform type) that allows to specify a platform to show the - history of. -* `POST /images/{name}/load` and `GET /images/{name}/get` now support a - `platform` parameter (JSON encoded OCI Platform type) that allows to specify - a platform to load/save. Not passing this parameter will result in - loading/saving the full multi-platform image. -* `POST /containers/create` now includes a warning in the response when setting - the container-wide `Config.VolumeDriver` option in combination with volumes - defined through `Mounts` because the `VolumeDriver` option has no effect on - those volumes. This warning was previously generated by the CLI, but now - moved to the daemon so that other clients can also get this warning. -* `POST /containers/create` now supports `Mount` of type `image` for mounting - an image inside a container. -* Deprecated: The `ContainerdCommit.Expected`, `RuncCommit.Expected`, and - `InitCommit.Expected` fields in the `GET /info` endpoint are deprecated - and will be omitted in API v1.49. -* `Sysctls` in `HostConfig` (top level `--sysctl` settings) for `eth0` are - no longer migrated to `DriverOpts`, as described in the changes for v1.46. -* `GET /images/json` and `GET /images/{name}/json` responses now include - `Descriptor` field, which contains an OCI descriptor of the image target. - The new field will only be populated if the daemon provides a multi-platform - image store. - WARNING: This is experimental and may change at any time without any backward - compatibility. -* `GET /images/{name}/json` response now will return the `Manifests` field - containing information about the sub-manifests contained in the image index. - This includes things like platform-specific manifests and build attestations. - The new field will only be populated if the request also sets the `manifests` - query parameter to `true`. - This acts the same as in the `GET /images/json` endpoint. - WARNING: This is experimental and may change at any time without any backward compatibility. -* `GET /containers/{name}/json` now returns an `ImageManifestDescriptor` field - containing the OCI descriptor of the platform-specific image manifest of the - image that was used to create the container. - This field is only populated if the daemon provides a multi-platform image - store. -* `POST /networks/create` now has an `EnableIPv4` field. Setting it to `false` - disables IPv4 IPAM for the network. It can only be set to `false` if the - daemon has experimental features enabled. -* `GET /networks/{id}` now returns an `EnableIPv4` field showing whether the - network has IPv4 IPAM enabled. -* `POST /networks/{id}/connect` and `POST /containers/create` now accept a - `GwPriority` field in `EndpointsConfig`. This value is used to determine which - network endpoint provides the default gateway for the container. The endpoint - with the highest priority is selected. If multiple endpoints have the same - priority, endpoints are sorted lexicographically by their network name, and - the one that sorts first is picked. -* `GET /containers/json` now returns a `GwPriority` field in `NetworkSettings` - for each network endpoint. -* API debug endpoints (`GET /debug/vars`, `GET /debug/pprof/`, `GET /debug/pprof/cmdline`, - `GET /debug/pprof/profile`, `GET /debug/pprof/symbol`, `GET /debug/pprof/trace`, - `GET /debug/pprof/{name}`) are now also accessible through the versioned-API - paths (`/v<API-version>/<endpoint>`). -* `POST /build/prune` renames `keep-bytes` to `reserved-space` and now supports - additional prune parameters `max-used-space` and `min-free-space`. -* `GET /containers/json` now returns an `ImageManifestDescriptor` field - matching the same field in `/containers/{name}/json`. - This field is only populated if the daemon provides a multi-platform image - store. - -## v1.47 API changes - -[Docker Engine API v1.47](https://docs.docker.com/reference/api/engine/version/v1.47/) documentation - -* `GET /images/json` response now includes `Manifests` field, which contains - information about the sub-manifests included in the image index. This - includes things like platform-specific manifests and build attestations. - The new field will only be populated if the request also sets the `manifests` - query parameter to `true`. - WARNING: This is experimental and may change at any time without any backward - compatibility. -* `GET /info` no longer includes warnings when `bridge-nf-call-iptables` or - `bridge-nf-call-ip6tables` are disabled when the daemon was started. The - `br_netfilter` module is now attempted to be loaded when needed, making those - warnings inaccurate. This change is not versioned, and affects all API versions - if the daemon has this patch. - -## v1.46 API changes - -[Docker Engine API v1.46](https://docs.docker.com/reference/api/engine/version/v1.46/) documentation - -* `GET /info` now includes a `Containerd` field containing information about - the location of the containerd API socket and containerd namespaces used - by the daemon to run containers and plugins. -* `POST /containers/create` field `NetworkingConfig.EndpointsConfig.DriverOpts`, - and `POST /networks/{id}/connect` field `EndpointsConfig.DriverOpts`, now - support label `com.docker.network.endpoint.sysctls` for setting per-interface - sysctls. The value is a comma separated list of sysctl assignments, the - interface name must be "IFNAME". For example, to set - `net.ipv4.config.eth0.log_martians=1`, use - `net.ipv4.config.IFNAME.log_martians=1`. In API versions up-to 1.46, top level - `--sysctl` settings for `eth0` will be migrated to `DriverOpts` when possible. - This automatic migration will be removed in a future release. -* `GET /containers/json` now returns the annotations of containers. -* `POST /images/{name}/push` now supports a `platform` parameter (JSON encoded - OCI Platform type) that allows selecting a specific platform manifest from - the multi-platform image. -* `POST /containers/create` now takes `Options` as part of `HostConfig.Mounts.TmpfsOptions` to set options for tmpfs mounts. -* `POST /services/create` now takes `Options` as part of `ContainerSpec.Mounts.TmpfsOptions`, to set options for tmpfs mounts. -* `GET /events` now supports image `create` event that is emitted when a new - image is built regardless if it was tagged or not. - -### Deprecated Config fields in `GET /images/{name}/json` response - -The `Config` field returned by this endpoint (used for "image inspect") returns -additional fields that are not part of the image's configuration and not part of -the [Docker Image Spec] and the [OCI Image Spec]. - -These additional fields are included in the response, due to an -implementation detail, where the [api/types.ImageInspec] type used -for the response is using the [container.Config] type. - -The [container.Config] type is a superset of the image config, and while the -image's Config is used as a _template_ for containers created from the image, -the additional fields are set at runtime (from options passed when creating -the container) and not taken from the image Config. - -These fields are never set (and always return the default value for the type), -but are not omitted in the response when left empty. As these fields were not -intended to be part of the image configuration response, they are deprecated, -and will be removed from the API. - -The following fields are currently included in the API response, but -are not part of the underlying image's Config, and deprecated: - -- `Hostname` -- `Domainname` -- `AttachStdin` -- `AttachStdout` -- `AttachStderr` -- `Tty` -- `OpenStdin` -- `StdinOnce` -- `Image` -- `NetworkDisabled` (already omitted unless set) -- `MacAddress` (already omitted unless set) -- `StopTimeout` (already omitted unless set) - -[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32 -[OCI Image Spec]: https://github.com/opencontainers/image-spec/blob/v1.1.0/specs-go/v1/config.go#L24-L62 -[api/types.ImageInspec]: https://github.com/moby/moby/blob/v26.1.4/api/types/types.go#L87-L104 -[container.Config]: https://github.com/moby/moby/blob/v26.1.4/api/types/container/config.go#L47-L82 - -* `POST /services/create` and `POST /services/{id}/update` now support OomScoreAdj - -## v1.45 API changes - -[Docker Engine API v1.45](https://docs.docker.com/reference/api/engine/version/v1.45/) documentation - -* `POST /containers/create` now supports `VolumeOptions.Subpath` which allows a - subpath of a named volume to be mounted. -* `POST /images/search` will always assume a `false` value for the `is-automated` - field. Consequently, searching for `is-automated=true` will yield no results, - while `is-automated=false` will be a no-op. -* `GET /images/{name}/json` no longer includes the `Container` and - `ContainerConfig` fields. To access image configuration, use `Config` field - instead. -* The `Aliases` field returned in calls to `GET /containers/{name:.*}/json` no - longer contains the short container ID, but instead will reflect exactly the - values originally submitted to the `POST /containers/create` endpoint. The - newly introduced `DNSNames` should now be used instead when short container - IDs are needed. - -## v1.44 API changes - -[Docker Engine API v1.44](https://docs.docker.com/reference/api/engine/version/v1.44/) documentation - -* GET `/images/json` now accepts an `until` filter. This accepts a timestamp and - lists all images created before it. The `<timestamp>` can be Unix timestamps, - date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) - computed relative to the daemon machine’s time. This change is not versioned, - and affects all API versions if the daemon has this patch. -* The `VirtualSize` field in the `GET /images/{name}/json`, `GET /images/json`, - and `GET /system/df` responses is now omitted. Use the `Size` field instead, - which contains the same information. -* Deprecated: The `is_automated` field in the `GET /images/search` response has - been deprecated and will always be set to false in the future because Docker - Hub is deprecating the `is_automated` field in its search API. The deprecation - is not versioned, and applies to all API versions. -* Deprecated: The `is-automated` filter for the `GET /images/search` endpoint. - The `is_automated` field has been deprecated by Docker Hub's search API. - Consequently, searching for `is-automated=true` will yield no results. The - deprecation is not versioned, and applies to all API versions. -* Read-only bind mounts are now made recursively read-only on kernel >= 5.12 - with runtimes which support the feature. - `POST /containers/create`, `GET /containers/{id}/json`, and `GET /containers/json` now supports - `BindOptions.ReadOnlyNonRecursive` and `BindOptions.ReadOnlyForceRecursive` to customize the behavior. -* `POST /containers/create` now accepts a `HealthConfig.StartInterval` to set the - interval for health checks during the start period. -* `GET /info` now includes a `CDISpecDirs` field indicating the configured CDI - specifications directories. The use of the applied setting requires the daemon - to have experimental enabled, and for non-experimental daemons an empty list is - always returned. -* `POST /networks/create` now returns a 400 if the `IPAMConfig` has invalid - values. Note that this change is _unversioned_ and applied to all API - versions on daemon that support version 1.44. -* `POST /networks/create` with a duplicated name now fails systematically. As - such, the `CheckDuplicate` field is now deprecated. Note that this change is - _unversioned_ and applied to all API versions on daemon that support version - 1.44. -* `POST /containers/create` now accepts multiple `EndpointSettings` in - `NetworkingConfig.EndpointSettings`. -* `POST /containers/create` and `POST /networks/{id}/connect` will now catch - validation errors that were previously only returned during `POST /containers/{id}/start`. - These endpoints will also return the full set of validation errors they find, - instead of returning only the first one. - Note that this change is _unversioned_ and applies to all API versions. -* `POST /services/create` and `POST /services/{id}/update` now accept `Seccomp` - and `AppArmor` fields in the `ContainerSpec.Privileges` object. This allows - some configuration of Seccomp and AppArmor in Swarm services. -* A new endpoint-specific `MacAddress` field has been added to `NetworkSettings.EndpointSettings` - on `POST /containers/create`, and to `EndpointConfig` on `POST /networks/{id}/connect`. - The container-wide `MacAddress` field in `Config`, on `POST /containers/create`, is now deprecated. -* The field `Networks` in the `POST /services/create` and `POST /services/{id}/update` - requests is now deprecated. You should instead use the field `TaskTemplate.Networks`. -* The `Container` and `ContainerConfig` fields in the `GET /images/{name}/json` - response are deprecated and will no longer be included in API v1.45. -* `GET /info` now includes `status` properties in `Runtimes`. -* A new field named `DNSNames` and containing all non-fully qualified DNS names - a container takes on a specific network has been added to `GET /containers/{name:.*}/json`. -* The `Aliases` field returned in calls to `GET /containers/{name:.*}/json` in v1.44 and older - versions contains the short container ID. This will change in the next API version, v1.45. - Starting with that API version, this specific value will be removed from the `Aliases` field - such that this field will reflect exactly the values originally submitted to the - `POST /containers/create` endpoint. The newly introduced `DNSNames` should now be used instead. -* The fields `HairpinMode`, `LinkLocalIPv6Address`, `LinkLocalIPv6PrefixLen`, `SecondaryIPAddresses`, - `SecondaryIPv6Addresses` available in `NetworkSettings` when calling `GET /containers/{id}/json` are - deprecated and will be removed in a future release. You should instead look for the default network in - `NetworkSettings.Networks`. -* `GET /images/{id}/json` omits the `Created` field (previously it was `0001-01-01T00:00:00Z`) - if the `Created` field is missing from the image config. - -## v1.43 API changes - -[Docker Engine API v1.43](https://docs.docker.com/reference/api/engine/version/v1.43/) documentation - -* `POST /containers/create` now accepts `Annotations` as part of `HostConfig`. - Can be used to attach arbitrary metadata to the container, which will also be - passed to the runtime when the container is started. -* `GET /images/json` no longer includes hardcoded `<none>:<none>` and - `<none>@<none>` in `RepoTags` and`RepoDigests` for untagged images. - In such cases, empty arrays will be produced instead. -* The `VirtualSize` field in the `GET /images/{name}/json`, `GET /images/json`, - and `GET /system/df` responses is deprecated and will no longer be included - in API v1.44. Use the `Size` field instead, which contains the same information. -* `GET /info` now includes `no-new-privileges` in the `SecurityOptions` string - list when this option is enabled globally. This change is not versioned, and - affects all API versions if the daemon has this patch. - -## v1.42 API changes - -[Docker Engine API v1.42](https://docs.docker.com/reference/api/engine/version/v1.42/) documentation - -* Removed the `BuilderSize` field on the `GET /system/df` endpoint. This field - was introduced in API 1.31 as part of an experimental feature, and no longer - used since API 1.40. - Use field `BuildCache` instead to track storage used by the builder component. -* `POST /containers/{id}/stop` and `POST /containers/{id}/restart` now accept a - `signal` query parameter, which allows overriding the container's default stop- - signal. -* `GET /images/json` now accepts query parameter `shared-size`. When set `true`, - images returned will include `SharedSize`, which provides the size on disk shared - with other images present on the system. -* `GET /system/df` now accepts query parameter `type`. When set, - computes and returns data only for the specified object type. - The parameter can be specified multiple times to select several object types. - Supported values are: `container`, `image`, `volume`, `build-cache`. -* `GET /system/df` can now be used concurrently. If a request is made while a - previous request is still being processed, the request will receive the result - of the already running calculation, once completed. Previously, an error - (`a disk usage operation is already running`) would be returned in this - situation. This change is not versioned, and affects all API versions if the - daemon has this patch. -* The `POST /images/create` now supports both the operating system and architecture - that is passed through the `platform` query parameter when using the `fromSrc` - option to import an image from an archive. Previously, only the operating system - was used and the architecture was ignored. If no `platform` option is set, the - host's operating system and architecture as used as default. This change is not - versioned, and affects all API versions if the daemon has this patch. -* The `POST /containers/{id}/wait` endpoint now returns a `400` status code if an - invalid `condition` is provided (on API 1.30 and up). -* Removed the `KernelMemory` field from the `POST /containers/create` and - `POST /containers/{id}/update` endpoints, any value it is set to will be ignored - on API version `v1.42` and up. Older API versions still accept this field, but - may take no effect, depending on the kernel version and OCI runtime in use. -* `GET /containers/{id}/json` now omits the `KernelMemory` and `KernelMemoryTCP` - if they are not set. -* `GET /info` now omits the `KernelMemory` and `KernelMemoryTCP` if they are not - supported by the host or host's configuration (if cgroups v2 are in use). -* `GET /_ping` and `HEAD /_ping` now return `Builder-Version` by default. - This header contains the default builder to use, and is a recommendation as - advertised by the daemon. However, it is up to the client to choose which builder - to use. - - The default value on Linux is version "2" (BuildKit), but the daemon can be - configured to recommend version "1" (classic Builder). Windows does not yet - support BuildKit for native Windows images, and uses "1" (classic builder) as - a default. - - This change is not versioned, and affects all API versions if the daemon has - this patch. -* `GET /_ping` and `HEAD /_ping` now return a `Swarm` header, which allows a - client to detect if Swarm is enabled on the daemon, without having to call - additional endpoints. - This change is not versioned, and affects all API versions if the daemon has - this patch. Clients must consider this header "optional", and fall back to - using other endpoints to get this information if the header is not present. - - The `Swarm` header can contain one of the following values: - - - "inactive" - - "pending" - - "error" - - "locked" - - "active/worker" - - "active/manager" -* `POST /containers/create` for Windows containers now accepts a new syntax in - `HostConfig.Resources.Devices.PathOnHost`. As well as the existing `class/<GUID>` - syntax, `<IDType>://<ID>` is now recognised. Support for specific `<IDType>` values - depends on the underlying implementation and Windows version. This change is not - versioned, and affects all API versions if the daemon has this patch. -* `GET /containers/{id}/attach`, `GET /exec/{id}/start`, `GET /containers/{id}/logs` - `GET /services/{id}/logs` and `GET /tasks/{id}/logs` now set Content-Type header - to `application/vnd.docker.multiplexed-stream` when a multiplexed stdout/stderr - stream is sent to client, `application/vnd.docker.raw-stream` otherwise. -* `POST /volumes/create` now accepts a new `ClusterVolumeSpec` to create a cluster - volume (CNI). This option can only be used if the daemon is a Swarm manager. - The Volume response on creation now also can contain a `ClusterVolume` field - with information about the created volume. -* The `BuildCache.Parent` field, as returned by `GET /system/df` is deprecated - and is now omitted. API versions before v1.42 continue to include this field. -* `GET /system/df` now includes a new `Parents` field, for "build-cache" records, - which contains a list of parent IDs for the build-cache record. -* Volume information returned by `GET /volumes/{name}`, `GET /volumes` and - `GET /system/df` can now contain a `ClusterVolume` if the volume is a cluster - volume (requires the daemon to be a Swarm manager). -* The `Volume` type, as returned by `Added new `ClusterVolume` fields -* Added a new `PUT /volumes{name}` endpoint to update cluster volumes (CNI). - Cluster volumes are only supported if the daemon is a Swarm manager. -* `GET /containers/{name}/attach/ws` endpoint now accepts `stdin`, `stdout` and - `stderr` query parameters to only attach to configured streams. - - NOTE: These parameters were documented before in older API versions, but not - actually supported. API versions before v1.42 continue to ignore these parameters - and default to attaching to all streams. To preserve the pre-v1.42 behavior, - set all three query parameters (`?stdin=1,stdout=1,stderr=1`). -* `POST /containers/create` on Linux now respects the `HostConfig.ConsoleSize` property. - Container is immediately created with the desired terminal size and clients no longer - need to set the desired size on their own. -* `POST /containers/create` allow to set `CreateMountpoint` for host path to be - created if missing. This brings parity with `Binds` -* `POST /containers/create` rejects request if BindOptions|VolumeOptions|TmpfsOptions - is set with a non-matching mount Type. -* `POST /containers/{id}/exec` now accepts an optional `ConsoleSize` parameter. - It allows to set the console size of the executed process immediately when it's created. -* `POST /volumes/prune` will now only prune "anonymous" volumes (volumes which were not given a name) by default. A new filter parameter `all` can be set to a truth-y value (`true`, `1`) to get the old behavior. - -## v1.41 API changes - -[Docker Engine API v1.41](https://docs.docker.com/reference/api/engine/version/v1.41/) documentation - -* `GET /events` now returns `prune` events after pruning resources have completed. - Prune events are returned for `container`, `network`, `volume`, `image`, and - `builder`, and have a `reclaimed` attribute, indicating the amount of space - reclaimed (in bytes). -* `GET /info` now returns a `CgroupVersion` field, containing the cgroup version. -* `GET /info` now returns a `DefaultAddressPools` field, containing a list of - custom default address pools for local networks, which can be specified in the - `daemon.json` file or `--default-address-pool` dockerd option. -* `POST /services/create` and `POST /services/{id}/update` now supports `BindOptions.NonRecursive`. -* The `ClusterStore` and `ClusterAdvertise` fields in `GET /info` are deprecated - and are now omitted if they contain an empty value. This change is not versioned, - and affects all API versions if the daemon has this patch. -* The `filter` (singular) query parameter, which was deprecated in favor of the - `filters` option in Docker 1.13, has now been removed from the `GET /images/json` - endpoint. The parameter remains available when using API version 1.40 or below. -* `GET /services` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `GET /services/{id}` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `POST /services/create` now accepts `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `POST /services/{id}/update` now accepts `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `GET /tasks` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `GET /tasks/{id}` now returns `CapAdd` and `CapDrop` as part of the `ContainerSpec`. -* `GET /services` now returns `Pids` in `TaskTemplate.Resources.Limits`. -* `GET /services/{id}` now returns `Pids` in `TaskTemplate.Resources.Limits`. -* `POST /services/create` now accepts `Pids` in `TaskTemplate.Resources.Limits`. -* `POST /services/{id}/update` now accepts `Pids` in `TaskTemplate.Resources.Limits` - to limit the maximum number of PIDs. -* `GET /tasks` now returns `Pids` in `TaskTemplate.Resources.Limits`. -* `GET /tasks/{id}` now returns `Pids` in `TaskTemplate.Resources.Limits`. -* `POST /containers/create` now accepts a `platform` query parameter in the format - `os[/arch[/variant]]`. - - When set, the daemon checks if the requested image is present in the local image - cache with the given OS and Architecture, and otherwise returns a `404` status. - - If the option is _not_ set, the host's native OS and Architecture are used to - look up the image in the image cache. However, if no platform is passed and the - given image _does_ exist in the local image cache, but its OS or architecture - do not match, the container is created with the available image, and a warning - is added to the `Warnings` field in the response, for example; - - WARNING: The requested image's platform (linux/arm64/v8) does not - match the detected host platform (linux/amd64) and no - specific platform was requested - -* `POST /containers/create` on Linux now accepts the `HostConfig.CgroupnsMode` property. - Set the property to `host` to create the container in the daemon's cgroup namespace, or - `private` to create the container in its own private cgroup namespace. The per-daemon - default is `host`, and can be changed by using the`CgroupNamespaceMode` daemon configuration - parameter. -* `GET /info` now returns an `OSVersion` field, containing the operating system's - version. This change is not versioned, and affects all API versions if the daemon - has this patch. -* `GET /info` no longer returns the `SystemStatus` field if it does not have a - value set. This change is not versioned, and affects all API versions if the - daemon has this patch. -* `GET /services` now accepts query parameter `status`. When set `true`, - services returned will include `ServiceStatus`, which provides Desired, - Running, and Completed task counts for the service. -* `GET /services` may now include `ReplicatedJob` or `GlobalJob` as the `Mode` - in a `ServiceSpec`. -* `GET /services/{id}` may now include `ReplicatedJob` or `GlobalJob` as the - `Mode` in a `ServiceSpec`. -* `POST /services/create` now accepts `ReplicatedJob or `GlobalJob` as the `Mode` - in the `ServiceSpec. -* `POST /services/{id}/update` accepts updating the fields of the - `ReplicatedJob` object in the `ServiceSpec.Mode`. The service mode still - cannot be changed, however. -* `GET /services` now includes `JobStatus` on Services with mode - `ReplicatedJob` or `GlobalJob`. -* `GET /services/{id}` now includes `JobStatus` on Services with mode - `ReplicatedJob` or `GlobalJob`. -* `GET /tasks` now includes `JobIteration` on Tasks spawned from a job-mode - service. -* `GET /tasks/{id}` now includes `JobIteration` on the task if spawned from a - job-mode service. -* `GET /containers/{id}/stats` now accepts a query param (`one-shot`) which, when used with `stream=false` fetches a - single set of stats instead of waiting for two collection cycles to have 2 CPU stats over a 1 second period. -* The `KernelMemory` field in `HostConfig.Resources` is now deprecated. -* The `KernelMemory` field in `Info` is now deprecated. -* `GET /services` now returns `Ulimits` as part of `ContainerSpec`. -* `GET /services/{id}` now returns `Ulimits` as part of `ContainerSpec`. -* `POST /services/create` now accepts `Ulimits` as part of `ContainerSpec`. -* `POST /services/{id}/update` now accepts `Ulimits` as part of `ContainerSpec`. - -## v1.40 API changes - -[Docker Engine API v1.40](https://docs.docker.com/reference/api/engine/version/v1.40/) documentation - -* The `/_ping` endpoint can now be accessed both using `GET` or `HEAD` requests. - when accessed using a `HEAD` request, all headers are returned, but the body - is empty (`Content-Length: 0`). This change is not versioned, and affects all - API versions if the daemon has this patch. Clients are recommended to try - using `HEAD`, but fallback to `GET` if the `HEAD` requests fails. -* `GET /_ping` and `HEAD /_ping` now set `Cache-Control` and `Pragma` headers to - prevent the result from being cached. This change is not versioned, and affects - all API versions if the daemon has this patch. -* `GET /services` now returns `Sysctls` as part of the `ContainerSpec`. -* `GET /services/{id}` now returns `Sysctls` as part of the `ContainerSpec`. -* `POST /services/create` now accepts `Sysctls` as part of the `ContainerSpec`. -* `POST /services/{id}/update` now accepts `Sysctls` as part of the `ContainerSpec`. -* `POST /services/create` now accepts `Config` as part of `ContainerSpec.Privileges.CredentialSpec`. -* `POST /services/{id}/update` now accepts `Config` as part of `ContainerSpec.Privileges.CredentialSpec`. -* `POST /services/create` now includes `Runtime` as an option in `ContainerSpec.Configs` -* `POST /services/{id}/update` now includes `Runtime` as an option in `ContainerSpec.Configs` -* `GET /tasks` now returns `Sysctls` as part of the `ContainerSpec`. -* `GET /tasks/{id}` now returns `Sysctls` as part of the `ContainerSpec`. -* `GET /networks` now supports a `dangling` filter type. When set to `true` (or - `1`), the endpoint returns all networks that are not in use by a container. When - set to `false` (or `0`), only networks that are in use by one or more containers - are returned. -* `GET /nodes` now supports a filter type `node.label` filter to filter nodes based - on the node.label. The format of the label filter is `node.label=<key>`/`node.label=<key>=<value>` - to return those with the specified labels, or `node.label!=<key>`/`node.label!=<key>=<value>` - to return those without the specified labels. -* `POST /containers/create` now accepts a `fluentd-async` option in `HostConfig.LogConfig.Config` - when using the Fluentd logging driver. This option deprecates the `fluentd-async-connect` - option, which remains functional, but will be removed in a future release. Users - are encouraged to use the `fluentd-async` option going forward. This change is - not versioned, and affects all API versions if the daemon has this patch. -* `POST /containers/create` now accepts a `fluentd-request-ack` option in - `HostConfig.LogConfig.Config` when using the Fluentd logging driver. If enabled, - the Fluentd logging driver sends the chunk option with a unique ID. The server - will respond with an acknowledgement. This option improves the reliability of - the message transmission. This change is not versioned, and affects all API - versions if the daemon has this patch. -* `POST /containers/create`, `GET /containers/{id}/json`, and `GET /containers/json` now supports - `BindOptions.NonRecursive`. -* `POST /swarm/init` now accepts a `DataPathPort` property to set data path port number. -* `GET /info` now returns information about `DataPathPort` that is currently used in swarm -* `GET /info` now returns `PidsLimit` boolean to indicate if the host kernel has - PID limit support enabled. -* `GET /info` now includes `name=rootless` in `SecurityOptions` when the daemon is running in - rootless mode. This change is not versioned, and affects all API versions if the daemon has - this patch. -* `GET /info` now returns `none` as `CgroupDriver` when the daemon is running in rootless mode. - This change is not versioned, and affects all API versions if the daemon has this patch. -* `POST /containers/create` now accepts `DeviceRequests` as part of `HostConfig`. - Can be used to set Nvidia GPUs. -* `GET /swarm` endpoint now returns DataPathPort info -* `POST /containers/create` now takes `KernelMemoryTCP` field to set hard limit for kernel TCP buffer memory. -* `GET /service` now returns `MaxReplicas` as part of the `Placement`. -* `GET /service/{id}` now returns `MaxReplicas` as part of the `Placement`. -* `POST /service/create` and `POST /services/(id or name)/update` now take the field `MaxReplicas` - as part of the service `Placement`, allowing to specify maximum replicas per node for the service. -* `POST /containers/create` on Linux now creates a container with `HostConfig.IpcMode=private` - by default, if IpcMode is not explicitly specified. The per-daemon default can be changed - back to `shareable` by using `DefaultIpcMode` daemon configuration parameter. -* `POST /containers/{id}/update` now accepts a `PidsLimit` field to tune a container's - PID limit. Set `0` or `-1` for unlimited. Leave `null` to not change the current value. -* `POST /build` now accepts `outputs` key for configuring build outputs when using BuildKit mode. - -## V1.39 API changes - -[Docker Engine API v1.39](https://docs.docker.com/reference/api/engine/version/v1.39/) documentation - -* `GET /info` now returns an empty string, instead of `<unknown>` for `KernelVersion` - and `OperatingSystem` if the daemon was unable to obtain this information. -* `GET /info` now returns information about the product license, if a license - has been applied to the daemon. -* `GET /info` now returns a `Warnings` field, containing warnings and informational - messages about missing features, or issues related to the daemon configuration. -* `POST /swarm/init` now accepts a `DefaultAddrPool` property to set global scope default address pool -* `POST /swarm/init` now accepts a `SubnetSize` property to set global scope networks by giving the - length of the subnet masks for every such network -* `POST /session` (added in [V1.31](#v131-api-changes) is no longer experimental. - This endpoint can be used to run interactive long-running protocols between the - client and the daemon. - -## V1.38 API changes - -[Docker Engine API v1.38](https://docs.docker.com/reference/api/engine/version/v1.38/) documentation - - -* `GET /tasks` and `GET /tasks/{id}` now return a `NetworkAttachmentSpec` field, - containing the `ContainerID` for non-service containers connected to "attachable" - swarm-scoped networks. - -## v1.37 API changes - -[Docker Engine API v1.37](https://docs.docker.com/reference/api/engine/version/v1.37/) documentation - -* `POST /containers/create` and `POST /services/create` now supports exposing SCTP ports. -* `POST /configs/create` and `POST /configs/{id}/create` now accept a `Templating` driver. -* `GET /configs` and `GET /configs/{id}` now return the `Templating` driver of the config. -* `POST /secrets/create` and `POST /secrets/{id}/create` now accept a `Templating` driver. -* `GET /secrets` and `GET /secrets/{id}` now return the `Templating` driver of the secret. - -## v1.36 API changes - -[Docker Engine API v1.36](https://docs.docker.com/reference/api/engine/version/v1.36/) documentation - -* `Get /events` now return `exec_die` event when an exec process terminates. - - -## v1.35 API changes - -[Docker Engine API v1.35](https://docs.docker.com/reference/api/engine/version/v1.35/) documentation - -* `POST /services/create` and `POST /services/(id)/update` now accepts an - `Isolation` field on container spec to set the Isolation technology of the - containers running the service (`default`, `process`, or `hyperv`). This - configuration is only used for Windows containers. -* `GET /containers/(name)/logs` now supports an additional query parameter: `until`, - which returns log lines that occurred before the specified timestamp. -* `POST /containers/{id}/exec` now accepts a `WorkingDir` property to set the - work-dir for the exec process, independent of the container's work-dir. -* `Get /version` now returns a `Platform.Name` field, which can be used by products - using Moby as a foundation to return information about the platform. -* `Get /version` now returns a `Components` field, which can be used to return - information about the components used. Information about the engine itself is - now included as a "Component" version, and contains all information from the - top-level `Version`, `GitCommit`, `APIVersion`, `MinAPIVersion`, `GoVersion`, - `Os`, `Arch`, `BuildTime`, `KernelVersion`, and `Experimental` fields. Going - forward, the information from the `Components` section is preferred over their - top-level counterparts. - - -## v1.34 API changes - -[Docker Engine API v1.34](https://docs.docker.com/reference/api/engine/version/v1.34/) documentation - -* `POST /containers/(name)/wait?condition=removed` now also also returns - in case of container removal failure. A pointer to a structure named - `Error` added to the response JSON in order to indicate a failure. - If `Error` is `null`, container removal has succeeded, otherwise - the test of an error message indicating why container removal has failed - is available from `Error.Message` field. - -## v1.33 API changes - -[Docker Engine API v1.33](https://docs.docker.com/reference/api/engine/version/v1.33/) documentation - -* `GET /events` now supports filtering 4 more kinds of events: `config`, `node`, -`secret` and `service`. - -## v1.32 API changes - -[Docker Engine API v1.32](https://docs.docker.com/reference/api/engine/version/v1.32/) documentation - -* `POST /images/create` now accepts a `platform` parameter in the form of `os[/arch[/variant]]`. -* `POST /containers/create` now accepts additional values for the - `HostConfig.IpcMode` property. New values are `private`, `shareable`, - and `none`. -* `DELETE /networks/{id or name}` fixed issue where a `name` equal to another - network's name was able to mask that `id`. If both a network with the given - _name_ exists, and a network with the given _id_, the network with the given - _id_ is now deleted. This change is not versioned, and affects all API versions - if the daemon has this patch. - -## v1.31 API changes - -[Docker Engine API v1.31](https://docs.docker.com/reference/api/engine/version/v1.31/) documentation - -* `DELETE /secrets/(name)` now returns status code 404 instead of 500 when the secret does not exist. -* `POST /secrets/create` now returns status code 409 instead of 500 when creating an already existing secret. -* `POST /secrets/create` now accepts a `Driver` struct, allowing the - `Name` and driver-specific `Options` to be passed to store a secrets - in an external secrets store. The `Driver` property can be omitted - if the default (internal) secrets store is used. -* `GET /secrets/(id)` and `GET /secrets` now return a `Driver` struct, - containing the `Name` and driver-specific `Options` of the external - secrets store used to store the secret. The `Driver` property is - omitted if no external store is used. -* `POST /secrets/(name)/update` now returns status code 400 instead of 500 when updating a secret's content which is not the labels. -* `POST /nodes/(name)/update` now returns status code 400 instead of 500 when demoting last node fails. -* `GET /networks/(id or name)` now takes an optional query parameter `scope` that will filter the network based on the scope (`local`, `swarm`, or `global`). -* `POST /session` is a new endpoint that can be used for running interactive long-running protocols between client and - the daemon. This endpoint is experimental and only available if the daemon is started with experimental features - enabled. -* `GET /images/(name)/get` now includes an `ImageMetadata` field which contains image metadata that is local to the engine and not part of the image config. -* `POST /services/create` now accepts a `PluginSpec` when `TaskTemplate.Runtime` is set to `plugin` -* `GET /events` now supports config events `create`, `update` and `remove` that are emitted when users create, update or remove a config -* `GET /volumes/` and `GET /volumes/{name}` now return a `CreatedAt` field, - containing the date/time the volume was created. This field is omitted if the - creation date/time for the volume is unknown. For volumes with scope "global", - this field represents the creation date/time of the local _instance_ of the - volume, which may differ from instances of the same volume on different nodes. -* `GET /system/df` now returns a `CreatedAt` field for `Volumes`. Refer to the - `/volumes/` endpoint for a description of this field. - -## v1.30 API changes - -[Docker Engine API v1.30](https://docs.docker.com/reference/api/engine/version/v1.30/) documentation - -* `GET /info` now returns the list of supported logging drivers, including plugins. -* `GET /info` and `GET /swarm` now returns the cluster-wide swarm CA info if the node is in a swarm: the cluster root CA certificate, and the cluster TLS - leaf certificate issuer's subject and public key. It also displays the desired CA signing certificate, if any was provided as part of the spec. -* `POST /build/` now (when not silent) produces an `Aux` message in the JSON output stream with payload `types.BuildResult` for each image produced. The final such message will reference the image resulting from the build. -* `GET /nodes` and `GET /nodes/{id}` now returns additional information about swarm TLS info if the node is part of a swarm: the trusted root CA, and the - issuer's subject and public key. -* `GET /distribution/(name)/json` is a new endpoint that returns a JSON output stream with payload `types.DistributionInspect` for an image name. It includes a descriptor with the digest, and supported platforms retrieved from directly contacting the registry. -* `POST /swarm/update` now accepts 3 additional parameters as part of the swarm spec's CA configuration; the desired CA certificate for - the swarm, the desired CA key for the swarm (if not using an external certificate), and an optional parameter to force swarm to - generate and rotate to a new CA certificate/key pair. -* `POST /service/create` and `POST /services/(id or name)/update` now take the field `Platforms` as part of the service `Placement`, allowing to specify platforms supported by the service. -* `POST /containers/(name)/wait` now accepts a `condition` query parameter to indicate which state change condition to wait for. Also, response headers are now returned immediately to acknowledge that the server has registered a wait callback for the client. -* `POST /swarm/init` now accepts a `DataPathAddr` property to set the IP-address or network interface to use for data traffic -* `POST /swarm/join` now accepts a `DataPathAddr` property to set the IP-address or network interface to use for data traffic -* `GET /events` now supports service, node and secret events which are emitted when users create, update and remove service, node and secret -* `GET /events` now supports network remove event which is emitted when users remove a swarm scoped network -* `GET /events` now supports a filter type `scope` in which supported value could be swarm and local -* `PUT /containers/(name)/archive` now accepts a `copyUIDGID` parameter to allow copy UID/GID maps to dest file or dir. - -## v1.29 API changes - -[Docker Engine API v1.29](https://docs.docker.com/reference/api/engine/version/v1.29/) documentation - -* `DELETE /networks/(name)` now allows to remove the ingress network, the one used to provide the routing-mesh. -* `POST /networks/create` now supports creating the ingress network, by specifying an `Ingress` boolean field. As of now this is supported only when using the overlay network driver. -* `GET /networks/(name)` now returns an `Ingress` field showing whether the network is the ingress one. -* `GET /networks/` now supports a `scope` filter to filter networks based on the network mode (`swarm`, `global`, or `local`). -* `POST /containers/create`, `POST /service/create` and `POST /services/(id or name)/update` now takes the field `StartPeriod` as a part of the `HealthConfig` allowing for specification of a period during which the container should not be considered unhealthy even if health checks do not pass. -* `GET /services/(id)` now accepts an `insertDefaults` query-parameter to merge default values into the service inspect output. -* `POST /containers/prune`, `POST /images/prune`, `POST /volumes/prune`, and `POST /networks/prune` now support a `label` filter to filter containers, images, volumes, or networks based on the label. The format of the label filter could be `label=<key>`/`label=<key>=<value>` to remove those with the specified labels, or `label!=<key>`/`label!=<key>=<value>` to remove those without the specified labels. -* `POST /services/create` now accepts `Privileges` as part of `ContainerSpec`. Privileges currently include - `CredentialSpec` and `SELinuxContext`. - -## v1.28 API changes - -[Docker Engine API v1.28](https://docs.docker.com/reference/api/engine/version/v1.28/) documentation - -* `POST /containers/create` now includes a `Consistency` field to specify the consistency level for each `Mount`, with possible values `default`, `consistent`, `cached`, or `delegated`. -* `GET /containers/create` now takes a `DeviceCgroupRules` field in `HostConfig` allowing to set custom device cgroup rules for the created container. -* Optional query parameter `verbose` for `GET /networks/(id or name)` will now list all services with all the tasks, including the non-local tasks on the given network. -* `GET /containers/(id or name)/attach/ws` now returns WebSocket in binary frame format for API version >= v1.28, and returns WebSocket in text frame format for API version< v1.28, for the purpose of backward-compatibility. -* `GET /networks` is optimised only to return list of all networks and network specific information. List of all containers attached to a specific network is removed from this API and is only available using the network specific `GET /networks/{network-id}`. -* `GET /containers/json` now supports `publish` and `expose` filters to filter containers that expose or publish certain ports. -* `POST /services/create` and `POST /services/(id or name)/update` now accept the `ReadOnly` parameter, which mounts the container's root filesystem as read only. -* `POST /build` now accepts `extrahosts` parameter to specify a host to ip mapping to use during the build. -* `POST /services/create` and `POST /services/(id or name)/update` now accept a `rollback` value for `FailureAction`. -* `POST /services/create` and `POST /services/(id or name)/update` now accept an optional `RollbackConfig` object which specifies rollback options. -* `GET /services` now supports a `mode` filter to filter services based on the service mode (either `global` or `replicated`). -* `POST /containers/(name)/update` now supports updating `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs. -* `POST /plugins/{name}/disable` now accepts a `force` query-parameter to disable a plugin even if still in use. - -## v1.27 API changes - -[Docker Engine API v1.27](https://docs.docker.com/reference/api/engine/version/v1.27/) documentation - -* `GET /containers/(id or name)/stats` now includes an `online_cpus` field in both `precpu_stats` and `cpu_stats`. If this field is `nil` then for compatibility with older daemons the length of the corresponding `cpu_usage.percpu_usage` array should be used. - -## v1.26 API changes - -[Docker Engine API v1.26](https://docs.docker.com/reference/api/engine/version/v1.26/) documentation - -* `POST /plugins/(plugin name)/upgrade` upgrade a plugin. - -## v1.25 API changes - -[Docker Engine API v1.25](https://docs.docker.com/reference/api/engine/version/v1.25/) documentation - -* The API version is now required in all API calls. Instead of just requesting, for example, the URL `/containers/json`, you must now request `/v1.25/containers/json`. -* `GET /version` now returns `MinAPIVersion`. -* `POST /build` accepts `networkmode` parameter to specify network used during build. -* `GET /images/(name)/json` now returns `OsVersion` if populated -* `GET /images/(name)/json` no longer contains the `RootFS.BaseLayer` field. This - field was used for Windows images that used a base-image that was pre-installed - on the host (`RootFS.Type` `layers+base`), which is no longer supported, and - the `RootFS.BaseLayer` field has been removed. -* `GET /info` now returns `Isolation`. -* `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits. -* `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status. -* `GET /containers/json` now accepts `removing` as a valid value for the `status` filter. -* `GET /containers/json` now supports filtering containers by `health` status. -* `DELETE /volumes/(name)` now accepts a `force` query parameter to force removal of volumes that were already removed out of band by the volume driver plugin. -* `POST /containers/create/` and `POST /containers/(name)/update` now validates restart policies. -* `POST /containers/create` now validates IPAMConfig in NetworkingConfig, and returns error for invalid IPv4 and IPv6 addresses (`--ip` and `--ip6` in `docker create/run`). -* `POST /containers/create` now takes a `Mounts` field in `HostConfig` which replaces `Binds`, `Volumes`, and `Tmpfs`. *note*: `Binds`, `Volumes`, and `Tmpfs` are still available and can be combined with `Mounts`. -* `POST /build` now performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. Note that this change is _unversioned_ and applied to all API versions. -* `POST /build` accepts `cachefrom` parameter to specify images used for build cache. -* `GET /networks/` endpoint now correctly returns a list of *all* networks, - instead of the default network if a trailing slash is provided, but no `name` - or `id`. -* `DELETE /containers/(name)` endpoint now returns an error of `removal of container name is already in progress` with status code of 400, when container name is in a state of removal in progress. -* `GET /containers/json` now supports a `is-task` filter to filter - containers that are tasks (part of a service in swarm mode). -* `POST /containers/create` now takes `StopTimeout` field. -* `POST /services/create` and `POST /services/(id or name)/update` now accept `Monitor` and `MaxFailureRatio` parameters, which control the response to failures during service updates. -* `POST /services/(id or name)/update` now accepts a `ForceUpdate` parameter inside the `TaskTemplate`, which causes the service to be updated even if there are no changes which would ordinarily trigger an update. -* `POST /services/create` and `POST /services/(id or name)/update` now return a `Warnings` array. -* `GET /networks/(name)` now returns field `Created` in response to show network created time. -* `POST /containers/(id or name)/exec` now accepts an `Env` field, which holds a list of environment variables to be set in the context of the command execution. -* `GET /volumes`, `GET /volumes/(name)`, and `POST /volumes/create` now return the `Options` field which holds the driver specific options to use for when creating the volume. -* `GET /exec/(id)/json` now returns `Pid`, which is the system pid for the exec'd process. -* `POST /containers/prune` prunes stopped containers. -* `POST /images/prune` prunes unused images. -* `POST /volumes/prune` prunes unused volumes. -* `POST /networks/prune` prunes unused networks. -* Every API response now includes a `Docker-Experimental` header specifying if experimental features are enabled (value can be `true` or `false`). -* Every API response now includes a `API-Version` header specifying the default API version of the server. -* The `hostConfig` option now accepts the fields `CpuRealtimePeriod` and `CpuRtRuntime` to allocate cpu runtime to rt tasks when `CONFIG_RT_GROUP_SCHED` is enabled in the kernel. -* The `SecurityOptions` field within the `GET /info` response now includes `userns` if user namespaces are enabled in the daemon. -* `GET /nodes` and `GET /node/(id or name)` now return `Addr` as part of a node's `Status`, which is the address that that node connects to the manager from. -* The `HostConfig` field now includes `NanoCpus` that represents CPU quota in units of 10<sup>-9</sup> CPUs. -* `GET /info` now returns more structured information about security options. -* The `HostConfig` field now includes `CpuCount` that represents the number of CPUs available for execution by the container. Windows daemon only. -* `POST /services/create` and `POST /services/(id or name)/update` now accept the `TTY` parameter, which allocate a pseudo-TTY in container. -* `POST /services/create` and `POST /services/(id or name)/update` now accept the `DNSConfig` parameter, which specifies DNS related configurations in resolver configuration file (resolv.conf) through `Nameservers`, `Search`, and `Options`. -* `POST /services/create` and `POST /services/(id or name)/update` now support - `node.platform.arch` and `node.platform.os` constraints in the services - `TaskSpec.Placement.Constraints` field. -* `GET /networks/(id or name)` now includes IP and name of all peers nodes for swarm mode overlay networks. -* `GET /plugins` list plugins. -* `POST /plugins/pull?name=<plugin name>` pulls a plugin. -* `GET /plugins/(plugin name)` inspect a plugin. -* `POST /plugins/(plugin name)/set` configure a plugin. -* `POST /plugins/(plugin name)/enable` enable a plugin. -* `POST /plugins/(plugin name)/disable` disable a plugin. -* `POST /plugins/(plugin name)/push` push a plugin. -* `POST /plugins/create?name=(plugin name)` create a plugin. -* `DELETE /plugins/(plugin name)` delete a plugin. -* `POST /node/(id or name)/update` now accepts both `id` or `name` to identify the node to update. -* `GET /images/json` now support a `reference` filter. -* `GET /secrets` returns information on the secrets. -* `POST /secrets/create` creates a secret. -* `DELETE /secrets/{id}` removes the secret `id`. -* `GET /secrets/{id}` returns information on the secret `id`. -* `POST /secrets/{id}/update` updates the secret `id`. -* `POST /services/(id or name)/update` now accepts service name or prefix of service id as a parameter. -* `POST /containers/create` added 2 built-in log-opts that work on all logging drivers, - `mode` (`blocking`|`non-blocking`), and `max-buffer-size` (e.g. `2m`) which enables a non-blocking log buffer. -* `POST /containers/create` now takes `HostConfig.Init` field to run an init - inside the container that forwards signals and reaps processes. - -## v1.24 API changes - -[Docker Engine API v1.24](v1.24.md) documentation - -* `POST /containers/create` now takes `StorageOpt` field. -* `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported. -* `GET /info` no longer returns the `ExecutionDriver` property. This property was no longer used after integration - with ContainerD in Docker 1.11. -* `GET /networks` now supports filtering by `label` and `driver`. -* `GET /containers/json` now supports filtering containers by `network` name or id. -* `POST /containers/create` now takes `IOMaximumBandwidth` and `IOMaximumIOps` fields. Windows daemon only. -* `POST /containers/create` now returns an HTTP 400 "bad parameter" message - if no command is specified (instead of an HTTP 500 "server error") -* `GET /images/search` now takes a `filters` query parameter. -* `GET /events` now supports a `reload` event that is emitted when the daemon configuration is reloaded. -* `GET /events` now supports filtering by daemon name or ID. -* `GET /events` now supports a `detach` event that is emitted on detaching from container process. -* `GET /events` now supports an `exec_detach ` event that is emitted on detaching from exec process. -* `GET /images/json` now supports filters `since` and `before`. -* `POST /containers/(id or name)/start` no longer accepts a `HostConfig`. -* `POST /images/(name)/tag` no longer has a `force` query parameter. -* `GET /images/search` now supports maximum returned search results `limit`. -* `POST /containers/{name:.*}/copy` is now removed and errors out starting from this API version. -* API errors are now returned as JSON instead of plain text. -* `POST /containers/create` and `POST /containers/(id)/start` allow you to configure kernel parameters (sysctls) for use in the container. -* `POST /containers/<container ID>/exec` and `POST /exec/<exec ID>/start` - no longer expects a "Container" field to be present. This property was not used - and is no longer sent by the docker client. -* `POST /containers/create/` now validates the hostname (should be a valid RFC 1123 hostname). -* `POST /containers/create/` `HostConfig.PidMode` field now accepts `container:<name|id>`, - to have the container join the PID namespace of an existing container. - -## v1.23 API changes - -* `GET /containers/json` returns the state of the container, one of `created`, `restarting`, `running`, `paused`, `exited` or `dead`. -* `GET /containers/json` returns the mount points for the container. -* `GET /networks/(name)` now returns an `Internal` field showing whether the network is internal or not. -* `GET /networks/(name)` now returns an `EnableIPv6` field showing whether the network has ipv6 enabled or not. -* `POST /containers/(name)/update` now supports updating container's restart policy. -* `POST /networks/create` now supports enabling ipv6 on the network by setting the `EnableIPv6` field (doing this with a label will no longer work). -* `GET /info` now returns `CgroupDriver` field showing what cgroup driver the daemon is using; `cgroupfs` or `systemd`. -* `GET /info` now returns `KernelMemory` field, showing if "kernel memory limit" is supported. -* `POST /containers/create` now takes `PidsLimit` field, if the kernel is >= 4.3 and the pids cgroup is supported. -* `GET /containers/(id or name)/stats` now returns `pids_stats`, if the kernel is >= 4.3 and the pids cgroup is supported. -* `POST /containers/create` now allows you to override usernamespaces remapping and use privileged options for the container. -* `POST /containers/create` now allows specifying `nocopy` for named volumes, which disables automatic copying from the container path to the volume. -* `POST /auth` now returns an `IdentityToken` when supported by a registry. -* `POST /containers/create` with both `Hostname` and `Domainname` fields specified will result in the container's hostname being set to `Hostname`, rather than `Hostname.Domainname`. -* `GET /volumes` now supports more filters, new added filters are `name` and `driver`. -* `GET /containers/(id or name)/logs` now accepts a `details` query parameter to stream the extra attributes that were provided to the containers `LogOpts`, such as environment variables and labels, with the logs. -* `POST /images/load` now returns progress information as a JSON stream, and has a `quiet` query parameter to suppress progress details. - -## v1.22 API changes - -* The `HostConfig.LxcConf` field has been removed, and is no longer available on - `POST /containers/create` and `GET /containers/(id)/json`. -* `POST /container/(name)/update` updates the resources of a container. -* `GET /containers/json` supports filter `isolation` on Windows. -* `GET /containers/json` now returns the list of networks of containers. -* `GET /info` Now returns `Architecture` and `OSType` fields, providing information - about the host architecture and operating system type that the daemon runs on. -* `GET /networks/(name)` now returns a `Name` field for each container attached to the network. -* `GET /version` now returns the `BuildTime` field in RFC3339Nano format to make it - consistent with other date/time values returned by the API. -* `AuthConfig` now supports a `registrytoken` for token based authentication -* `POST /containers/create` now has a 4M minimum value limit for `HostConfig.KernelMemory` -* Pushes initiated with `POST /images/(name)/push` and pulls initiated with `POST /images/create` - will be cancelled if the HTTP connection making the API request is closed before - the push or pull completes. -* `POST /containers/create` now allows you to set a read/write rate limit for a - device (in bytes per second or IO per second). -* `GET /networks` now supports filtering by `name`, `id` and `type`. -* `POST /containers/create` now allows you to set the static IPv4 and/or IPv6 address for the container. -* `POST /networks/(id)/connect` now allows you to set the static IPv4 and/or IPv6 address for the container. -* `GET /info` now includes the number of containers running, stopped, and paused. -* `POST /networks/create` now supports restricting external access to the network by setting the `Internal` field. -* `POST /networks/(id)/disconnect` now includes a `Force` option to forcefully disconnect a container from network -* `GET /containers/(id)/json` now returns the `NetworkID` of containers. -* `POST /networks/create` Now supports an options field in the IPAM config that provides options - for custom IPAM plugins. -* `GET /networks/{network-id}` Now returns IPAM config options for custom IPAM plugins if any - are available. -* `GET /networks/<network-id>` now returns subnets info for user-defined networks. -* `GET /info` can now return a `SystemStatus` field useful for returning additional information about applications - that are built on top of engine. - -## v1.21 API changes - -* `GET /volumes` lists volumes from all volume drivers. -* `POST /volumes/create` to create a volume. -* `GET /volumes/(name)` get low-level information about a volume. -* `DELETE /volumes/(name)` remove a volume with the specified name. -* `VolumeDriver` was moved from `config` to `HostConfig` to make the configuration portable. -* `GET /images/(name)/json` now returns information about an image's `RepoTags` and `RepoDigests`. -* The `config` option now accepts the field `StopSignal`, which specifies the signal to use to kill a container. -* `GET /containers/(id)/stats` will return networking information respectively for each interface. -* The `HostConfig` option now includes the `DnsOptions` field to configure the container's DNS options. -* `POST /build` now optionally takes a serialized map of build-time variables. -* `GET /events` now includes a `timenano` field, in addition to the existing `time` field. -* `GET /events` now supports filtering by image and container labels. -* `GET /info` now lists engine version information and return the information of `CPUShares` and `Cpuset`. -* `GET /containers/json` will return `ImageID` of the image used by container. -* `POST /exec/(name)/start` will now return an HTTP 409 when the container is either stopped or paused. -* `POST /containers/create` now takes `KernelMemory` in HostConfig to specify kernel memory limit. -* `GET /containers/(name)/json` now accepts a `size` parameter. Setting this parameter to '1' returns container size information in the `SizeRw` and `SizeRootFs` fields. -* `GET /containers/(name)/json` now returns a `NetworkSettings.Networks` field, - detailing network settings per network. This field deprecates the - `NetworkSettings.Gateway`, `NetworkSettings.IPAddress`, - `NetworkSettings.IPPrefixLen`, and `NetworkSettings.MacAddress` fields, which - are still returned for backward-compatibility, but will be removed in a future version. -* `GET /exec/(id)/json` now returns a `NetworkSettings.Networks` field, - detailing networksettings per network. This field deprecates the - `NetworkSettings.Gateway`, `NetworkSettings.IPAddress`, - `NetworkSettings.IPPrefixLen`, and `NetworkSettings.MacAddress` fields, which - are still returned for backward-compatibility, but will be removed in a future version. -* The `HostConfig` option now includes the `OomScoreAdj` field for adjusting the - badness heuristic. This heuristic selects which processes the OOM killer kills - under out-of-memory conditions. - -## v1.20 API changes - -* `GET /containers/(id)/archive` get an archive of filesystem content from a container. -* `PUT /containers/(id)/archive` upload an archive of content to be extracted to -an existing directory inside a container's filesystem. -* `POST /containers/(id)/copy` is deprecated in favor of the above `archive` -endpoint which can be used to download files and directories from a container. -* The `hostConfig` option now accepts the field `GroupAdd`, which specifies a -list of additional groups that the container process will run as. - -## v1.19 API changes - -* When the daemon detects a version mismatch with the client, usually when -the client is newer than the daemon, an HTTP 400 is now returned instead -of a 404. -* `GET /containers/(id)/stats` now accepts `stream` bool to get only one set of stats and disconnect. -* `GET /containers/(id)/logs` now accepts a `since` timestamp parameter. -* `GET /info` The fields `Debug`, `IPv4Forwarding`, `MemoryLimit`, and -`SwapLimit` are now returned as boolean instead of as an int. In addition, the -end point now returns the new boolean fields `CpuCfsPeriod`, `CpuCfsQuota`, and -`OomKillDisable`. -* The `hostConfig` option now accepts the fields `CpuPeriod` and `CpuQuota` -* `POST /build` accepts `cpuperiod` and `cpuquota` options - -## v1.18 API changes - -* `GET /version` now returns `Os`, `Arch` and `KernelVersion`. -* `POST /containers/create` and `POST /containers/(id)/start`allow you to set ulimit settings for use in the container. -* `GET /info` now returns `SystemTime`, `HttpProxy`,`HttpsProxy` and `NoProxy`. -* `GET /images/json` added a `RepoDigests` field to include image digest information. -* `POST /build` can now set resource constraints for all containers created for the build. -* `CgroupParent` can be passed in the host config to setup container cgroups under a specific cgroup. -* `POST /build` closing the HTTP request cancels the build -* `POST /containers/(id)/exec` includes `Warnings` field to response. diff --git a/_vendor/modules.txt b/_vendor/modules.txt index ca334bf0d1a8..1ac92137fbbf 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,6 +1,7 @@ -# github.com/moby/moby v28.1.0-rc.2+incompatible -# github.com/moby/buildkit v0.21.0 -# github.com/docker/buildx v0.23.0 -# github.com/docker/cli v28.1.0+incompatible -# github.com/docker/compose/v2 v2.35.1 -# github.com/docker/scout-cli v1.15.0 +# github.com/moby/moby/api v1.55.0 +# github.com/moby/buildkit v0.32.2 +# github.com/docker/buildx v0.36.1 +# github.com/docker/cli v29.7.2+incompatible +# github.com/docker/compose/v5 v5.5.0 +# github.com/docker/model-runner v1.1.36 +# github.com/docker/docker-agent v1.126.0 diff --git a/assets/css/code.css b/assets/css/code.css deleted file mode 100644 index fa4bb4bd34b6..000000000000 --- a/assets/css/code.css +++ /dev/null @@ -1,81 +0,0 @@ -@layer components { - .prose { - .highlight, - :not(pre) > code { - font-size: 0.875em; - border: 1px solid; - border-radius: theme("spacing.1"); - background: theme("colors.white"); - border-color: theme("colors.gray.light.300"); - .dark & { - background: theme("colors.gray.dark.200"); - border-color: theme("colors.gray.dark.300"); - } - } - - :not(pre) > code { - background: theme("colors.gray.light.200"); - display: inline-block; - margin: 0; - font-weight: 400; - overflow-wrap: anywhere; - padding: 0 4px; - } - - table:not(.lntable) code { - overflow-wrap: unset; - white-space: nowrap; - } - - /* Indented code blocks */ - pre:not(.chroma) { - @apply my-4 overflow-x-auto p-3; - font-size: 0.875em; - border: 1px solid; - border-radius: theme("spacing.1"); - background: theme("colors.white"); - border-color: theme("colors.gray.light.300"); - .dark & { - background: theme("colors.gray.dark.200"); - border-color: theme("colors.gray.dark.300"); - } - } - - .highlight { - @apply my-4 overflow-x-auto p-3; - - /* LineTableTD */ - .lntd { - vertical-align: top; - padding: 0; - margin: 0; - font-weight: 400; - padding: 0 4px; - &:first-child { - width: 0; - } - } - - /* LineTableTD */ - .lntd { - vertical-align: top; - padding: 0; - margin: 0; - border: 0; - } - /* LineTable */ - .lntable { - display: table; - width: 100%; - border-spacing: 0; - padding: 0; - margin: 0; - border: 0; - /* LineNumberColumnHighlight */ - .lntd:first-child .hl { - display: block; - } - } - } - } -} diff --git a/assets/css/components.css b/assets/css/components.css new file mode 100644 index 000000000000..a0f711f2dd8d --- /dev/null +++ b/assets/css/components.css @@ -0,0 +1,130 @@ +@layer components { + .card { + @apply mt-2 mb-2 flex flex-col gap-2 rounded-sm border border-gray-200 p-3; + @apply dark:border-gray-700 dark:bg-gray-900; + @apply transition-shadow duration-200; + &:hover, + &:focus { + @apply border-gray-300 dark:border-gray-600; + } + } + .card-link:hover { + @apply !no-underline; + } + .card-header { + @apply mb-2 flex items-center gap-2; + @apply text-gray-700 dark:text-gray-100; + } + .card-icon { + @apply text-gray-700 dark:text-gray-100; + } + .card-img, + .card-img svg { + @apply m-0 flex max-h-5 min-h-5 max-w-5 min-w-5 items-center justify-center fill-current; + } + .card-title { + @apply font-semibold; + } + .card-link { + @apply block text-inherit no-underline hover:underline; + } + .card-description { + @apply text-gray-600; + @apply dark:text-gray-300; + } + + .admonition { + @apply relative mb-4 flex w-full flex-col items-start gap-3 rounded-sm px-6 py-4; + @apply bg-gray-50 dark:bg-gray-900; + } + .admonition-header { + @apply flex flex-wrap items-center gap-2; + } + .admonition-title { + @apply font-semibold; + } + .admonition-content { + @apply w-full min-w-0 flex-1 flex-wrap overflow-x-auto break-words; + color: var(--tw-prose-body); + } + .admonition-note { + @apply border-blue-400 bg-blue-50 text-blue-900; + @apply dark:border-blue-600 dark:bg-blue-950 dark:text-blue-100; + } + .admonition-tip { + @apply border-green-400 bg-green-100 text-green-900; + @apply dark:border-green-600 dark:bg-green-950 dark:text-green-100; + } + .admonition-warning { + @apply border-yellow-400 bg-yellow-50 text-yellow-900; + @apply dark:border-yellow-600 dark:bg-yellow-950 dark:text-yellow-100; + } + .admonition-danger { + @apply border-red-400 bg-red-50 text-red-900; + @apply dark:border-red-600 dark:bg-red-950 dark:text-red-100; + } + .admonition-important { + @apply border-purple-400 bg-purple-50 text-purple-900; + @apply dark:border-purple-600 dark:bg-purple-950 dark:text-purple-100; + } + .admonition-icon { + @apply flex-shrink-0; + width: 24px; + height: 24px; + min-width: 24px; + min-height: 24px; + display: flex; + align-items: center; + justify-content: center; + } + .admonition p{ + margin-bottom: 1em; + } + .admonition ul{ + @apply list-disc pl-5 mb-1; + } + + .download-links { + @apply my-0 text-gray-600 dark:text-gray-400 rounded-sm border-1 border-gray-100 bg-gray-100/10 px-2 py-1; + @apply dark:border-gray-800 dark:bg-gray-900; + font-size: 86%; + } + + .download-links a { + @apply link; + } + + .download-links-subcontainer { + @apply flex flex-row gap-2 justify-between; + ul{ + @apply m-0 p-0 list-none; + li{ + @apply p-0 m-0; + } + } + } + + .card-image { + @apply h-12 w-12 overflow-hidden; + } + + .button { + @apply my-2 mr-2 inline-block rounded-sm bg-blue-500 p-1 px-3 text-white hover:bg-blue-600 dark:bg-blue-500 hover:dark:bg-blue-400; + } + + .summary-bar { + @apply my-1 mt-4 flex flex-col rounded-sm border-1 border-gray-100 bg-gray-50 p-4 dark:border-gray-800 dark:bg-gray-900; + } + + .tabs { + @apply bg-blue/2 rounded-sm p-2; + } + .tablist { + @apply mb-1 border-b border-gray-100 dark:border-gray-800; + } + + .tab-item { + @apply inline-block rounded-t-sm px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-900; + @apply dark:text-gray-200; + } +} \ No newline at end of file diff --git a/assets/css/global.css b/assets/css/global.css index fa6742830e81..ba29b4dc6d16 100644 --- a/assets/css/global.css +++ b/assets/css/global.css @@ -1,89 +1,110 @@ /* global styles */ -@layer base { - [x-cloak=""] { +[x-cloak=""] { + display: none !important; +} +/* alpine cloak for small screens only */ +[x-cloak="sm"] { + @media (width <= 768px) { display: none !important; } - /* alpine cloak for small screens only */ - [x-cloak="sm"] { - @media (width <= 768px) { - display: none !important; - } - } +} +/* Theme toggle icon visibility — driven by data-theme-preference on <html>, + set synchronously by theme.js before first paint. x-show handles updates + after Alpine initialises; these rules cover the pre-Alpine window. */ +:root[data-theme-preference="light"] .theme-icon-moon, +:root[data-theme-preference="light"] .theme-icon-auto, +:root[data-theme-preference="dark"] .theme-icon-sun, +:root[data-theme-preference="dark"] .theme-icon-auto, +:root[data-theme-preference="auto"] .theme-icon-sun, +:root[data-theme-preference="auto"] .theme-icon-moon { + display: none; +} - :root { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; +:root { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; - scrollbar-color: theme(colors.gray.light.400) theme(colors.black / 0.05); - &.dark { - scrollbar-color: theme(colors.gray.dark.800) theme(colors.white / 0.10); - } + scrollbar-color: var(--color-gray-400) rgba(0, 0, 0, 0.05); + &.dark { + scrollbar-color: var(--color-gray-700) rgba(255, 255, 255, 0.1); } +} - mark { - @apply bg-transparent font-bold text-blue-light dark:text-blue-dark; - } +mark { + @apply bg-transparent font-bold text-blue-500 dark:text-blue-400; +} - /* Hide the clear (X) button for search inputs */ - /* Chrome, Safari, Edge, and Opera */ - input[type="search"]::-webkit-search-cancel-button { - -webkit-appearance: none; - appearance: none; - } - - /* Firefox */ - input[type="search"]::-moz-search-cancel-button { - display: none; - } - - /* Internet Explorer and Edge (legacy) */ - input[type="search"]::-ms-clear { - display: none; - } +/* Hide the clear (X) button for search inputs */ +/* Chrome, Safari, Edge, and Opera */ +input[type="search"]::-webkit-search-cancel-button { + -webkit-appearance: none; + appearance: none; } -/* utility classes */ +/* Firefox */ +input[type="search"]::-moz-search-cancel-button { + display: none; +} -@layer utilities { - .link { - @apply text-blue-light underline underline-offset-2 dark:text-blue-dark; +/* Internet Explorer and Edge (legacy) */ +input[type="search"]::-ms-clear { + display: none; +} +.prose { + hr { + @apply mt-8 mb-4; } - - .invertible { - @apply dark:hue-rotate-180 dark:invert dark:filter; + :where(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)) { + font-weight: 500 !important; + font-size: 180% !important; + margin-bottom: 0.4em !important; } - - .bg-pattern-blue { - background-color: theme(colors.white / 50%); - background-image: url('/assets/images/bg-pattern-blue.webp'); - background-blend-mode: overlay; - background-size: cover; - background-repeat: none; - .dark & { - background-color: theme(colors.black / 70%); + > h2 { + @apply mt-7! mb-3!; + font-size: 160% !important; + a { + @apply hover:no-underline!; } } - - .bg-pattern-purple { - background-color: theme(colors.white / 50%); - background-image: url('/assets/images/bg-pattern-purple.webp'); - background-blend-mode: overlay; - background-size: cover; - background-repeat: none; - .dark & { - background-color: theme(colors.black / 70%); + > h3 { + font-size: 130% !important; + a { + @apply hover:no-underline!; } } - - .bg-pattern-verde { - background-color: theme(colors.white / 50%); - background-image: url('/assets/images/bg-pattern-verde.webp'); - background-blend-mode: overlay; - background-size: cover; - background-repeat: none; - .dark & { - background-color: theme(colors.black / 70%); + > h4 { + a { + @apply hover:no-underline!; + } + } + > h5 { + a { + @apply hover:no-underline!; } } + ol { + list-style-type: decimal; + } + + ol ol { + list-style-type: lower-alpha; + } + + ol ol ol { + list-style-type: lower-roman; + } +} +.navbar-group:first-of-type { + margin-top: 0.2rem !important; +} + +#search-page-results { + mark:where(.dark, .dark *) { + color: var(--color-blue-400); + } +} + +code { + font-size: 0.9em; } diff --git a/assets/css/icons.css b/assets/css/icons.css deleted file mode 100644 index 08428273b262..000000000000 --- a/assets/css/icons.css +++ /dev/null @@ -1,29 +0,0 @@ -@layer utilities { - .icon-svg { - svg { - font-size: 24px; - width: 1em; - height: 1em; - display: inline-block; - fill: currentColor; - } - } - - .icon-xs { - svg { - font-size: 12px; - } - } - - .icon-sm { - svg { - font-size: 16px; - } - } - - .icon-lg { - svg { - font-size: 32px; - } - } -} diff --git a/assets/css/lists.css b/assets/css/lists.css deleted file mode 100644 index 249f71f4f2a3..000000000000 --- a/assets/css/lists.css +++ /dev/null @@ -1,12 +0,0 @@ -.prose ol { - list-style-type: decimal; -} - -.prose ol ol { - list-style-type: lower-alpha; -} - -.prose ol ol ol { - list-style-type: lower-roman; -} - diff --git a/assets/css/pagefind.css b/assets/css/pagefind.css new file mode 100644 index 000000000000..a6619c3b104a --- /dev/null +++ b/assets/css/pagefind.css @@ -0,0 +1,25 @@ +/* Pagefind Component UI Customizations */ + +/* Dark mode variables for modal */ +.dark pagefind-modal { + --pf-text: var(--color-gray-100); + --pf-text-secondary: var(--color-gray-300); + --pf-text-muted: var(--color-gray-400); + --pf-background: var(--color-gray-900); + --pf-border: var(--color-gray-700); + --pf-border-focus: var(--color-blue-400); + --pf-hover: var(--color-gray-800); +} + +/* Highlight marks in results */ +pagefind-results mark { + background-color: var(--color-yellow-200); + color: inherit; + padding: 0 0.125rem; + border-radius: 0.125rem; +} + +.dark pagefind-results mark { + background-color: rgba(255, 204, 72, 0.3); + color: white; +} diff --git a/assets/css/style.css b/assets/css/style.css new file mode 100644 index 000000000000..f63fc6f5aec2 --- /dev/null +++ b/assets/css/style.css @@ -0,0 +1,47 @@ +/* Main CSS entry point */ +@import "tailwindcss"; +@plugin "@tailwindcss/typography"; +@source "hugo_stats.json"; + +@font-face { + font-family: "Roboto Flex"; + src: url("/assets/fonts/RobotoFlex.woff2") format("woff2"); + font-weight: 100 1000; /* Range of weights Roboto Flex supports */ + font-stretch: 100%; /* Range of width Roboto Flex supports */ + font-style: oblique 0deg 10deg; /* Range of oblique angle Roboto Flex supports */ + font-display: fallback; +} + +/* Roboto Mono */ +@font-face { + font-family: "Roboto Mono"; + src: url("/assets/fonts/RobotoMono-Regular.woff2") format("woff2"); + font-weight: 100 700; /* Define the range of weight the variable font supports */ + font-style: normal; + font-display: fallback; +} + +/* Roboto Mono Italic */ +@font-face { + font-family: "Roboto Mono"; + src: url("/assets/fonts/RobotoMono-Italic.woff2") format("woff2"); + font-weight: 100 700; /* Define the range of weight the variable font supports */ + font-style: italic; + font-display: fallback; +} + +@layer theme { + @import "theme.css"; +} + +@layer base { + @import "global.css"; +} +@import "utilities.css"; +@import "pagefind.css"; +@import "syntax-dark.css"; +@import "syntax-light.css"; +@import "components.css"; +@import "highlight-github-dark.css"; + +@variant dark (&:where(.dark, .dark *)); diff --git a/assets/css/styles.css b/assets/css/styles.css deleted file mode 100644 index 377c07bcc22a..000000000000 --- a/assets/css/styles.css +++ /dev/null @@ -1,16 +0,0 @@ -/* see also: tailwind.config.js */ - -@import "tailwindcss/base"; -@import "/assets/css/global"; -@import "/assets/css/typography"; -@import "/assets/css/hack"; - -@import "tailwindcss/components"; -@import "/assets/css/code"; -@import "/assets/css/toc"; - -@import "tailwindcss/utilities"; -@import "/assets/css/syntax-light"; -@import "/assets/css/syntax-dark"; -@import "/assets/css/icons"; -@import "/assets/css/lists"; diff --git a/assets/css/syntax-dark.css b/assets/css/syntax-dark.css index ff24a1954882..e66c18186f6f 100644 --- a/assets/css/syntax-dark.css +++ b/assets/css/syntax-dark.css @@ -1,343 +1,337 @@ -@layer utilities { - .syntax-dark { - /* Other */ - .x { - color: theme("colors.white"); - } - /* Error */ - .err { - color: theme("colors.red.dark.500"); - } - /* CodeLine */ - .cl { - } - /* LineHighlight */ - .hl { - min-width: fit-content; - background-color: theme("colors.gray.dark.300"); - } - .lntd:first-child .hl, - & > .chroma > code > .hl { - margin-left: -4px; - border-left: 4px solid theme("colors.gray.dark.400"); - } - /* LineNumbersTable */ - .lnt { - white-space: pre; - user-select: none; - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: theme("colors.gray.dark.400"); - } - /* LineNumbers */ - .ln { - white-space: pre; - user-select: none; - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: theme("colors.gray.dark.400"); - } - /* Line */ - .line { - display: flex; - } - /* Keyword */ - .k { - color: theme("colors.amber.dark.700"); - } - /* KeywordConstant */ - .kc { - color: theme("colors.violet.dark.700"); - } - /* KeywordDeclaration */ - .kd { - color: theme("colors.amber.dark.700"); - } - /* KeywordNamespace */ - .kn { - color: theme("colors.amber.dark.700"); - } - /* KeywordPseudo */ - .kp { - color: theme("colors.amber.dark.700"); - } - /* KeywordReserved */ - .kr { - color: theme("colors.amber.dark.700"); - } - /* KeywordType */ - .kt { - color: theme("colors.amber.dark.700"); - } - /* Name */ - .n { - color: theme("colors.violet.dark.700"); - } - /* NameAttribute */ - .na { - color: theme("colors.amber.dark.700"); - } - /* NameBuiltin */ - .nb { - color: theme("colors.amber.dark.700"); - } - /* NameBuiltinPseudo */ - .bp { - color: theme("colors.violet.dark.700"); - } - /* NameClass */ - .nc { - color: theme("colors.white"); - } - /* NameConstant */ - .no { - color: theme("colors.white"); - } - /* NameDecorator */ - .nd { - color: theme("colors.violet.dark.700"); - } - /* NameEntity */ - .ni { - color: theme("colors.amber.dark.700"); - } - /* NameException */ - .ne { - color: theme("colors.red.dark.700"); - } - /* NameFunction */ - .nf { - color: theme("colors.blue.dark.600"); - } - /* NameFunctionMagic */ - .fm { - color: theme("colors.blue.dark.600"); - } - /* NameLabel */ - .nl { - color: theme("colors.amber.dark.500"); - } - /* NameNamespace */ - .nn { - color: theme("colors.white"); - } - /* NameOther */ - .nx { - color: theme("colors.white"); - } - /* NameProperty */ - .py { - color: theme("colors.white"); - } - /* NameTag */ - .nt { - color: theme("colors.green.dark.600"); - } - /* NameVariable */ - .nv { - color: theme("colors.white"); - } - /* NameVariableClass */ - .vc { - color: theme("colors.violet.dark.600"); - } - /* NameVariableGlobal */ - .vg { - color: theme("colors.violet.dark.600"); - } - /* NameVariableInstance */ - .vi { - color: theme("colors.violet.dark.600"); - } - /* NameVariableMagic */ - .vm { - color: theme("colors.violet.dark.600"); - } - /* Literal */ - .l { - color: theme("colors.white"); - } - /* LiteralDate */ - .ld { - color: theme("colors.green.dark.600"); - } - /* LiteralString */ - .s { - color: theme("colors.white"); - } - /* LiteralStringAffix */ - .sa { - color: theme("colors.green.dark.600"); - } - /* LiteralStringBacktick */ - .sb { - color: theme("colors.green.dark.600"); - } - /* LiteralStringChar */ - .sc { - color: theme("colors.green.dark.600"); - } - /* LiteralStringDelimiter */ - .dl { - color: theme("colors.green.dark.600"); - } - /* LiteralStringDoc */ - .sd { - color: theme("colors.green.dark.600"); - } - /* LiteralStringDouble */ - .s2 { - color: theme("colors.green.dark.600"); - } - /* LiteralStringEscape */ - .se { - color: theme("colors.white"); - } - /* LiteralStringHeredoc */ - .sh { - color: theme("colors.green.dark.600"); - } - /* LiteralStringInterpol */ - .si { - color: theme("colors.green.dark.600"); - } - /* LiteralStringOther */ - .sx { - color: theme("colors.green.dark.600"); - } - /* LiteralStringRegex */ - .sr { - color: theme("colors.blue.dark.500"); - } - /* LiteralStringSingle */ - .s1 { - color: theme("colors.green.dark.600"); - } - /* LiteralStringSymbol */ - .ss { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumber */ - .m { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberBin */ - .mb { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberFloat */ - .mf { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberHex */ - .mh { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberInteger */ - .mi { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberIntegerLong */ - .il { - color: theme("colors.blue.dark.600"); - } - /* LiteralNumberOct */ - .mo { - color: theme("colors.blue.dark.600"); - } - /* Operator */ - .o { - color: theme("colors.blue.dark.700"); - } - /* OperatorWord */ - .ow { - color: theme("colors.amber.dark.700"); - } - /* Punctuation */ - .p { - color: theme("colors.gray.dark.500"); - } - /* Comment */ - .c { - color: theme("colors.gray.dark.500"); - } - /* CommentHashbang */ - .ch { - color: theme("colors.gray.dark.500"); - } - /* CommentMultiline */ - .cm { - color: theme("colors.gray.dark.500"); - } - /* CommentSingle */ - .c1 { - color: theme("colors.gray.dark.500"); - } - /* CommentSpecial */ - .cs { - color: theme("colors.gray.dark.500"); - } - /* CommentPreproc */ - .cp { - color: theme("colors.gray.dark.500"); - } - /* CommentPreprocFile */ - .cpf { - color: theme("colors.gray.dark.500"); - } - /* Generic */ - .g { - color: theme("colors.white"); - } - /* GenericDeleted */ - .gd { - color: theme("colors.red.dark.500"); - } - /* GenericEmph */ - .ge { - color: theme("colors.white"); - } - /* GenericError */ - .gr { - color: theme("colors.red.dark.500"); - } - /* GenericHeading */ - .gh { - color: theme("colors.gray.dark.600"); - } - /* GenericInserted */ - .gi { - color: theme("colors.green.dark.500"); - } - /* GenericOutput */ - .go { - color: theme("colors.white"); - } - /* GenericPrompt */ - .gp { - user-select: none; - color: theme("colors.green.dark.400"); - } - /* GenericStrong */ - .gs { - color: theme("colors.white"); - } - /* GenericSubheading */ - .gu { - color: theme("colors.gray.dark.600"); - } - /* GenericTraceback */ - .gt { - color: theme("colors.red.dark.500"); - } - /* GenericUnderline */ - .gl { - color: theme("colors.white"); - text-decoration: underline; - } - /* TextWhitespace */ - .w { - color: theme("colors.gray.dark.100"); - } +@utility syntax-dark { + /* Other */ + .x { + color: var(--color-white-main); + } + /* Error */ + .err { + color: var(--color-red-500); + } + /* CodeLine */ + .cl { + color: var(--color-gray-200); + } + /* LineHighlight */ + .hl { + min-width: fit-content; + background-color: var(--color-gray-800); + } + /* LineNumbersTable */ + .lnt { + white-space: pre; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: var(--color-gray-300); + } + /* LineNumbers */ + .ln { + white-space: pre; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: var(--color-gray-900); + } + /* Line */ + .line { + display: flex; + } + /* Keyword */ + .k { + color: var(--color-yellow-700); + } + /* KeywordConstant */ + .kc { + color: var(--color-violet-300); + } + /* KeywordDeclaration */ + .kd { + color: var(--color-yellow-700); + } + /* KeywordNamespace */ + .kn { + color: var(--color-yellow-700); + } + /* KeywordPseudo */ + .kp { + color: var(--color-yellow-700); + } + /* KeywordReserved */ + .kr { + color: var(--color-yellow-700); + } + /* KeywordType */ + .kt { + color: var(--color-yellow-700); + } + /* Name */ + .n { + color: var(--color-violet-300); + } + /* NameAttribute */ + .na { + color: var(--color-yellow-700); + } + /* NameBuiltin */ + .nb { + color: var(--color-yellow-700); + } + /* NameBuiltinPseudo */ + .bp { + color: var(--color-violet-300); + } + /* NameClass */ + .nc { + color: var(--color-white-main); + } + /* NameConstant */ + .no { + color: var(--color-white-main); + } + /* NameDecorator */ + .nd { + color: var(--color-violet-300); + } + /* NameEntity */ + .ni { + color: var(--color-yellow-700); + } + /* NameException */ + .ne { + color: var(--color-red-700); + } + /* NameFunction */ + .nf { + color: var(--color-blue-400); + } + /* NameFunctionMagic */ + .fm { + color: var(--color-blue-400); + } + /* NameLabel */ + .nl { + color: var(--color-yellow-500); + } + /* NameNamespace */ + .nn { + color: var(--color-white-main); + } + /* NameOther */ + .nx { + color: var(--color-white-main); + } + /* NameProperty */ + .py { + color: var(--color-violet-300); + } + /* NameTag */ + .nt { + color: var(--color-green-300); + } + /* NameVariable */ + .nv { + color: var(--color-green-500); + } + /* NameVariableClass */ + .vc { + color: var(--color-violet-600); + } + /* NameVariableGlobal */ + .vg { + color: var(--color-violet-600); + } + /* NameVariableInstance */ + .vi { + color: var(--color-violet-600); + } + /* NameVariableMagic */ + .vm { + color: var(--color-violet-600); + } + /* Literal */ + .l { + color: var(--color-white-main); + } + /* LiteralDate */ + .ld { + color: var(--color-green-600); + } + /* LiteralString */ + .s { + color: var(--color-white-main); + } + /* LiteralStringAffix */ + .sa { + color: var(--color-green-600); + } + /* LiteralStringBacktick */ + .sb { + color: var(--color-green-600); + } + /* LiteralStringChar */ + .sc { + color: var(--color-green-600); + } + /* LiteralStringDelimiter */ + .dl { + color: var(--color-green-600); + } + /* LiteralStringDoc */ + .sd { + color: var(--color-green-600); + } + /* LiteralStringDouble */ + .s2 { + color: var(--color-green-600); + } + /* LiteralStringEscape */ + .se { + color: var(--color-white-main); + } + /* LiteralStringHeredoc */ + .sh { + color: var(--color-green-600); + } + /* LiteralStringInterpol */ + .si { + color: var(--color-green-600); + } + /* LiteralStringOther */ + .sx { + color: var(--color-green-600); + } + /* LiteralStringRegex */ + .sr { + color: var(--color-blue-400); + } + /* LiteralStringSingle */ + .s1 { + color: var(--color-green-600); + } + /* LiteralStringSymbol */ + .ss { + color: var(--color-blue-400); + } + /* LiteralNumber */ + .m { + color: var(--color-blue-400); + } + /* LiteralNumberBin */ + .mb { + color: var(--color-blue-400); + } + /* LiteralNumberFloat */ + .mf { + color: var(--color-blue-400); + } + /* LiteralNumberHex */ + .mh { + color: var(--color-blue-400); + } + /* LiteralNumberInteger */ + .mi { + color: var(--color-blue-400); + } + /* LiteralNumberIntegerLong */ + .il { + color: var(--color-blue-400); + } + /* LiteralNumberOct */ + .mo { + color: var(--color-blue-400); + } + /* Operator */ + .o { + color: var(--color-blue-200); + } + /* OperatorWord */ + .ow { + color: var(--color-yellow-700); + } + /* Punctuation */ + .p { + color: var(--color-gray-500); + } + /* Comment */ + .c { + color: var(--color-gray-500); + } + /* CommentHashbang */ + .ch { + color: var(--color-gray-500); + } + /* CommentMultiline */ + .cm { + color: var(--color-gray-500); + } + /* CommentSingle */ + .c1 { + color: var(--color-gray-500); + } + /* CommentSpecial */ + .cs { + color: var(--color-gray-500); + } + /* CommentPreproc */ + .cp { + color: var(--color-gray-500); + } + /* CommentPreprocFile */ + .cpf { + color: var(--color-gray-500); + } + /* Generic */ + .g { + color: var(--color-white-main); + } + /* GenericDeleted */ + .gd { + color: var(--color-red-500); + } + /* GenericEmph */ + .ge { + color: var(--color-white-main); + } + /* GenericError */ + .gr { + color: var(--color-red-500); + } + /* GenericHeading */ + .gh { + color: var(--color-gray-600); + } + /* GenericInserted */ + .gi { + color: var(--color-green-500); + } + /* GenericOutput */ + .go { + color: var(--color-white-main); + } + /* GenericPrompt */ + .gp { + user-select: none; + color: var(--color-green-500); + } + /* GenericStrong */ + .gs { + color: var(--color-white-main); + } + /* GenericSubheading */ + .gu { + color: var(--color-gray-600); + } + /* GenericTraceback */ + .gt { + color: var(--color-red-500); + } + /* GenericUnderline */ + .gl { + color: var(--color-white-main); + text-decoration: underline; + } + /* TextWhitespace */ + .w { + color: var(--color-gray-100); } } diff --git a/assets/css/syntax-light.css b/assets/css/syntax-light.css index ba0bb789f853..e9c3151d14fe 100644 --- a/assets/css/syntax-light.css +++ b/assets/css/syntax-light.css @@ -1,343 +1,337 @@ -@layer utilities { - .syntax-light { - /* Other */ - .x { - color: theme("colors.black"); - } - /* Error */ - .err { - color: theme("colors.red.light.500"); - } - /* CodeLine */ - .cl { - } - /* LineHighlight */ - .hl { - min-width: fit-content; - background-color: theme("colors.blue.light.100"); - } - .lntd:first-child .hl, - & > .chroma > code > .hl { - margin-left: -4px; - border-left: 4px solid theme("colors.blue.light.300"); - } - /* LineNumbersTable */ - .lnt { - white-space: pre; - user-select: none; - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: theme("colors.gray.light.400"); - } - /* LineNumbers */ - .ln { - white-space: pre; - user-select: none; - margin-right: 0.4em; - padding: 0 0.4em 0 0.4em; - color: theme("colors.gray.light.400"); - } - /* Line */ - .line { - display: flex; - } - /* Keyword */ - .k { - color: theme("colors.amber.light.500"); - } - /* KeywordConstant */ - .kc { - color: theme("colors.violet.light.400"); - } - /* KeywordDeclaration */ - .kd { - color: theme("colors.amber.light.500"); - } - /* KeywordNamespace */ - .kn { - color: theme("colors.amber.light.500"); - } - /* KeywordPseudo */ - .kp { - color: theme("colors.amber.light.500"); - } - /* KeywordReserved */ - .kr { - color: theme("colors.amber.light.500"); - } - /* KeywordType */ - .kt { - color: theme("colors.amber.light.500"); - } - /* Name */ - .n { - color: theme("colors.violet.light.400"); - } - /* NameAttribute */ - .na { - color: theme("colors.amber.light.500"); - } - /* NameBuiltin */ - .nb { - color: theme("colors.amber.light.500"); - } - /* NameBuiltinPseudo */ - .bp { - color: theme("colors.violet.light.400"); - } - /* NameClass */ - .nc { - color: theme("colors.black"); - } - /* NameConstant */ - .no { - color: theme("colors.black"); - } - /* NameDecorator */ - .nd { - color: theme("colors.violet.light.400"); - } - /* NameEntity */ - .ni { - color: theme("colors.amber.light.500"); - } - /* NameException */ - .ne { - color: theme("colors.red.light.700"); - } - /* NameFunction */ - .nf { - color: theme("colors.blue.light.600"); - } - /* NameFunctionMagic */ - .fm { - color: theme("colors.blue.light.600"); - } - /* NameLabel */ - .nl { - color: theme("colors.amber.light.700"); - } - /* NameNamespace */ - .nn { - color: theme("colors.black"); - } - /* NameOther */ - .nx { - color: theme("colors.black"); - } - /* NameProperty */ - .py { - color: theme("colors.black"); - } - /* NameTag */ - .nt { - color: theme("colors.green.light.600"); - } - /* NameVariable */ - .nv { - color: theme("colors.black"); - } - /* NameVariableClass */ - .vc { - color: theme("colors.violet.light.600"); - } - /* NameVariableGlobal */ - .vg { - color: theme("colors.violet.light.600"); - } - /* NameVariableInstance */ - .vi { - color: theme("colors.violet.light.600"); - } - /* NameVariableMagic */ - .vm { - color: theme("colors.violet.light.600"); - } - /* Literal */ - .l { - color: theme("colors.black"); - } - /* LiteralDate */ - .ld { - color: theme("colors.black"); - } - /* LiteralString */ - .s { - color: theme("colors.black"); - } - /* LiteralStringAffix */ - .sa { - color: theme("colors.green.light.600"); - } - /* LiteralStringBacktick */ - .sb { - color: theme("colors.green.light.600"); - } - /* LiteralStringChar */ - .sc { - color: theme("colors.green.light.600"); - } - /* LiteralStringDelimiter */ - .dl { - color: theme("colors.green.light.600"); - } - /* LiteralStringDoc */ - .sd { - color: #8f5902; - } - /* LiteralStringDouble */ - .s2 { - color: theme("colors.green.light.600"); - } - /* LiteralStringEscape */ - .se { - color: theme("colors.black"); - } - /* LiteralStringHeredoc */ - .sh { - color: theme("colors.green.light.600"); - } - /* LiteralStringInterpol */ - .si { - color: theme("colors.green.light.600"); - } - /* LiteralStringOther */ - .sx { - color: theme("colors.green.light.600"); - } - /* LiteralStringRegex */ - .sr { - color: theme("colors.blue.light.500"); - } - /* LiteralStringSingle */ - .s1 { - color: theme("colors.green.light.600"); - } - /* LiteralStringSymbol */ - .ss { - color: theme("colors.green.light.600"); - } - /* LiteralNumber */ - .m { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberBin */ - .mb { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberFloat */ - .mf { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberHex */ - .mh { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberInteger */ - .mi { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberIntegerLong */ - .il { - color: theme("colors.blue.light.600"); - } - /* LiteralNumberOct */ - .mo { - color: theme("colors.blue.light.600"); - } - /* Operator */ - .o { - color: theme("colors.blue.light.400"); - } - /* OperatorWord */ - .ow { - color: theme("colors.amber.light.500"); - } - /* Punctuation */ - .p { - color: theme("colors.gray.light.400"); - } - /* Comment */ - .c { - color: theme("colors.gray.light.400"); - } - /* CommentHashbang */ - .ch { - color: theme("colors.gray.light.400"); - } - /* CommentMultiline */ - .cm { - color: theme("colors.gray.light.400"); - } - /* CommentSingle */ - .c1 { - color: theme("colors.gray.light.400"); - } - /* CommentSpecial */ - .cs { - color: theme("colors.gray.light.400"); - } - /* CommentPreproc */ - .cp { - color: theme("colors.gray.light.400"); - } - /* CommentPreprocFile */ - .cpf { - color: theme("colors.gray.light.400"); - } - /* Generic */ - .g { - color: theme("colors.black"); - } - /* GenericDeleted */ - .gd { - color: theme("colors.red.light.500"); - } - /* GenericEmph */ - .ge { - color: theme("colors.black"); - } - /* GenericError */ - .gr { - color: theme("colors.red.light.500"); - } - /* GenericHeading */ - .gh { - color: theme("colors.gray.light.600"); - } - /* GenericInserted */ - .gi { - color: theme("colors.green.light.500"); - } - /* GenericOutput */ - .go { - color: theme("colors.black"); - } - /* GenericPrompt */ - .gp { - user-select: none; - color: theme("colors.green.light.400"); - } - /* GenericStrong */ - .gs { - color: theme("colors.black"); - } - /* GenericSubheading */ - .gu { - color: theme("colors.gray.light.600"); - } - /* GenericTraceback */ - .gt { - color: theme("colors.red.light.500"); - } - /* GenericUnderline */ - .gl { - color: theme("colors.black"); - text-decoration: underline; - } - /* TextWhitespace */ - .w { - color: theme("colors.gray.light.100"); - } +@utility syntax-light { + /* Other */ + .x { + color: var(--color-black-main); + } + /* Error */ + .err { + color: var(--color-red-500); + } + /* CodeLine */ + .cl { + color: var(--color-gray-700); + } + /* LineHighlight */ + .hl { + min-width: fit-content; + background-color: var(--color-gray-100); + } + /* LineNumbersTable */ + .lnt { + white-space: pre; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: var(--color-gray-400); + } + /* LineNumbers */ + .ln { + white-space: pre; + user-select: none; + margin-right: 0.4em; + padding: 0 0.4em 0 0.4em; + color: var(--color-gray-400); + } + /* Line */ + .line { + display: flex; + } + /* Keyword */ + .k { + color: var(--color-yellow-700); + } + /* KeywordConstant */ + .kc { + color: var(--color-violet-400); + } + /* KeywordDeclaration */ + .kd { + color: var(--color-yellow-700); + } + /* KeywordNamespace */ + .kn { + color: var(--color-yellow-700); + } + /* KeywordPseudo */ + .kp { + color: var(--color-yellow-700); + } + /* KeywordReserved */ + .kr { + color: var(--color-yellow-700); + } + /* KeywordType */ + .kt { + color: var(--color-yellow-700); + } + /* Name */ + .n { + color: var(--color-violet-400); + } + /* NameAttribute */ + .na { + color: var(--color-yellow-700); + } + /* NameBuiltin */ + .nb { + color: var(--color-yellow-800); + } + /* NameBuiltinPseudo */ + .bp { + color: var(--color-violet-400); + } + /* NameClass */ + .nc { + color: var(--color-black-main); + } + /* NameConstant */ + .no { + color: var(--color-black-main); + } + /* NameDecorator */ + .nd { + color: var(--color-violet-400); + } + /* NameEntity */ + .ni { + color: var(--color-yellow-700); + } + /* NameException */ + .ne { + color: var(--color-red-700); + } + /* NameFunction */ + .nf { + color: var(--color-blue-500); + } + /* NameFunctionMagic */ + .fm { + color: var(--color-blue-500); + } + /* NameLabel */ + .nl { + color: var(--color-yellow-700); + } + /* NameNamespace */ + .nn { + color: var(--color-black-main); + } + /* NameOther */ + .nx { + color: var(--color-black-main); + } + /* NameProperty */ + .py { + color: var(--color-black-main); + } + /* NameTag */ + .nt { + color: var(--color-blue-400); + } + /* NameVariable */ + .nv { + color: var(--color-black-main); + } + /* NameVariableClass */ + .vc { + color: var(--color-violet-600); + } + /* NameVariableGlobal */ + .vg { + color: var(--color-violet-600); + } + /* NameVariableInstance */ + .vi { + color: var(--color-violet-600); + } + /* NameVariableMagic */ + .vm { + color: var(--color-violet-600); + } + /* Literal */ + .l { + color: var(--color-black-main); + } + /* LiteralDate */ + .ld { + color: var(--color-black-main); + } + /* LiteralString */ + .s { + color: var(--color-black-main); + } + /* LiteralStringAffix */ + .sa { + color: var(--color-green-700); + } + /* LiteralStringBacktick */ + .sb { + color: var(--color-green-700); + } + /* LiteralStringChar */ + .sc { + color: var(--color-green-700); + } + /* LiteralStringDelimiter */ + .dl { + color: var(--color-green-700); + } + /* LiteralStringDoc */ + .sd { + color: #8f5902; + } + /* LiteralStringDouble */ + .s2 { + color: var(--color-green-700); + } + /* LiteralStringEscape */ + .se { + color: var(--color-black-main); + } + /* LiteralStringHeredoc */ + .sh { + color: var(--color-green-700); + } + /* LiteralStringInterpol */ + .si { + color: var(--color-green-700); + } + /* LiteralStringOther */ + .sx { + color: var(--color-green-700); + } + /* LiteralStringRegex */ + .sr { + color: var(--color-blue-500); + } + /* LiteralStringSingle */ + .s1 { + color: var(--color-green-700); + } + /* LiteralStringSymbol */ + .ss { + color: var(--color-green-700); + } + /* LiteralNumber */ + .m { + color: var(--color-blue-500); + } + /* LiteralNumberBin */ + .mb { + color: var(--color-blue-500); + } + /* LiteralNumberFloat */ + .mf { + color: var(--color-blue-500); + } + /* LiteralNumberHex */ + .mh { + color: var(--color-blue-500); + } + /* LiteralNumberInteger */ + .mi { + color: var(--color-blue-500); + } + /* LiteralNumberIntegerLong */ + .il { + color: var(--color-blue-500); + } + /* LiteralNumberOct */ + .mo { + color: var(--color-blue-500); + } + /* Operator */ + .o { + color: var(--color-blue-400); + } + /* OperatorWord */ + .ow { + color: var(--color-yellow-700); + } + /* Punctuation */ + .p { + color: var(--color-gray-400); + } + /* Comment */ + .c { + color: var(--color-gray-400); + } + /* CommentHashbang */ + .ch { + color: var(--color-gray-400); + } + /* CommentMultiline */ + .cm { + color: var(--color-gray-400); + } + /* CommentSingle */ + .c1 { + color: var(--color-gray-400); + } + /* CommentSpecial */ + .cs { + color: var(--color-gray-400); + } + /* CommentPreproc */ + .cp { + color: var(--color-gray-400); + } + /* CommentPreprocFile */ + .cpf { + color: var(--color-gray-400); + } + /* Generic */ + .g { + color: var(--color-black-main); + } + /* GenericDeleted */ + .gd { + color: var(--color-red-500); + } + /* GenericEmph */ + .ge { + color: var(--color-black-main); + } + /* GenericError */ + .gr { + color: var(--color-red-500); + } + /* GenericHeading */ + .gh { + color: var(--color-gray-600); + } + /* GenericInserted */ + .gi { + color: var(--color-green-500); + } + /* GenericOutput */ + .go { + color: var(--color-black-main); + } + /* GenericPrompt */ + .gp { + user-select: none; + color: var(--color-green-400); + } + /* GenericStrong */ + .gs { + color: var(--color-black-main); + } + /* GenericSubheading */ + .gu { + color: var(--color-gray-600); + } + /* GenericTraceback */ + .gt { + color: var(--color-red-500); + } + /* GenericUnderline */ + .gl { + color: var(--color-black-main); + text-decoration: underline; + } + /* TextWhitespace */ + .w { + color: var(--color-gray-100); } } diff --git a/assets/css/theme.css b/assets/css/theme.css new file mode 100644 index 000000000000..4d6ecf1c5dfa --- /dev/null +++ b/assets/css/theme.css @@ -0,0 +1,207 @@ +@theme inline { + --font-sans: "roboto flex", sans-serif; + --font-mono: "roboto flex mono", ui-monospace, SFMono-Regular, monospace; + --default-font-family: var(--font-sans); + + --text-xs: 0.7143rem; + --text-xs--letter-spacing: 0.015em; + --text-xs--font-weight: 500; + --text-sm: 0.851rem; + --text-base: 14px; + --text-lg: 1.1429rem; + --text-lg--line-height: 1.75; + --text-xl: 1.2857rem; + --text-xl--letter-spacing: -0.015em; + --text-xl--font-weight: 500; + --text-2xl: 1.5rem; + --text-2xl--letter-spacing: -0.015em; + --text-2xl--font-weight: 500; + --text-3xl: 2rem; + --text-3xl--font-weight: 500; + --text-4xl: 2.5rem; + --text-4xl--letter-spacing: -0.015em; + --text-4xl--font-weight: 500; + + --color-background-light: #f9f9fa; + --color-background-dark: #10151b; + --color-primary-blue: var(--color-blue); + + --color-divider-light: hsla(0, 0%, 0%, 0.1); + --color-divider-dark: hsla(0, 0%, 100%, 0.05); + + --card-bg-dark: #1d262d; + --card-border-dark: #516980; + --card-bg-dark: var(--color-gray-900); + --card-border-dark: var(--color-gray-700); + + --color-navbar-bg: var(--color-background-light); + --color-navbar-bg-dark: var(--color-background-dark); + --color-navbar-text: var(--color-gray-700); + --color-navbar-text-dark: var(--tw-prose-body); + --color-navbar-border-color-light: var(--tw-prose-inverse-body); + --navbar-font-size: 0.92rem; + --navbar-group-font-title-size: 1rem; + --color-navbar-text-dark: var(--color-gray-200); + --color-navbar-group-text-dark: var(--tw-prose-body); + + --color-blue: var(--color-blue-400); + --color-blue-100: rgba(217, 229, 252, 1); + --color-blue-200: rgba(170, 196, 248, 1); + --color-blue-300: rgba(123, 164, 244, 1); + --color-blue-400: rgba(75, 131, 241, 1); + --color-blue-50: rgba(246, 248, 254, 1); + --color-blue-500: rgba(37, 96, 255, 1); + --color-blue-600: rgba(13, 77, 242, 1); + --color-blue-700: rgba(0, 61, 181, 1); + --color-blue-800: rgba(0, 41, 120, 1); + --color-blue-900: rgba(0, 29, 86, 1); + --color-blue-950: rgba(0, 21, 60, 1); + --color-blue-focus: rgba(37, 96, 255, 0.24); + --color-blue-focusvisible: rgba(37, 96, 255, 0.32); + --color-blue-hover: rgba(37, 96, 255, 0.12); + --color-blue-outlinedborder: rgba(37, 96, 255, 0.56); + --color-blue-selected: rgba(37, 96, 255, 0.16); + + --color-gray: var(--color-gray-600); + --color-gray-100: rgba(231, 234, 239, 1); + --color-gray-200: rgba(200, 207, 218, 1); + --color-gray-300: rgba(169, 180, 198, 1); + --color-gray-400: rgba(139, 153, 178, 1); + --color-gray-50: rgba(249, 250, 251, 1); + --color-gray-500: rgba(108, 126, 157, 1); + --color-gray-600: rgba(86, 101, 129, 1); + --color-gray-700: rgba(67, 76, 95, 1); + --color-gray-800: rgba(44, 51, 63, 1); + --color-gray-900: rgba(30, 33, 41, 1); + --color-gray-950: rgb(18, 21, 31); + --color-gray-focus: rgba(108, 126, 157, 0.24); + --color-gray-focusvisible: rgba(108, 126, 157, 0.32); + --color-gray-hover: rgba(108, 126, 157, 0.12); + --color-gray-outlinedborder: rgba(108, 126, 157, 0.56); + --color-gray-selected: rgba(108, 126, 157, 0.16); + + --color-green-100: rgba(235, 249, 238, 1); + --color-green-200: rgba(208, 241, 215, 1); + --color-green-300: rgba(169, 229, 189, 1); + --color-green-400: rgba(129, 217, 162, 1); + --color-green-50: rgba(245, 252, 247, 1); + --color-green-500: rgba(90, 206, 140, 1); + --color-green-600: rgba(56, 189, 125, 1); + --color-green-700: rgba(45, 149, 104, 1); + --color-green-800: rgba(33, 110, 75, 1); + --color-green-900: rgba(23, 75, 50, 1); + --color-green-950: rgba(17, 55, 26, 1); + --color-green-focus: rgba(56, 189, 125, 0.24); + --color-green-focusvisible: rgba(56, 189, 125, 0.32); + --color-green-hover: rgba(56, 189, 125, 0.12); + --color-green-outlinedborder: rgba(56, 189, 125, 0.56); + --color-green-selected: rgba(56, 189, 125, 0.16); + + --color-orange-100: rgba(255, 233, 217, 1); + --color-orange-200: rgba(255, 216, 187, 1); + --color-orange-300: rgba(255, 196, 153, 1); + --color-orange-400: rgba(255, 169, 107, 1); + --color-orange-50: rgba(255, 249, 245, 1); + --color-orange-500: rgba(255, 135, 49, 1); + --color-orange-600: rgba(255, 107, 0, 1); + --color-orange-700: rgba(218, 92, 0, 1); + --color-orange-800: rgba(173, 72, 0, 1); + --color-orange-900: rgba(137, 58, 1, 1); + --color-orange-950: rgba(94, 40, 0, 1); + --color-orange-focus: rgba(255, 107, 0, 0.24); + --color-orange-focusvisible: rgba(255, 107, 0, 0.32); + --color-orange-hover: rgba(255, 107, 0, 0.12); + --color-orange-outlinedborder: rgba(255, 107, 0, 0.56); + --color-orange-selected: rgba(255, 107, 0, 0.16); + + --color-pink-100: rgba(255, 230, 251, 1); + --color-pink-200: rgba(255, 201, 246, 1); + --color-pink-300: rgba(255, 166, 240, 1); + --color-pink-400: rgba(252, 113, 220, 1); + --color-pink-50: rgba(255, 247, 254, 1); + --color-pink-500: rgba(237, 73, 199, 1); + --color-pink-600: rgba(201, 24, 171, 1); + --color-pink-700: rgba(171, 0, 137, 1); + --color-pink-800: rgba(131, 0, 105, 1); + --color-pink-900: rgba(109, 0, 81, 1); + --color-pink-950: rgba(85, 0, 51, 1); + --color-pink-focus: rgba(201, 24, 171, 0.24); + --color-pink-focusvisible: rgba(201, 24, 171, 0.32); + --color-pink-hover: rgba(201, 24, 171, 0.12); + --color-pink-outlinedborder: rgba(201, 24, 171, 0.56); + --color-pink-selected: rgba(201, 24, 171, 0.16); + + --color-red-100: rgba(255, 223, 223, 1); + --color-red-200: rgba(255, 194, 194, 1); + --color-red-300: rgba(255, 168, 168, 1); + --color-red-400: rgba(255, 117, 117, 1); + --color-red-50: rgba(255, 245, 245, 1); + --color-red-500: rgba(255, 87, 87, 1); + --color-red-600: rgba(244, 47, 57, 1); + --color-red-700: rgba(228, 12, 44, 1); + --color-red-800: rgba(179, 9, 9, 1); + --color-red-900: rgba(137, 0, 0, 1); + --color-red-950: rgba(110, 0, 0, 1); + --color-red-focus: rgba(244, 47, 57, 0.24); + --color-red-focusvisible: rgba(244, 47, 57, 0.32); + --color-red-hover: rgba(244, 47, 57, 0.12); + --color-red-outlinedborder: rgba(244, 47, 57, 0.56); + --color-red-selected: rgba(244, 47, 57, 0.16); + + --color-teal-100: rgba(223, 246, 246, 1); + --color-teal-200: rgba(195, 240, 241, 1); + --color-teal-300: rgba(160, 229, 232, 1); + --color-teal-400: rgba(106, 220, 222, 1); + --color-teal-50: rgba(243, 252, 252, 1); + --color-teal-500: rgba(47, 208, 210, 1); + --color-teal-600: rgba(27, 189, 191, 1); + --color-teal-700: rgba(44, 158, 160, 1); + --color-teal-800: rgba(24, 116, 115, 1); + --color-teal-900: rgba(18, 85, 85, 1); + --color-teal-950: rgba(9, 61, 61, 1); + --color-teal-focus: rgba(27, 189, 191, 0.24); + --color-teal-focusvisible: rgba(27, 189, 191, 0.32); + --color-teal-hover: rgba(27, 189, 191, 0.12); + --color-teal-outlinedborder: rgba(27, 189, 191, 0.56); + --color-teal-selected: rgba(27, 189, 191, 0.16); + + --color-violet: var(--color-violet-500); + --color-violet-100: rgba(239, 224, 255, 1); + --color-violet-200: rgba(211, 183, 255, 1); + --color-violet-300: rgba(174, 130, 255, 1); + --color-violet-400: rgba(152, 96, 255, 1); + --color-violet-50: rgba(252, 249, 255, 1); + --color-violet-500: rgba(125, 46, 255, 1); + --color-violet-600: rgba(109, 0, 235, 1); + --color-violet-700: rgba(87, 0, 187, 1); + --color-violet-800: rgba(69, 0, 147, 1); + --color-violet-900: rgba(55, 0, 118, 1); + --color-violet-950: rgba(37, 0, 80, 1); + --color-violet-focus: rgba(125, 46, 255, 0.24); + --color-violet-focusvisible: rgba(125, 46, 255, 0.32); + --color-violet-hover: rgba(125, 46, 255, 0.12); + --color-violet-outlinedborder: rgba(125, 46, 255, 0.56); + --color-violet-selected: rgba(125, 46, 255, 0.16); + + --color-white-main: rgba(255, 255, 255, 1); + --color-yellow-100: rgba(255, 245, 219, 1); + --color-yellow-200: rgba(255, 241, 204, 1); + --color-yellow-300: rgba(255, 232, 173, 1); + --color-yellow-400: rgba(255, 218, 122, 1); + --color-yellow-50: rgba(255, 251, 240, 1); + --color-yellow-500: rgba(255, 204, 72, 1); + --color-yellow-600: rgba(248, 182, 15, 1); + --color-yellow-700: rgba(235, 156, 0, 1); + --color-yellow-800: rgba(184, 110, 0, 1); + --color-yellow-900: rgba(133, 73, 0, 1); + --color-yellow-950: rgba(100, 55, 0, 1); + --color-yellow-focus: rgba(235, 156, 0, 0.24); + --color-yellow-focusvisible: rgba(235, 156, 0, 0.32); + --color-yellow-hover: rgba(235, 156, 0, 0.12); + --color-yellow-outlinedborder: rgba(235, 156, 0, 0.56); + --color-yellow-selected: rgba(235, 156, 0, 0.16); + + --topnav-button-bg: #4878f3; + --tw-prose-code-bg: var(--color-gray-100); + --tw-prose-code-bg-dark: var(--color-gray-800); +} diff --git a/assets/css/toc.css b/assets/css/toc.css deleted file mode 100644 index 91ff92d7cd99..000000000000 --- a/assets/css/toc.css +++ /dev/null @@ -1,14 +0,0 @@ -@layer components { - #TableOfContents { - .toc a { - @apply block max-w-full truncate py-1 pl-2 hover:font-medium hover:no-underline; - &[aria-current="true"], - &:hover { - @apply border-l-2 border-l-gray-light bg-gradient-to-r from-gray-light-100 font-medium text-black dark:border-l-gray-dark dark:from-gray-dark-200 dark:text-white; - } - &:not([aria-current="true"]) { - @apply text-gray-light-600 hover:text-black dark:text-gray-dark-700 dark:hover:text-white; - } - } - } -} diff --git a/assets/css/typography.css b/assets/css/typography.css deleted file mode 100644 index 008e7af70494..000000000000 --- a/assets/css/typography.css +++ /dev/null @@ -1,77 +0,0 @@ -@layer base { - - /* - * Font faces for Roboto Flex and Roboto Mono. - * - * - https://fonts.google.com/specimen/Roboto+Flex - * - https://fonts.google.com/specimen/Roboto+Mono - * - * The TTF fonts have been compressed to woff2, - * preserving the latin character subset. - * - * */ - - /* Roboto Flex */ - @font-face { - font-family: 'Roboto Flex'; - src: url('/assets/fonts/RobotoFlex.woff2') format('woff2'); - font-weight: 100 1000; /* Range of weights Roboto Flex supports */ - font-stretch: 100%; /* Range of width Roboto Flex supports */ - font-style: oblique 0deg 10deg; /* Range of oblique angle Roboto Flex supports */ - font-display: fallback; - } - - /* Roboto Mono */ - @font-face { - font-family: 'Roboto Mono'; - src: url('/assets/fonts/RobotoMono-Regular.woff2') format('woff2'); - font-weight: 100 700; /* Define the range of weight the variable font supports */ - font-style: normal; - font-display: fallback; - } - - /* Roboto Mono Italic */ - @font-face { - font-family: 'Roboto Mono'; - src: url('/assets/fonts/RobotoMono-Italic.woff2') format('woff2'); - font-weight: 100 700; /* Define the range of weight the variable font supports */ - font-style: italic; - font-display: fallback; - } - - .prose { - li { - @apply my-2; - > :last-child, - > :first-child { - margin: 0; - } - } - a { - font-weight: 400; - } - hr { - @apply mb-4 mt-8; - } - h1 { - @apply my-4 text-4xl; - line-height: 1.167; - } - h2 { - @apply mb-4 mt-8 text-3xl; - line-height: 1.2; - } - h3 { - @apply text-2xl; - line-height: 1.167; - } - h4 { - @apply text-xl; - line-height: 1.235; - } - h5 { - @apply text-lg; - line-height: 1.75; - } - } -} diff --git a/assets/css/utilities.css b/assets/css/utilities.css new file mode 100644 index 000000000000..819af1bf9880 --- /dev/null +++ b/assets/css/utilities.css @@ -0,0 +1,367 @@ +@utility icon-xs { + svg { + font-size: 12px; + } +} + +@utility icon-sm { + svg { + font-size: 16px; + } +} + +@utility icon-md { + svg { + font-size: 24px; + } +} + +@utility icon-lg { + svg { + font-size: 32px; + } +} + +@utility text-primary-blue { + color: var(--color-primary-blue); +} + +@utility link { + @apply text-blue no-underline dark:text-blue-400; + font-weight: inherit; + &:hover { + @apply underline underline-offset-3; + } +} + +@utility invertible { + @apply dark:hue-rotate-180 dark:invert dark:filter; +} + +@utility bg-background-toc { + background-color: var(--color-navbar-bg); + .dark & { + background-color: var(--color-navbar-bg-dark); + } +} + +@utility icon-svg { + svg { + font-size: 24px; + width: 1em; + height: 1em; + display: inline-block; + fill: currentColor; + } +} + +@utility icon-xs { + svg { + font-size: 12px; + } +} + +@utility icon-sm { + svg { + font-size: 16px; + } +} + +@utility icon-lg { + svg { + font-size: 32px; + } +} + +@utility navbar-font { + font-size: var(--navbar-font-size); + color: var(--color-navbar-text); + .dark & { + color: var(--color-navbar-text-dark); + } +} + +@utility navbar-entry-margin { + @apply px-2 py-1; +} + +@utility navbar-group { + @apply mt-5; +} + +@utility navbar-entry-background-current { + @apply bg-gray-100 dark:bg-gray-900; +} +@utility navbar-group-font-title { + font-size: var(--color-navbar-group-font-title-size); + @apply pb-1.5 font-semibold uppercase; + color: var(--color-navbar-text); + .dark & { + color: var(--color-navbar-text-dark); + } +} + +@utility prose { + table:not(.lntable) code { + overflow-wrap: unset; + white-space: nowrap; + } + + /* code in `inline code` style */ + :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)), + a > code { + font-size: 0.875em; + font-weight: 400 !important; + border: 1px solid !important; + border-radius: 0.25rem; + border: none !important; + padding: 4px !important; + background: var(--tw-prose-code-bg) !important; + .dark & { + background: var(--tw-prose-code-bg-dark) !important; + } + &::before, + &::after { + content: none !important; + } + } + + /* code blocks with unrecognized languages*/ + pre:not(.chroma) { + @apply overflow-x-auto p-3; + background: var(--tw-prose-code-bg); + color: var(--color-gray-700); + .dark & { + background: var(--tw-prose-code-bg-dark); + color: var(--color-gray-200); + } + } + + .highlight { + @apply my-0 overflow-x-auto p-2; + + /* LineTableTD */ + .lntd { + vertical-align: top; + padding: 0; + margin: 0; + font-weight: 400; + padding: 0 4px; + &:first-child { + width: 0; + } + } + + /* LineTableTD */ + .lntd { + vertical-align: top; + padding: 0; + margin: 0; + border: 0; + } + /* LineTable */ + .lntable { + display: table; + width: 100%; + border-spacing: 0; + padding: 0; + margin: 0; + border: 0; + /* LineNumberColumnHighlight */ + .lntd:first-child .hl { + display: block; + } + } + } +} + +@utility section-card { + @apply flex h-full flex-col gap-2 rounded-sm border p-4 drop-shadow-xs hover:drop-shadow-lg; + @apply text-gray dark:text-gray-200; + @apply border-gray-100 bg-gray-50 hover:border-gray-200 dark:border-gray-600 dark:bg-gray-900 hover:dark:border-gray-500; +} + +@utility section-card-text { + @apply leading-snug text-gray-800 dark:text-gray-200; +} +@utility section-card-title { + @apply text-xl font-semibold text-gray-900 dark:text-gray-100; +} + +@utility sub-button { + @apply flex w-full items-center gap-2 rounded-sm px-2 py-2 text-left text-gray-600 transition-colors hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-800; +} + +@utility dropdown-base { + @apply rounded-sm border border-gray-300 bg-white text-gray-600 dark:border-gray-300 dark:bg-gray-900 dark:text-gray-100; +} + +@utility toc { + a { + @apply block max-w-full truncate py-1 pl-2 hover:font-medium hover:no-underline; + &[aria-current="true"], + &:hover { + @apply border-l-2 border-x-gray-200 bg-gradient-to-r from-gray-50 font-medium text-black dark:border-l-gray-300 dark:from-gray-900 dark:text-white; + } + &:not([aria-current="true"]) { + @apply text-gray-600 hover:text-black dark:text-gray-100 dark:hover:text-white; + } + } +} +@utility scrollbar-hover { + /* Firefox: hide the thumb until hover */ + scrollbar-width: thin; + scrollbar-color: transparent transparent; + &:hover { + scrollbar-color: var(--color-gray-400) transparent; + } + .dark &:hover { + scrollbar-color: var(--color-gray-600) transparent; + } + /* WebKit: reserve the track, reveal the thumb only on hover */ + &::-webkit-scrollbar { + width: 8px; + height: 8px; + } + &::-webkit-scrollbar-thumb { + border-radius: 9999px; + background-color: transparent; + } + &:hover::-webkit-scrollbar-thumb { + background-color: var(--color-gray-400); + } + .dark &:hover::-webkit-scrollbar-thumb { + background-color: var(--color-gray-600); + } +} + +@utility chip { + @apply border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-800 select-none dark:bg-gray-700 dark:text-gray-200; +} + +@utility pagination-link { + @apply flex items-center justify-center rounded-sm p-2; +} + +@utility breadcrumbs { + /* Absolute size so breadcrumbs render identically inside and outside prose */ + font-size: calc(var(--text-base) * 0.9); +} + +/* Guides landing: collapse section spacing into a flat list while filtering. + Grouped spacing is the static default; this only applies once the page is + being filtered, so it never affects first paint (no layout jank). */ +.guides-flat > section { + border-top-width: 0 !important; + padding-top: 0 !important; + padding-bottom: 0 !important; +} + +@utility topbar-button { + @apply min-h-10 max-w-40 rounded-md border-1 border-blue-300 bg-(--topnav-button-bg) px-2 text-center font-semibold text-white; + @apply inline-flex items-center justify-center gap-1.5 transition-colors hover:border-blue-300 hover:bg-blue-400; + svg { + font-size: 19px; + } +} +@utility topbar-button-clear { + @apply min-h-9 px-0 text-center font-semibold text-white/95 transition-colors hover:text-white/85; + svg { + font-size: 19px; + } +} + +.footer { + @apply ml-auto hidden flex-row justify-between gap-6 px-4 pt-6 pb-2 md:flex; + @apply border-t border-gray-200 bg-gray-100 dark:border-gray-700 dark:bg-gray-900; + @apply text-gray-600 dark:text-gray-400; + a:hover { + @apply underline underline-offset-4; + } +} + +.social { + @apply flex min-w-20 flex-wrap items-center gap-1; +} + +.links { + @apply flex items-center gap-3; +} + +.links a { + @apply inline-flex min-w-15 truncate whitespace-normal; +} + +.secondaryLinks { + @apply flex items-center; + a, + button { + @apply whitespace-normal md:truncate; + } +} + +.secondaryLinks > *:not(:last-child)::after { + content: "|"; + @apply mx-1 text-gray-400; +} + +.ot-sdk-show-settings { + @apply !text-gray-600 hover:!text-gray-800 dark:!text-gray-400 dark:hover:!text-gray-200; + @apply !m-0 !min-w-15 !truncate !border-none !p-0 !text-sm; +} +#ot-sdk-btn.ot-sdk-show-settings:hover, +#ot-sdk-btn.optanon-show-settings:hover { + @apply !text-gray-600 underline decoration-1 underline-offset-4 hover:!bg-transparent dark:!text-gray-400; +} + +@keyframes reflection { + 0% { + transform: translateX(-100%); + } + 18% { + transform: translateX(100%); + } + 100% { + transform: translateX(100%); + } +} + +@utility shimmer { + position: relative; + overflow: hidden; + + & > * { + position: relative; + z-index: 2; + } + + &::after { + content: ''; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient( + 110deg, + transparent 0%, + transparent 43%, + rgba(123, 164, 244, 0.25) 49%, + rgba(170, 196, 248, 0.45) 50%, + rgba(123, 164, 244, 0.25) 51%, + transparent 57%, + transparent 100% + ); + transform: translateX(-100%); + pointer-events: none; + z-index: 1; + + @media (prefers-reduced-motion: no-preference) { + animation: reflection 3s ease-in-out 3s forwards; + } + } + + &:hover { + @apply bg-blue-800 border-blue-400; + } +} diff --git a/assets/favicons/docs.ico b/assets/favicons/docs.ico deleted file mode 100644 index 7925783d50cd..000000000000 Binary files a/assets/favicons/docs.ico and /dev/null differ diff --git a/assets/favicons/docs@2x.ico b/assets/favicons/docs@2x.ico deleted file mode 100644 index 523925f7bd7c..000000000000 Binary files a/assets/favicons/docs@2x.ico and /dev/null differ diff --git a/assets/icons/AppleMac.svg b/assets/icons/AppleMac.svg new file mode 100644 index 000000000000..b218d8cdcafd --- /dev/null +++ b/assets/icons/AppleMac.svg @@ -0,0 +1,8 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="blue" xmlns="http://www.w3.org/2000/svg"> +<mask id="mask0_26_122" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"> +<path d="M17.9549 21.7542C16.8041 22.871 15.5344 22.6969 14.3241 22.1703C13.0373 21.6331 11.861 21.5991 10.5021 22.1703C8.80981 22.9007 7.91165 22.6884 6.89246 21.7542C1.13826 15.8301 1.98759 6.80604 8.52741 6.46631C10.1135 6.55125 11.224 7.34324 12.1583 7.40906C13.5469 7.12666 14.8761 6.31768 16.3625 6.42385C18.1482 6.56823 19.4837 7.27317 20.3755 8.54079C16.7022 10.749 17.5728 15.5902 20.9467 16.9491C20.2715 18.7221 19.4052 20.4738 17.9528 21.769L17.9549 21.7542ZM12.0309 6.40261C11.8589 3.76971 13.9928 1.60393 16.4474 1.3916C16.785 4.42794 13.6871 6.69988 12.0309 6.40261Z" fill="currentColor"/> +</mask> +<g mask="url(#mask0_26_122)"> +<rect width="24" height="24" fill="currentColor" fill-opacity="0.9"/> +</g> +</svg> diff --git a/static/assets/icons/Compose.svg b/assets/icons/Compose.svg similarity index 100% rename from static/assets/icons/Compose.svg rename to assets/icons/Compose.svg diff --git a/assets/icons/Linux.svg b/assets/icons/Linux.svg new file mode 100644 index 000000000000..55554f63b637 --- /dev/null +++ b/assets/icons/Linux.svg @@ -0,0 +1,8 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<mask id="mask0_26_113" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="3" y="1" width="18" height="22"> +<path d="M19.0689 16.3388C19.2698 16.4219 19.443 16.5636 19.5674 16.7466C19.6791 16.9182 19.7575 17.1255 19.8067 17.3685C19.8333 17.5113 19.8652 17.6431 19.8998 17.7667C19.9649 17.9982 20.0631 18.2185 20.1909 18.4202C20.2534 18.5204 20.3372 18.6303 20.4409 18.7525C20.53 18.8527 20.6097 18.9817 20.6802 19.1383C20.7451 19.2791 20.7801 19.4326 20.7826 19.5886C20.7877 19.7385 20.7442 19.8859 20.6589 20.0074C20.5722 20.1253 20.4665 20.227 20.3465 20.308C20.187 20.422 20.0208 20.5222 19.8479 20.6087C19.6751 20.6938 19.5023 20.7831 19.3295 20.8764C19.071 21.0036 18.8241 21.1543 18.5916 21.3268C18.3842 21.4847 18.1755 21.6837 17.9681 21.9281C17.7263 22.2078 17.4464 22.4497 17.1372 22.6462C16.9793 22.7497 16.8078 22.8292 16.628 22.8823C16.4552 22.9318 16.2824 22.9647 16.1095 22.9785C15.708 22.9785 15.3757 22.9071 15.1124 22.7643C14.8492 22.6215 14.6205 22.3606 14.4264 21.9817C14.3706 21.8732 14.3161 21.8059 14.2603 21.7771C14.174 21.7394 14.0833 21.714 13.9904 21.7016L12.9388 21.6165C12.5931 21.589 12.2408 21.5739 11.8805 21.5739C11.5813 21.5743 11.2826 21.5991 10.9872 21.648C10.6827 21.6988 10.3809 21.7593 10.0831 21.8307C10.022 21.8444 9.95949 21.8993 9.897 21.9913C9.81921 22.1029 9.73201 22.2072 9.63643 22.303C9.50692 22.4303 9.35599 22.5322 9.19106 22.6036C8.95605 22.6984 8.70552 22.7455 8.45322 22.7423C8.22455 22.7423 7.97861 22.7176 7.71537 22.6682C7.46911 22.6239 7.23097 22.5406 7.00944 22.421C6.6098 22.2099 6.18325 22.0583 5.74247 21.9707C5.32635 21.8924 4.88763 21.8197 4.42365 21.7565C4.26987 21.7358 4.11722 21.707 3.96632 21.67C3.82692 21.6375 3.69562 21.5753 3.58078 21.4874C3.4754 21.4069 3.38753 21.3045 3.32287 21.1867C3.25197 21.0367 3.21601 20.8717 3.21784 20.7048C3.21784 20.4824 3.24576 20.2682 3.3016 20.0609C3.35743 19.855 3.38801 19.6353 3.39466 19.4074C3.39466 19.2495 3.38402 19.0957 3.36408 18.9461C3.34209 18.7858 3.32789 18.6245 3.32154 18.4628C3.32154 18.0989 3.40529 17.8312 3.57147 17.6582C3.73766 17.4866 3.97962 17.3507 4.29868 17.2504C4.44043 17.2061 4.57392 17.1374 4.69353 17.0472C4.80325 16.9618 4.90719 16.8686 5.00462 16.7685C5.10354 16.6659 5.19383 16.5547 5.2745 16.4363C5.35826 16.3141 5.45132 16.1919 5.55502 16.0711C5.5757 16.0436 5.58693 16.0098 5.58692 15.975C5.58692 15.8885 5.58293 15.8061 5.57629 15.7278L5.55502 15.4697C5.55502 14.9837 5.62814 14.4949 5.77305 14.0006C5.91928 13.5064 6.1094 13.0258 6.34471 12.5521C6.57966 12.0813 6.84342 11.6264 7.1344 11.1902C7.42422 10.7549 7.71271 10.3499 7.99589 9.97783C8.38052 9.48054 8.68572 8.92294 8.89991 8.32616C9.09933 7.755 9.20436 7.13167 9.21101 6.45892C9.21101 6.17472 9.19771 5.89189 9.16979 5.61317C9.1419 5.32805 9.12814 5.04164 9.12858 4.75507C9.12858 4.18254 9.19106 3.66768 9.3147 3.21048C9.43967 2.75191 9.63377 2.35924 9.897 2.02973C10.1602 1.70022 10.5032 1.45446 10.9247 1.2897C11.3488 1.12495 11.854 1.0357 12.4416 1.02197C13.1422 1.02197 13.6992 1.16476 14.1154 1.45171C14.5301 1.73729 14.8492 2.11211 15.0699 2.57754C15.2919 3.04161 15.4342 3.56059 15.4953 4.13311C15.5591 4.70427 15.5937 5.28366 15.6003 5.86992V6.05252C15.6003 6.34634 15.603 6.6072 15.611 6.83511C15.6234 7.29848 15.7255 7.75459 15.9114 8.1765C16.0085 8.39755 16.1534 8.63782 16.3475 8.89456C16.6799 9.34627 17.0202 9.80072 17.3659 10.2579C17.7115 10.7151 18.0266 11.1874 18.3098 11.6721C18.5943 12.1595 18.8269 12.6675 19.0064 13.1961C19.1872 13.726 19.2803 14.2972 19.2869 14.9123C19.2887 15.3972 19.2151 15.8779 19.0689 16.3388ZM10.3557 5.16284C10.4514 5.16284 10.5312 5.18755 10.595 5.23698C10.6598 5.29087 10.7098 5.36142 10.7399 5.44155C10.7732 5.52401 10.7973 5.61016 10.8117 5.6983C10.825 5.78479 10.8329 5.87404 10.8329 5.9674C10.8351 6.02637 10.8242 6.08507 10.801 6.13902C10.7783 6.1846 10.7466 6.22481 10.708 6.25709L10.583 6.36419C10.5384 6.40315 10.4971 6.44586 10.4594 6.49187C10.4095 6.57203 10.3415 6.63847 10.2613 6.68546C10.1789 6.73482 10.0991 6.78843 10.022 6.8461C9.94833 6.90128 9.87898 6.96233 9.81458 7.0287C9.78239 7.06454 9.75755 7.10673 9.74155 7.15274C9.72556 7.19875 9.71874 7.24763 9.72152 7.29643C9.72152 7.36096 9.75209 7.4145 9.81458 7.45707C9.9696 7.5579 10.0926 7.7035 10.1682 7.87582C10.2373 8.04058 10.3145 8.20121 10.3969 8.35911C10.4793 8.51562 10.587 8.64743 10.7186 8.75589C10.8502 8.86298 11.055 8.91653 11.3302 8.91653H11.394C11.6705 8.9028 11.9337 8.82729 12.1837 8.69136C12.4323 8.55544 12.6822 8.41265 12.9308 8.26163C12.9741 8.23648 13.0195 8.21535 13.0664 8.19847C13.1147 8.18068 13.16 8.1552 13.2007 8.12296L13.9585 7.51199C13.9717 7.46596 13.9823 7.41921 13.9904 7.37194C13.9985 7.32175 14.0056 7.2714 14.0117 7.22092C14.014 7.15266 13.9954 7.08538 13.9585 7.0287C13.9245 6.9789 13.8827 6.93528 13.8348 6.89964C13.7817 6.86222 13.7214 6.83694 13.658 6.8255C13.5947 6.81237 13.5324 6.794 13.4719 6.77058C13.3062 6.7354 13.1478 6.67034 13.0039 6.57837C12.8611 6.48678 12.7074 6.41478 12.5466 6.36419C12.52 6.35595 12.4987 6.33535 12.4841 6.29966C12.4683 6.25738 12.4545 6.2143 12.4429 6.1706C12.4292 6.12533 12.4256 6.07747 12.4323 6.03055C12.4398 5.9946 12.4361 5.95708 12.4216 5.92346C12.4216 5.83834 12.4283 5.7491 12.4429 5.65573C12.4573 5.56122 12.4888 5.47037 12.536 5.38801C12.5765 5.31173 12.6333 5.24599 12.7021 5.19579C12.7841 5.14639 12.8771 5.11989 12.972 5.1189C13.1874 5.1189 13.3429 5.20128 13.44 5.36604C13.537 5.5308 13.5889 5.70928 13.5955 5.9015C13.5973 5.98693 13.5795 6.07159 13.5437 6.14863C13.5082 6.22192 13.49 6.30284 13.4905 6.38478C13.4905 6.44244 13.5091 6.48089 13.5437 6.50286C13.5856 6.52656 13.6317 6.54105 13.6793 6.54542C13.8388 6.54542 13.9412 6.50697 13.9904 6.42872C14.0463 6.3197 14.0747 6.19785 14.0728 6.07449C14.0728 5.90973 14.0595 5.72713 14.0329 5.52668C14.0066 5.33274 13.95 5.14449 13.8654 4.96925C13.7879 4.80468 13.6784 4.65838 13.5437 4.53951C13.3994 4.42114 13.2186 4.36067 13.0345 4.36927C12.6756 4.36927 12.415 4.46125 12.2554 4.64798C12.0959 4.83333 12.0135 5.11204 12.0068 5.48411C12.0068 5.59121 12.0135 5.6983 12.0268 5.80539C12.0401 5.91385 12.0481 6.02094 12.0481 6.12804C12.0481 6.16373 12.0441 6.18158 12.0374 6.18158C12.0159 6.17674 11.9949 6.16937 11.9749 6.15961C11.9335 6.14227 11.8923 6.12442 11.8513 6.10607C11.8005 6.08391 11.748 6.066 11.6944 6.05252C11.6061 6.03035 11.5143 6.02662 11.4245 6.04154C11.3694 6.04876 11.3139 6.05243 11.2584 6.05252C11.1613 6.05252 11.1121 6.03467 11.1121 5.99898C11.1121 5.89189 11.1068 5.75596 11.0922 5.59121C11.0789 5.42645 11.0443 5.26169 10.9885 5.09694C10.9421 4.95035 10.8719 4.81294 10.7811 4.69054C10.6973 4.58345 10.5737 4.52578 10.4075 4.51892C10.2959 4.51626 10.1876 4.55861 10.1057 4.63699C10.0204 4.71853 9.94695 4.81241 9.8877 4.91571C9.82399 5.02725 9.78495 5.15196 9.77336 5.28091C9.76221 5.39564 9.74847 5.51009 9.73215 5.62416C9.73749 5.81358 9.76882 6.00125 9.82521 6.18158C9.85978 6.29554 9.89833 6.39576 9.93955 6.48226C9.98076 6.56738 10.0299 6.60995 10.0858 6.60995C10.119 6.60995 10.1656 6.58523 10.2201 6.53581C10.2759 6.48501 10.3038 6.4397 10.3038 6.39576C10.3038 6.3738 10.2932 6.36007 10.2719 6.3532C10.2518 6.34605 10.2307 6.34234 10.2094 6.34222C10.1616 6.34222 10.119 6.3175 10.0845 6.2667C10.0488 6.21407 10.021 6.15622 10.002 6.09508C9.98021 6.02768 9.95938 5.95994 9.93955 5.89189C9.89814 5.70664 9.92417 5.51215 10.0127 5.34544C10.0751 5.23012 10.1895 5.1697 10.3557 5.16284ZM8.09028 21.8636C8.25646 21.8636 8.41998 21.8499 8.57952 21.8197C8.73745 21.7916 8.88893 21.7334 9.02621 21.648C9.15786 21.5694 9.2656 21.4543 9.3373 21.3158C9.41294 21.1549 9.45549 20.9796 9.46227 20.8009C9.46228 20.6732 9.44115 20.5465 9.39979 20.4261C9.35755 20.3033 9.29797 20.1877 9.22297 20.0829C9.14092 19.9486 9.05078 19.8197 8.95309 19.6971C8.85536 19.574 8.76522 19.4447 8.68321 19.3099C8.55392 19.1136 8.4254 18.9169 8.29767 18.7195C8.17403 18.5273 8.04907 18.3241 7.92543 18.1085C7.81611 17.9259 7.71193 17.74 7.61301 17.5511C7.51136 17.3583 7.39299 17.1754 7.25937 17.0047C7.17499 16.8959 7.07761 16.7985 6.96955 16.715C6.85854 16.6288 6.72285 16.5834 6.58401 16.5859C6.43917 16.5837 6.29878 16.6376 6.19049 16.7369C6.06673 16.8483 5.95201 16.97 5.84749 17.1008C5.72491 17.2492 5.59301 17.389 5.45265 17.5195C5.30641 17.6555 5.12029 17.7626 4.89162 17.8408C4.73688 17.8837 4.59453 17.9647 4.47683 18.077C4.37978 18.1772 4.33059 18.331 4.33059 18.5383C4.33059 18.6811 4.34123 18.8239 4.3625 18.9666C4.38244 19.1094 4.39706 19.2536 4.40371 19.3964C4.40371 19.5886 4.37712 19.7712 4.31996 19.9428C4.26633 20.1051 4.23849 20.2752 4.23753 20.4467C4.23753 20.6403 4.304 20.7762 4.43429 20.8545C4.56723 20.9341 4.7148 20.9877 4.88098 21.0151C5.08971 21.0522 5.28647 21.0796 5.47392 21.1016C5.66004 21.1236 5.84351 21.1565 6.02431 21.1977C6.20379 21.2417 6.38326 21.287 6.56407 21.3378C6.74354 21.3872 6.93499 21.4668 7.13573 21.5739C7.17562 21.5945 7.23943 21.6206 7.32186 21.648L7.60237 21.7442C7.70607 21.7812 7.80312 21.8101 7.89352 21.8307C7.95786 21.8485 8.02378 21.8595 8.09028 21.8636ZM11.8925 20.5758C12.0866 20.5758 12.294 20.5552 12.516 20.5112C12.968 20.4238 13.4052 20.2683 13.8136 20.0499C14.0037 19.9498 14.1844 19.8317 14.3533 19.6971C14.3701 19.6775 14.3844 19.6558 14.3959 19.6325C14.4091 19.605 14.4194 19.5759 14.4264 19.546V19.5351C14.4677 19.3785 14.5022 19.2055 14.5301 19.0202C14.5589 18.8314 14.5833 18.6418 14.6033 18.4518C14.6234 18.2618 14.6477 18.0722 14.6764 17.8834C14.703 17.698 14.7282 17.5154 14.7482 17.3369C14.7761 17.1447 14.8107 16.958 14.8519 16.7795C14.8944 16.601 14.9489 16.4322 15.018 16.2743C15.0864 16.1188 15.1814 15.9774 15.2986 15.8569C15.4349 15.7212 15.5888 15.6057 15.7559 15.5136V15.4917L15.7453 15.4601C15.7476 15.3873 15.7692 15.3165 15.8077 15.2555C15.8543 15.1767 15.9063 15.1015 15.9633 15.0304C16.0186 14.9581 16.0857 14.8964 16.1614 14.8477C16.2306 14.8049 16.3036 14.769 16.3794 14.7407C16.3375 14.5681 16.2923 14.3965 16.2438 14.2258C16.1957 14.0559 16.154 13.8842 16.1188 13.7109C16.0848 13.4917 16.0436 13.2737 15.9952 13.0574C15.9567 12.8896 15.9078 12.7245 15.849 12.5631C15.7894 12.4059 15.7089 12.258 15.6097 12.1238C15.5073 11.981 15.3783 11.808 15.2268 11.6089C15.1689 11.5421 15.1164 11.4705 15.0699 11.3947C15.0338 11.3096 15.0131 11.2184 15.0087 11.1256C14.9922 11.0318 14.9713 10.9388 14.9463 10.8469C14.8529 10.4992 14.7455 10.1557 14.6245 9.8172C14.5607 9.63646 14.4842 9.46072 14.3959 9.29135C14.3252 9.15573 14.249 9.02334 14.1672 8.89456C14.0981 8.78747 14.0249 8.73393 13.9492 8.73393C13.783 8.73393 13.5849 8.80257 13.3562 8.9385C13.1289 9.07442 12.8856 9.22408 12.6304 9.38883C12.3738 9.55359 12.1252 9.70736 11.8819 9.85015C11.6399 9.99294 11.4219 10.0602 11.2278 10.0533C11.0206 10.0532 10.8195 9.9817 10.6561 9.85015C10.4801 9.71161 10.3195 9.55319 10.1775 9.37785C10.0326 9.19936 9.91163 9.04559 9.81458 8.91653C9.71753 8.78747 9.64574 8.71608 9.59655 8.70235C9.54204 8.70235 9.51013 8.74491 9.50349 8.83003C9.49608 8.92641 9.49254 9.02305 9.49285 9.11973V9.30233C9.49285 9.34627 9.4862 9.37373 9.47158 9.38883C9.3958 9.55359 9.31205 9.71422 9.22297 9.87074C9.13257 10.0286 9.0435 10.1893 8.95309 10.354C8.77401 10.6706 8.67396 11.0283 8.66194 11.3947C8.66194 11.5018 8.66859 11.6089 8.68321 11.716C8.69651 11.8231 8.73107 11.9274 8.78691 12.0277L8.76564 12.0689C8.71227 12.1454 8.65314 12.2175 8.58882 12.2844C8.52332 12.3533 8.46454 12.4288 8.41334 12.5096C8.15904 12.8975 7.97566 13.3303 7.87225 13.7864C7.76855 14.2436 7.71271 14.7091 7.70607 15.18C7.70607 15.3022 7.71404 15.4244 7.72734 15.5452C7.74063 15.6674 7.74861 15.7882 7.74861 15.9104C7.7482 15.95 7.74465 15.9895 7.73797 16.0285C7.73129 16.0675 7.72774 16.107 7.72734 16.1466C7.87512 16.1638 8.01729 16.2149 8.14346 16.2962C8.30299 16.3896 8.47582 16.5077 8.66194 16.6505C8.84807 16.7932 9.02621 16.958 9.19239 17.1447C9.35858 17.3301 9.51678 17.5113 9.66967 17.6912C9.82255 17.8696 9.9329 18.0481 10.002 18.2266C10.0712 18.4051 10.1164 18.552 10.1363 18.666C10.1399 18.749 10.127 18.8319 10.0984 18.9095C10.0698 18.9872 10.0262 19.0581 9.97012 19.1177C9.8509 19.2378 9.70996 19.3325 9.55533 19.3964C9.67366 19.6106 9.81857 19.7932 9.99139 19.9428C10.1642 20.0939 10.3517 20.2147 10.5524 20.308C10.7532 20.4014 10.9712 20.4687 11.2065 20.5112C11.4418 20.5552 11.6718 20.5758 11.8925 20.5758ZM16.0577 22.0998C16.2026 22.0998 16.3448 22.0778 16.4831 22.0352C16.6926 21.9732 16.892 21.8793 17.0747 21.7565C17.2555 21.6343 17.4204 21.4847 17.5733 21.3048C17.9344 20.8745 18.3763 20.5242 18.8721 20.2751L19.2151 20.1144C19.3328 20.0615 19.4469 20.0005 19.5568 19.9318C19.6361 19.8799 19.7097 19.8192 19.7762 19.7506C19.8096 19.7172 19.8361 19.677 19.8539 19.6327C19.8717 19.5883 19.8806 19.5406 19.8799 19.4925C19.8799 19.4373 19.8691 19.3826 19.8479 19.3319C19.8231 19.2747 19.7919 19.2208 19.7549 19.1712C19.6601 19.035 19.5701 18.8953 19.485 18.7525C19.408 18.6225 19.3418 18.4861 19.2869 18.3447L19.1207 17.9163C19.0608 17.7591 19.0119 17.5976 18.9745 17.433C18.9601 17.3822 18.9356 17.335 18.9027 17.2944C18.8359 17.1912 18.7446 17.1074 18.6376 17.0509C18.5305 16.9944 18.4113 16.9672 18.2912 16.9717C18.1672 16.9713 18.0452 17.0044 17.9375 17.0678L17.5839 17.2724C17.4608 17.3429 17.3362 17.4107 17.2103 17.4756C17.0878 17.5392 16.9526 17.5722 16.8155 17.5717C16.6929 17.5772 16.5721 17.54 16.4725 17.466C16.3769 17.3876 16.2989 17.2888 16.2438 17.1763C16.1847 17.0618 16.1327 16.9434 16.0883 16.8221L15.9633 16.4678C15.9091 16.5597 15.8468 16.6461 15.7772 16.726C15.706 16.8078 15.6497 16.9022 15.611 17.0047C15.5206 17.2189 15.4647 17.4578 15.4448 17.7227C15.4102 18.1374 15.365 18.541 15.3092 18.9351C15.2523 19.3368 15.1588 19.7322 15.03 20.1158C14.9933 20.2385 14.9653 20.3638 14.9463 20.4906C14.9256 20.6221 14.9114 20.7545 14.9037 20.8874C14.9037 21.2375 15.0087 21.5272 15.2161 21.7565C15.4235 21.9844 15.704 22.0998 16.0577 22.0998Z" fill="currentColor"/> +</mask> +<g mask="url(#mask0_26_113)"> +<rect width="24" height="24" fill="currentColor" fill-opacity="0.9"/> +</g> +</svg> diff --git a/static/assets/icons/Scout.svg b/assets/icons/Scout.svg similarity index 100% rename from static/assets/icons/Scout.svg rename to assets/icons/Scout.svg diff --git a/static/assets/icons/Testcontainers.svg b/assets/icons/Testcontainers.svg similarity index 100% rename from static/assets/icons/Testcontainers.svg rename to assets/icons/Testcontainers.svg diff --git a/static/assets/icons/Whale.svg b/assets/icons/Whale.svg similarity index 100% rename from static/assets/icons/Whale.svg rename to assets/icons/Whale.svg diff --git a/assets/icons/Windows.svg b/assets/icons/Windows.svg new file mode 100644 index 000000000000..7244da36d971 --- /dev/null +++ b/assets/icons/Windows.svg @@ -0,0 +1,8 @@ +<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> +<mask id="mask0_26_117" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"> +<path d="M2.8584 11.5731H10.2447V4.31147L2.8584 5.34754V11.5731ZM2.8584 18.6499L10.2447 19.682V12.503H2.8584V18.6499ZM11.0617 4.19737V11.5731H20.89V2.82031L11.0591 4.19737H11.0617ZM11.0617 19.7961L20.89 21.1732V12.5043H11.0591V19.7961H11.0617Z" fill="currentColor"/> +</mask> +<g mask="url(#mask0_26_117)"> +<rect width="24" height="24" fill="currentColor" fill-opacity="0.9"/> +</g> +</svg> diff --git a/assets/icons/cagent.svg b/assets/icons/cagent.svg new file mode 100644 index 000000000000..669a0e7b3fb7 --- /dev/null +++ b/assets/icons/cagent.svg @@ -0,0 +1,14 @@ +<svg width="825" height="824" viewBox="0 0 825 824" fill="none" xmlns="http://www.w3.org/2000/svg"> +<rect x="0.883789" width="824" height="824" rx="158" fill="#080B0F"/> +<mask id="path-2-inside-1_52_117" fill="white"> +<path d="M277.566 426.88C338.755 427.655 388.119 477.498 388.119 538.871L388.11 540.318C387.335 601.507 337.492 650.871 276.119 650.871L274.672 650.862C213.965 650.094 164.897 601.026 164.128 540.318L164.119 538.871C164.119 477.015 214.263 426.871 276.119 426.871L277.566 426.88ZM551.096 426.862C612.285 427.637 661.648 477.481 661.648 538.854L661.64 540.301C660.865 601.489 611.021 650.853 549.648 650.854L548.201 650.845C487.012 650.07 437.649 600.226 437.648 538.854C437.648 476.998 487.793 426.854 549.648 426.854L551.096 426.862ZM276.119 476.871C241.877 476.871 214.119 504.629 214.119 538.871C214.119 573.113 241.877 600.871 276.119 600.871C310.361 600.871 338.119 573.113 338.119 538.871C338.119 504.629 310.361 476.871 276.119 476.871ZM549.648 476.854C515.407 476.854 487.648 504.612 487.648 538.854C487.649 573.095 515.407 600.854 549.648 600.854C583.89 600.853 611.648 573.095 611.648 538.854C611.648 504.612 583.89 476.854 549.648 476.854ZM412.569 188C474.425 188 524.569 238.144 524.569 300C524.569 361.856 474.425 412 412.569 412C350.713 412 300.569 361.856 300.569 300C300.569 238.144 350.713 188 412.569 188ZM412.569 238C378.328 238 350.569 265.758 350.569 300C350.569 334.242 378.328 362 412.569 362C446.811 362 474.569 334.241 474.569 300C474.569 265.759 446.811 238 412.569 238Z"/> +</mask> +<path d="M277.566 426.88C338.755 427.655 388.119 477.498 388.119 538.871L388.11 540.318C387.335 601.507 337.492 650.871 276.119 650.871L274.672 650.862C213.965 650.094 164.897 601.026 164.128 540.318L164.119 538.871C164.119 477.015 214.263 426.871 276.119 426.871L277.566 426.88ZM551.096 426.862C612.285 427.637 661.648 477.481 661.648 538.854L661.64 540.301C660.865 601.489 611.021 650.853 549.648 650.854L548.201 650.845C487.012 650.07 437.649 600.226 437.648 538.854C437.648 476.998 487.793 426.854 549.648 426.854L551.096 426.862ZM276.119 476.871C241.877 476.871 214.119 504.629 214.119 538.871C214.119 573.113 241.877 600.871 276.119 600.871C310.361 600.871 338.119 573.113 338.119 538.871C338.119 504.629 310.361 476.871 276.119 476.871ZM549.648 476.854C515.407 476.854 487.648 504.612 487.648 538.854C487.649 573.095 515.407 600.854 549.648 600.854C583.89 600.853 611.648 573.095 611.648 538.854C611.648 504.612 583.89 476.854 549.648 476.854ZM412.569 188C474.425 188 524.569 238.144 524.569 300C524.569 361.856 474.425 412 412.569 412C350.713 412 300.569 361.856 300.569 300C300.569 238.144 350.713 188 412.569 188ZM412.569 238C378.328 238 350.569 265.758 350.569 300C350.569 334.242 378.328 362 412.569 362C446.811 362 474.569 334.241 474.569 300C474.569 265.759 446.811 238 412.569 238Z" fill="url(#paint0_radial_52_117)"/> +<path d="M277.566 426.88L277.883 401.882L277.801 401.881L277.718 401.88L277.566 426.88ZM388.119 538.871L413.119 539.023L413.119 538.947V538.871H388.119ZM388.11 540.318L413.108 540.635L413.109 540.553L413.11 540.47L388.11 540.318ZM276.119 650.871L275.967 675.871L276.043 675.871H276.119V650.871ZM274.672 650.862L274.355 675.86L274.438 675.861L274.52 675.862L274.672 650.862ZM164.128 540.318L139.128 540.47L139.129 540.553L139.13 540.635L164.128 540.318ZM164.119 538.871H139.119V538.947L139.12 539.023L164.119 538.871ZM276.119 426.871L276.271 401.872L276.195 401.871H276.119V426.871ZM551.096 426.862L551.412 401.864L551.33 401.863L551.248 401.863L551.096 426.862ZM661.648 538.854L686.648 539.005L686.648 538.929V538.854H661.648ZM661.64 540.301L686.638 540.617L686.639 540.535L686.639 540.453L661.64 540.301ZM549.648 650.854L549.497 675.853L549.573 675.854H549.648L549.648 650.854ZM548.201 650.845L547.885 675.843L547.967 675.844L548.049 675.844L548.201 650.845ZM437.648 538.854H412.648V538.854L437.648 538.854ZM549.648 426.854L549.8 401.854L549.724 401.854H549.648V426.854ZM276.119 476.871V451.871V476.871ZM214.119 538.871H189.119H214.119ZM276.119 600.871V625.871V600.871ZM338.119 538.871H363.119H338.119ZM549.648 476.854L549.648 451.854H549.648V476.854ZM487.648 538.854L462.648 538.853V538.854L487.648 538.854ZM549.648 600.854V625.854H549.648L549.648 600.854ZM611.648 538.854L636.648 538.854V538.853L611.648 538.854ZM412.569 188L412.569 163H412.569V188ZM524.569 300H549.569V300L524.569 300ZM412.569 412V437H412.569L412.569 412ZM300.569 300L275.569 300V300H300.569ZM412.569 238L412.57 213H412.569V238ZM350.569 300L325.569 300V300H350.569ZM412.569 362V387H412.57L412.569 362ZM474.569 300H499.569V300L474.569 300ZM277.566 426.88L277.25 451.878C324.773 452.48 363.119 491.199 363.119 538.871H388.119H413.119C413.119 463.797 352.737 402.83 277.883 401.882L277.566 426.88ZM388.119 538.871L363.12 538.719L363.111 540.167L388.11 540.318L413.11 540.47L413.119 539.023L388.119 538.871ZM388.11 540.318L363.112 540.002C362.511 587.525 323.791 625.871 276.119 625.871V650.871V675.871C351.193 675.871 412.16 615.489 413.108 540.635L388.11 540.318ZM276.119 650.871L276.271 625.872L274.824 625.863L274.672 650.862L274.52 675.862L275.967 675.871L276.119 650.871ZM274.672 650.862L274.988 625.864C227.841 625.267 189.723 587.15 189.126 540.002L164.128 540.318L139.13 540.635C140.07 614.902 200.089 674.92 274.355 675.86L274.672 650.862ZM164.128 540.318L189.127 540.167L189.119 538.719L164.119 538.871L139.12 539.023L139.128 540.47L164.128 540.318ZM164.119 538.871H189.119C189.119 490.822 228.07 451.871 276.119 451.871V426.871V401.871C200.456 401.871 139.119 463.208 139.119 538.871H164.119ZM276.119 426.871L275.967 451.871L277.415 451.879L277.566 426.88L277.718 401.88L276.271 401.872L276.119 426.871ZM551.096 426.862L550.779 451.86C598.303 452.462 636.648 491.182 636.648 538.854H661.648H686.648C686.648 463.78 626.266 402.812 551.412 401.864L551.096 426.862ZM661.648 538.854L636.649 538.702L636.64 540.149L661.64 540.301L686.639 540.453L686.648 539.005L661.648 538.854ZM661.64 540.301L636.642 539.984C636.04 587.508 597.32 625.853 549.648 625.854L549.648 650.854L549.648 675.854C624.722 675.853 685.689 615.471 686.638 540.617L661.64 540.301ZM549.648 650.854L549.8 625.854L548.353 625.845L548.201 650.845L548.049 675.844L549.497 675.853L549.648 650.854ZM548.201 650.845L548.518 625.847C500.994 625.245 462.649 586.525 462.648 538.853L437.648 538.854L412.648 538.854C412.649 613.927 473.031 674.895 547.885 675.843L548.201 650.845ZM437.648 538.854H462.648C462.648 490.805 501.6 451.854 549.648 451.854V426.854V401.854C473.985 401.854 412.648 463.191 412.648 538.854H437.648ZM549.648 426.854L549.497 451.853L550.944 451.862L551.096 426.862L551.248 401.863L549.8 401.854L549.648 426.854ZM276.119 476.871V451.871C228.07 451.871 189.119 490.822 189.119 538.871H214.119H239.119C239.119 518.437 255.685 501.871 276.119 501.871V476.871ZM214.119 538.871H189.119C189.119 586.92 228.07 625.871 276.119 625.871V600.871V575.871C255.685 575.871 239.119 559.306 239.119 538.871H214.119ZM276.119 600.871V625.871C324.168 625.871 363.119 586.92 363.119 538.871H338.119H313.119C313.119 559.306 296.554 575.871 276.119 575.871V600.871ZM338.119 538.871H363.119C363.119 490.822 324.168 451.871 276.119 451.871V476.871V501.871C296.554 501.871 313.119 518.437 313.119 538.871H338.119ZM549.648 476.854V451.854C501.6 451.854 462.648 490.805 462.648 538.853L487.648 538.854L512.648 538.854C512.648 518.419 529.214 501.854 549.648 501.854V476.854ZM487.648 538.854L462.648 538.854C462.649 586.902 501.6 625.854 549.648 625.854V600.854V575.854C529.214 575.854 512.649 559.288 512.648 538.853L487.648 538.854ZM549.648 600.854L549.648 625.854C597.697 625.853 636.648 586.902 636.648 538.854L611.648 538.854L586.648 538.853C586.648 559.288 570.083 575.853 549.648 575.854L549.648 600.854ZM611.648 538.854L636.648 538.853C636.648 490.805 597.697 451.854 549.648 451.854L549.648 476.854L549.648 501.854C570.083 501.854 586.648 518.419 586.648 538.854L611.648 538.854ZM412.569 188L412.569 213C460.618 213 499.569 251.952 499.569 300L524.569 300L549.569 300C549.569 224.337 488.232 163 412.569 163L412.569 188ZM524.569 300H499.569C499.569 348.049 460.618 387 412.569 387L412.569 412L412.569 437C488.232 437 549.569 375.663 549.569 300H524.569ZM412.569 412V387C364.521 387 325.569 348.049 325.569 300H300.569H275.569C275.569 375.663 336.906 437 412.569 437V412ZM300.569 300L325.569 300C325.569 251.951 364.521 213 412.569 213V188V163C336.906 163 275.569 224.337 275.569 300L300.569 300ZM412.569 238V213C364.521 213 325.569 251.951 325.569 300L350.569 300L375.569 300C375.569 279.565 392.135 263 412.569 263V238ZM350.569 300H325.569C325.569 348.049 364.521 387 412.569 387V362V337C392.135 337 375.569 320.435 375.569 300H350.569ZM412.569 362L412.57 387C460.618 387 499.569 348.049 499.569 300H474.569H449.569C449.569 320.434 433.004 337 412.569 337L412.569 362ZM474.569 300L499.569 300C499.569 251.951 460.618 213 412.57 213L412.569 238L412.569 263C433.004 263 449.569 279.566 449.569 300L474.569 300Z" fill="white" mask="url(#path-2-inside-1_52_117)"/> +<defs> +<radialGradient id="paint0_radial_52_117" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(412.884 198.029) rotate(90) scale(807.954 883.425)"> +<stop stop-color="#B53CFD"/> +<stop offset="1" stop-color="#1D2736"/> +</radialGradient> +</defs> +</svg> diff --git a/assets/icons/claude.svg b/assets/icons/claude.svg new file mode 100644 index 000000000000..e29f32825727 --- /dev/null +++ b/assets/icons/claude.svg @@ -0,0 +1 @@ +<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude \ No newline at end of file diff --git a/assets/icons/dhi.svg b/assets/icons/dhi.svg new file mode 100644 index 000000000000..91d515440056 --- /dev/null +++ b/assets/icons/dhi.svg @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/assets/icons/facebook.svg b/assets/icons/facebook.svg new file mode 100644 index 000000000000..e3e31d89316d --- /dev/null +++ b/assets/icons/facebook.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/static/assets/icons/go.svg b/assets/icons/go.svg similarity index 100% rename from static/assets/icons/go.svg rename to assets/icons/go.svg diff --git a/assets/icons/gordon-happy.svg b/assets/icons/gordon-happy.svg new file mode 100644 index 000000000000..072740635b66 --- /dev/null +++ b/assets/icons/gordon-happy.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/gordon.svg b/assets/icons/gordon.svg new file mode 100644 index 000000000000..91442d6a36a5 --- /dev/null +++ b/assets/icons/gordon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/headset.svg b/assets/icons/headset.svg new file mode 100644 index 000000000000..700d4c546086 --- /dev/null +++ b/assets/icons/headset.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/instagram.svg b/assets/icons/instagram.svg new file mode 100644 index 000000000000..d0acf82f83c5 --- /dev/null +++ b/assets/icons/instagram.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/static/assets/icons/java.svg b/assets/icons/java.svg similarity index 100% rename from static/assets/icons/java.svg rename to assets/icons/java.svg diff --git a/assets/icons/linkedin.svg b/assets/icons/linkedin.svg new file mode 100644 index 000000000000..997fa8bb51fc --- /dev/null +++ b/assets/icons/linkedin.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/static/assets/images/logo-build-cloud.svg b/assets/icons/logo-build-cloud.svg similarity index 100% rename from static/assets/images/logo-build-cloud.svg rename to assets/icons/logo-build-cloud.svg diff --git a/assets/icons/models.svg b/assets/icons/models.svg new file mode 100644 index 000000000000..581f3621afb2 --- /dev/null +++ b/assets/icons/models.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/moon.svg b/assets/icons/moon.svg new file mode 100644 index 000000000000..0bc248ff5148 --- /dev/null +++ b/assets/icons/moon.svg @@ -0,0 +1,8 @@ + + + + + + + diff --git a/assets/icons/openai.svg b/assets/icons/openai.svg new file mode 100644 index 000000000000..50d94d6c1085 --- /dev/null +++ b/assets/icons/openai.svg @@ -0,0 +1 @@ +OpenAI \ No newline at end of file diff --git a/assets/icons/sun.svg b/assets/icons/sun.svg new file mode 100644 index 000000000000..5eb18a1d1d7b --- /dev/null +++ b/assets/icons/sun.svg @@ -0,0 +1,8 @@ + + + + + + + diff --git a/assets/icons/system.svg b/assets/icons/system.svg new file mode 100644 index 000000000000..d25f42526783 --- /dev/null +++ b/assets/icons/system.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/toolkit.svg b/assets/icons/toolkit.svg new file mode 100644 index 000000000000..ef4c016dc5c0 --- /dev/null +++ b/assets/icons/toolkit.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/twitter.svg b/assets/icons/twitter.svg new file mode 100644 index 000000000000..67893368f732 --- /dev/null +++ b/assets/icons/twitter.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/youtube.svg b/assets/icons/youtube.svg new file mode 100644 index 000000000000..86a34ce77f0b --- /dev/null +++ b/assets/icons/youtube.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/FacebookCircle.svg b/assets/images/FacebookCircle.svg deleted file mode 100644 index d6ad69f938e4..000000000000 --- a/assets/images/FacebookCircle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/InstagramCircle.svg b/assets/images/InstagramCircle.svg deleted file mode 100644 index 7021c0c0f5ec..000000000000 --- a/assets/images/InstagramCircle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/LinkedinCircle.svg b/assets/images/LinkedinCircle.svg deleted file mode 100644 index a1d860f7f596..000000000000 --- a/assets/images/LinkedinCircle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/TwitterCircle.svg b/assets/images/TwitterCircle.svg deleted file mode 100644 index 9eac86eefebb..000000000000 --- a/assets/images/TwitterCircle.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/assets/images/YoutubeCircle.svg b/assets/images/YoutubeCircle.svg deleted file mode 100644 index 23678de57f95..000000000000 --- a/assets/images/YoutubeCircle.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/images/ai-stars.svg b/assets/images/ai-stars.svg deleted file mode 100644 index b7c6a9085c00..000000000000 --- a/assets/images/ai-stars.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/static/assets/images/logo-icon-white.svg b/assets/images/ask-ai-logo.svg similarity index 100% rename from static/assets/images/logo-icon-white.svg rename to assets/images/ask-ai-logo.svg diff --git a/assets/images/gordon-logo.svg b/assets/images/gordon-logo.svg new file mode 100644 index 000000000000..d19e48fa61c7 --- /dev/null +++ b/assets/images/gordon-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/gordon-robot.svg b/assets/images/gordon-robot.svg new file mode 100644 index 000000000000..9b315eadebaf --- /dev/null +++ b/assets/images/gordon-robot.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/images/guides/dhi-examples-go.webp b/assets/images/guides/dhi-examples-go.webp new file mode 100644 index 000000000000..3f5a440739e8 Binary files /dev/null and b/assets/images/guides/dhi-examples-go.webp differ diff --git a/assets/images/guides/dhi-examples-nodejs.webp b/assets/images/guides/dhi-examples-nodejs.webp new file mode 100644 index 000000000000..e7627866afc6 Binary files /dev/null and b/assets/images/guides/dhi-examples-nodejs.webp differ diff --git a/assets/images/guides/dhi-examples-python.webp b/assets/images/guides/dhi-examples-python.webp new file mode 100644 index 000000000000..4326509bc114 Binary files /dev/null and b/assets/images/guides/dhi-examples-python.webp differ diff --git a/assets/images/guides/dhi-migrate-doi.webp b/assets/images/guides/dhi-migrate-doi.webp new file mode 100644 index 000000000000..1157dababe46 Binary files /dev/null and b/assets/images/guides/dhi-migrate-doi.webp differ diff --git a/assets/images/guides/dhi-migrate-wolfi.webp b/assets/images/guides/dhi-migrate-wolfi.webp new file mode 100644 index 000000000000..b6a0dd0c63f5 Binary files /dev/null and b/assets/images/guides/dhi-migrate-wolfi.webp differ diff --git a/assets/images/guides/ros2.jpg b/assets/images/guides/ros2.jpg new file mode 100644 index 000000000000..98d697619ef9 Binary files /dev/null and b/assets/images/guides/ros2.jpg differ diff --git a/assets/images/search-ai.svg b/assets/images/search-ai.svg deleted file mode 100644 index a898a28113ce..000000000000 --- a/assets/images/search-ai.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/assets/js/mermaid.js b/assets/js/mermaid.js new file mode 100644 index 000000000000..ae8f7a9b1f10 --- /dev/null +++ b/assets/js/mermaid.js @@ -0,0 +1,19 @@ +import mermaid from 'mermaid' + +const isDark = () => document.documentElement.classList.contains('dark') + +mermaid.initialize({ + startOnLoad: false, + securityLevel: 'strict', + theme: isDark() ? 'dark' : 'default', +}) + +const render = () => { + mermaid.run({ querySelector: 'pre.mermaid' }) +} + +if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', render) +} else { + render() +} diff --git a/assets/js/src/alpine.js b/assets/js/src/alpine.js index cdcdfeb93055..c314dc641cd9 100644 --- a/assets/js/src/alpine.js +++ b/assets/js/src/alpine.js @@ -2,12 +2,110 @@ import Alpine from 'alpinejs' import collapse from '@alpinejs/collapse' import persist from '@alpinejs/persist' import focus from '@alpinejs/focus' - +import { marked } from 'marked' +import hljs from 'highlight.js/lib/core' +// Import languages relevant to Docker docs +import bash from 'highlight.js/lib/languages/bash' +import dockerfile from 'highlight.js/lib/languages/dockerfile' +import yaml from 'highlight.js/lib/languages/yaml' +import json from 'highlight.js/lib/languages/json' +import javascript from 'highlight.js/lib/languages/javascript' +import python from 'highlight.js/lib/languages/python' +import go from 'highlight.js/lib/languages/go' + window.Alpine = Alpine Alpine.plugin(collapse) Alpine.plugin(persist) Alpine.plugin(focus) + +// Register highlight.js languages +hljs.registerLanguage('bash', bash) +hljs.registerLanguage('sh', bash) +hljs.registerLanguage('shell', bash) +hljs.registerLanguage('console', bash) +hljs.registerLanguage('dockerfile', dockerfile) +hljs.registerLanguage('yaml', yaml) +hljs.registerLanguage('yml', yaml) +hljs.registerLanguage('json', json) +hljs.registerLanguage('javascript', javascript) +hljs.registerLanguage('js', javascript) +hljs.registerLanguage('python', python) +hljs.registerLanguage('py', python) +hljs.registerLanguage('go', go) +hljs.registerLanguage('golang', go) + +// Configure marked to escape HTML in text tokens only (not code blocks) +marked.use({ + walkTokens(token) { + // Escape HTML in text and HTML tokens, preserve code blocks + if (token.type === 'text' || token.type === 'html') { + const text = token.text || token.raw + const escaped = text + .replace(/&/g, '&') + .replace(//g, '>') + if (token.text) token.text = escaped + if (token.raw) token.raw = escaped + } + } +}) + +// Add $markdown magic for rendering markdown with syntax highlighting +Alpine.magic('markdown', () => { + return (content) => { + if (!content) return '' + const html = marked(content) + + // Parse and highlight code blocks + const div = document.createElement('div') + div.innerHTML = html + + // Handle code blocks (pre > code) + div.querySelectorAll('pre').forEach((pre) => { + // Add not-prose to prevent Tailwind Typography styling + pre.classList.add('not-prose') + const code = pre.querySelector('code') + if (code) { + // Preserve the original text with newlines + const codeText = code.textContent + + // Clear and set as plain text first to preserve structure + code.textContent = codeText + + // Now apply highlight.js which will work with the text nodes + hljs.highlightElement(code) + } + }) + + // Handle inline code elements (not in pre blocks) + div.querySelectorAll('code:not(pre code)').forEach((code) => { + code.classList.add('not-prose') + }) + + return div.innerHTML + } +}) + +// Stores Alpine.store("showSidebar", false) +Alpine.store('gordon', { + isOpen: false, + query: '', + autoSubmit: false, + toggle() { + this.isOpen = !this.isOpen + }, + open(query, autoSubmit = false) { + this.isOpen = true + if (query) { + this.query = query + this.autoSubmit = autoSubmit + } + }, + close() { + this.isOpen = false + } +}) Alpine.start() diff --git a/assets/js/src/marlin.js b/assets/js/src/marlin.js new file mode 100644 index 000000000000..62a51abaea84 --- /dev/null +++ b/assets/js/src/marlin.js @@ -0,0 +1,18 @@ +import { Marlin, Environment } from "@docker/marlin-sdk-web-public"; + +const config = window.__marlinConfig; + +if (config && config.apiKey && config.endpoint) { + const environment = + config.environment === "staging" ? Environment.STAGING : Environment.PROD; + try { + window.marlin = new Marlin({ + endpoint: config.endpoint, + apiKey: config.apiKey, + site: "docs", + environment, + }); + } catch (err) { + console.warn("Marlin SDK init failed:", err); + } +} diff --git a/assets/js/theme.js b/assets/js/theme.js index 95faa9a8f3a2..27852bd5c02f 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -1,20 +1,10 @@ -// return 'light' or 'dark' depending on localStorage (pref) or system setting -function getThemePreference() { - const theme = localStorage.getItem("theme-preference"); - if (theme) return theme; - else - return window.matchMedia("(prefers-color-scheme: dark)").matches +// update root class based on os setting or localstorage +const storedTheme = localStorage.getItem("theme-preference"); +const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; +document.firstElementChild.className = + storedTheme === "dark" || storedTheme === "light" + ? storedTheme + : prefersDark ? "dark" : "light"; -} - -// update root class based on os setting or localstorage -const preference = getThemePreference(); -document.firstElementChild.className = preference === "dark" ? "dark" : "light"; -localStorage.setItem("theme-preference", preference); - -// set innertext for the theme switch button -// window.addEventListener("DOMContentLoaded", () => { -// const themeSwitchButton = document.querySelector("#theme-switch"); -// themeSwitchButton.textContent = `${preference}_mode`; -// }); +document.firstElementChild.dataset.themePreference = storedTheme || "auto"; diff --git a/content/_index.md b/content/_index.md index 7c7a6e3641aa..3c9e13e3044d 100644 --- a/content/_index.md +++ b/content/_index.md @@ -2,137 +2,26 @@ title: Home description: Docker Documentation is the official Docker library of resources, manuals, and guides to help you containerize applications. keywords: Docker, documentation, manual, guide, reference, api, samples -grid: - - title: Docker Desktop - icon: computer - description: | - Manage containers, applications, and images directly from your machine. - links: - - text: "Overview" - url: "/desktop/" - - text: "Explore Docker Desktop" - url: "/desktop/use-desktop/" - - text: "Release notes" - url: "/desktop/release-notes/" - - title: Docker Engine - icon: developer_board - description: | - The definitive open source container client and runtime. - links: - - text: "Overview" - url: "/engine/" - - text: "Install" - url: "/engine/install/" - - text: "Release notes" - url: "/engine/release-notes/" - - title: Docker Build - icon: build - description: | - Package, test, and ship your applications. - links: - - text: "Overview" - url: "/build/" - - text: "Packaging your software" - url: "/build/building/packaging/" - - text: "Release notes" - url: "/build/release-notes/" - - title: Docker Build Cloud - icon: cloud - description: | - Run your builds in the cloud. - links: - - text: "Overview" - url: "/build-cloud/" - - text: "Setup" - url: "/build-cloud/setup/" - - text: "Release notes" - url: "/build-cloud/release-notes/" - - title: Docker Compose - icon: polyline - description: | - Define and run multi-container applications with Docker. - links: - - text: "Overview" - url: "/compose/" - - text: "Try Docker Compose" - url: "/compose/gettingstarted/" - - text: "Release notes" - url: "/compose/releases/release-notes/" - - title: Docker Hub - icon: device_hub - description: | - Find and share container images and other artifacts. - links: - - text: "Overview" - url: "/docker-hub/" - - text: "Create an account" - url: "/accounts/create-account/" - - text: "Create a repository" - url: "/docker-hub/repos/create/" - - title: Docker Scout - icon: query_stats - description: | - Strengthen your software supply chain with Docker Scout. - links: - - text: "Overview" - url: "/scout/" - - text: "Quickstart" - url: "/scout/quickstart/" - - text: "Image analysis" - url: "/scout/image-analysis/" - - title: Subscription - icon: card_membership - description: | - Licensing for commercial use of Docker components. - links: - - text: "Overview" - url: "/subscription/" - - text: "Subscriptions and features" - url: "/subscription/details/" - - text: "Change subscription" - url: "/subscription/change/" - - title: Billing - icon: payments - description: | - Manage your billing and payment settings for your subscription. - links: - - text: "Overview" - url: "/billing/" - - text: "Update payment method" - url: "/billing/payment-method/" - - text: "View billing history" - url: "/billing/history/" - - title: Administration - icon: admin_panel_settings - description: | - Manage company and organization users, permissions, and more. - links: - - text: "Overview" - url: "/admin/company/" - - text: "Organization administration" - url: "/admin/organization/" - - text: "Company administration" - url: "/admin/company/" - - title: Security - icon: shield - description: | - Security guardrails for both administrators and developers. - links: - - text: "Overview" - url: "/security/" - - text: "SSO" - url: "/security/for-admins/single-sign-on/" - - text: "SCIM" - url: "/security/for-admins/provisioning/scim/" - - title: Testcontainers Cloud - icon: cloud - description: | - Testcontainers Cloud lets you run heavy test workloads remotely. - links: - - text: "Overview" - url: "https://testcontainers.com/cloud/docs/" - - text: "Getting started" - url: "https://testcontainers.com/cloud/docs/#getting-started" - - text: "TCC for CI" - url: "https://testcontainers.com/cloud/docs/#tcc-for-ci" +aliases: + - /search/ --- + +Docker Documentation helps you learn Docker, install Docker products, and find +reference material for everyday development and operations tasks. + +## Browse docs by area + +- [Get started](/get-started/): Learn Docker basics and core concepts. +- [Guides](/guides/): Follow task-focused walkthroughs for common workflows. +- [Manuals](/manuals/): Install, configure, and use Docker products. +- [Reference](/reference/): Browse CLI, API, and file format documentation. + +{{< whats-new >}} + +## Common questions + +- [How do I get started with Docker?](/get-started/docker-overview/) +- [Can I run my AI agent in a sandbox?](/ai/sandboxes/get-started/) +- [What is a container?](/get-started/docker-concepts/the-basics/what-is-a-container/) +- [What are Docker Hardened Images?](/dhi/) +- [Why should I use Docker Compose?](/compose/) diff --git a/content/bot-detection.md b/content/bot-detection.md new file mode 100644 index 000000000000..3be15b77050d --- /dev/null +++ b/content/bot-detection.md @@ -0,0 +1,9 @@ +--- +title: Automated traffic detection +description: This page supports automated traffic detection for Docker documentation. +keywords: bot detection, automated traffic, Docker documentation +sitemap: false +layout: wide +--- + +This page is used to identify automated traffic. diff --git a/content/contribute/_index.md b/content/contribute/_index.md deleted file mode 100644 index 3801814cd10b..000000000000 --- a/content/contribute/_index.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Contribute to Docker's docs -linkTitle: Contribute -weight: 10 -toc_max: 1 -aliases: -- /opensource/ -- /contribute/overview/ -- /contribute/contribute-guide/ -grid: -- title: Grammar and style - description: Explore Docker's grammar and style guide - icon: menu_book - link: /contribute/style/grammar -- title: Formatting - description: Format your content to match the rest of our documentation. - icon: newspaper - link: /contribute/style/formatting -- title: Recommended word list - description: Choose the right words for your content. - icon: checklist - link: /contribute/style/recommended-words -- title: Source file conventions - description: Guidelines for creating a new page. - icon: note_add - link: /contribute/file-conventions -- title: Terminology - description: Explore commonly used Docker terms. - icon: spellcheck - link: /contribute/style/terminology -- title: Voice and tone - description: Learn about how we use voice and tone in our writing. - icon: voice_selection - link: /contribute/style/voice-tone ---- - -We value documentation contributions from the Docker community. We'd like to -make it as easy as possible for you to contribute to the Docker documentation. - -Find the contribution guidelines in -[CONTRIBUTING.md](https://github.com/docker/docs/blob/main/CONTRIBUTING.md) in -the `docker/docs` GitHub repository. Use the following links to review our -style guide and instructions on how to use our page templates and components. - -{{< grid >}} - -### Additional resources - -See also: - -- A section of useful components you can add to your documentation. -- Information on Docker's [tone and voice](style/voice-tone.md). -- A [writing checklist](checklist.md) to help you when you're contributing to Docker's documentation. diff --git a/content/contribute/checklist.md b/content/contribute/checklist.md deleted file mode 100644 index e9e8af6feade..000000000000 --- a/content/contribute/checklist.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: Writing checklist -description: A helpful writing checklist when creating documentation -keywords: checklist, documentation, style guide, contribute -weight: 60 ---- - -Use this checklist to communicate in a way that is clear, helpful, and consistent with the rest of Docker Docs. - -##### Used active voice - -Active voice is specific and removes ambiguity. - -In active voice, the subject of the sentence (the customer or the system) does the action. - -Sentences that use active voice are easier to read. Active voice makes it clear who has done what and to whom. Plus, active voice keeps sentences direct and more concise. - -Helping verbs such as is, was, or would may indicate that you're writing in passive voice. And, if you can add the phrase 'by zombies' after the verb, you're writing in the passive voice. - -|Correct| Incorrect| -|:--|:--| -|Increase productivity with Docker Desktop.| Productivity can be increased (by zombies) with Docker Desktop.| -|If you remove items from a grid, charts automatically refresh to display the change. | If items are removed (by zombies) from a grid, charts automatically refresh to display the change.| - -##### Written clear sentences that get to the point - -Write short, concise sentences. Punchy sentences are faster to read and easier to understand. - -##### Used subheadings and bulleted lists to break up the page - -This helps find the information they need quickly and easily. - -For more information, see the [formatting](style/formatting.md#headings-and-subheadings) page, or see the [components](components/lists.md) for examples. - -##### Started the title of your page with a verb - -For example, 'Install Docker Desktop'. - -##### Checked that the left-hand table of contents title in docs.docker.com, matches the title displayed on the page - -##### Checked for broken links and images - -Use relative links to link to other pages or images within the GitHub repository. - -For more information, see the [formatting](style/formatting.md#links) page, or see the [components](components/links.md) for examples. - -##### Checked that any redirects you may have added, work - -For information on how to add redirects, see [Source file conventions](file-conventions.md#front-matter). - -##### Used bold on any UI elements you refer to in your content - -##### Completed a final spelling, punctuation, and grammar check - -For more in-depth information on our Style Guide, explore the [grammar](style/grammar.md) or [formatting](style/formatting.md) guides. diff --git a/content/contribute/components/_index.md b/content/contribute/components/_index.md deleted file mode 100644 index 3c3ff89b1a68..000000000000 --- a/content/contribute/components/_index.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -build: - render: never -title: Useful components -weight: 50 ---- \ No newline at end of file diff --git a/content/contribute/components/accordions.md b/content/contribute/components/accordions.md deleted file mode 100644 index c88cf9bdaebd..000000000000 --- a/content/contribute/components/accordions.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Accordions -toc_max: 3 ---- - -## Example - -{{< accordion title="Accordion example" >}} - -```console -$ docker run hello-world -``` - -{{< /accordion >}} - -## Markup - -````markdown -{{}} - -```console -$ docker run hello-world -``` - -{{}} -```` diff --git a/content/contribute/components/badges.md b/content/contribute/components/badges.md deleted file mode 100644 index db1cedf36c2f..000000000000 --- a/content/contribute/components/badges.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Badges -toc_max: 3 ---- - -### Examples - -{{< badge color=blue text="blue badge" >}} -{{< badge color=amber text="amber badge" >}} -{{< badge color=red text="red badge" >}} -{{< badge color=green text="green badge" >}} -{{< badge color=violet text="violet badge" >}} - -You can also make a badge a link. - -[{{< badge color="blue" text="badge with a link" >}}](../_index.md) - -### Usage guidelines - -We use badges to indicate new content and product content in various stages of the release lifecycle: - -- The violet badge to highlight new early access or experimental content -- The blue badge to highlight beta content -- The green badge to highlight new content that is either GA or not product-related content, such as guides/learning paths - -Best practice is to use this badge for no longer than 2 months post release of the feature. - -### Markup - -```go -{{}} -[{{}}](../overview.md) -``` diff --git a/content/contribute/components/buttons.md b/content/contribute/components/buttons.md deleted file mode 100644 index 7e7aed3fdb6f..000000000000 --- a/content/contribute/components/buttons.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Buttons -toc_max: 3 ---- - -### Examples - -{{< button url="https://example.com/" text="hello" >}} - -### Markup - -```go -{{}} -``` diff --git a/content/contribute/components/call-outs.md b/content/contribute/components/call-outs.md deleted file mode 100644 index 231e896d2b2e..000000000000 --- a/content/contribute/components/call-outs.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Callouts -toc_max: 3 ---- - -We support these broad categories of callouts: - -- Alerts: Note, Tip, Important, Warning, Caution - -We also support summary bars, which represent a feature's required subscription, version, or Adminstrator role. -To add a summary bar: - -Add the feature name to the `/data/summary.yaml` file. Use the following attributes: - -| Attribute | Description | Possible values | -|----------------|--------------------------------------------------------|---------------------------------------------------------| -| `subscription` | Notes the subscription required to use the feature | All, Personal, Pro, Team, Business | -| `availability` | Notes what product development stage the feature is in | Experimental, Beta, Early Access, GA, Retired | -| `requires` | Notes what minimum version is required for the feature | No specific value, use a string to describe the version and link to relevant release notes | -| `for` | Notes if the feature is intended for IT Administrators | Administrators | - -Then, add the `summary-bar` shortcode on the page you want to add the summary bar to. Note, the feature name is case sensitive. The icons that appear in the summary bar are automatically rendered. - -## Examples - -{{< summary-bar feature_name="PKG installer" >}} - -> [!NOTE] -> -> Note the way the `get_hit_count` function is written. This basic retry -> loop lets us attempt our request multiple times if the redis service is -> not available. This is useful at startup while the application comes -> online, but also makes our application more resilient if the Redis -> service needs to be restarted anytime during the app's lifetime. In a -> cluster, this also helps handling momentary connection drops between -> nodes. - -> [!TIP] -> -> For a smaller base image, use `alpine`. - -> [!IMPORTANT] -> -> Treat access tokens like your password and keep them secret. Store your -> tokens securely (for example, in a credential manager). - -> [!WARNING] -> -> Removing Volumes -> -> By default, named volumes in your compose file are NOT removed when running -> `docker compose down`. If you want to remove the volumes, you will need to add -> the `--volumes` flag. -> -> The Docker Desktop Dashboard does not remove volumes when you delete the app stack. - -> [!CAUTION] -> -> Here be dragons. - -For both of the following callouts, consult [the Docker release lifecycle](/release-lifecycle) for more information on when to use them. - -## Formatting - -```md -{{}} -``` - -```html -> [!NOTE] -> -> Note the way the `get_hit_count` function is written. This basic retry -> loop lets us attempt our request multiple times if the redis service is -> not available. This is useful at startup while the application comes -> online, but also makes our application more resilient if the Redis -> service needs to be restarted anytime during the app's lifetime. In a -> cluster, this also helps handling momentary connection drops between -> nodes. - -> [!TIP] -> -> For a smaller base image, use `alpine`. - -> [!IMPORTANT] -> -> Treat access tokens like your password and keep them secret. Store your -> tokens securely (for example, in a credential manager). - -> [!WARNING] -> -> Removing Volumes -> -> By default, named volumes in your compose file are NOT removed when running -> `docker compose down`. If you want to remove the volumes, you will need to add -> the `--volumes` flag. -> -> The Docker Desktop Dashboard does not remove volumes when you delete the app stack. - -> [!CAUTION] -> -> Here be dragons. -``` \ No newline at end of file diff --git a/content/contribute/components/cards.md b/content/contribute/components/cards.md deleted file mode 100644 index 0dc0f009cffb..000000000000 --- a/content/contribute/components/cards.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Cards -toc_max: 3 -grid: -- title: Docker Desktop - description: Docker on your Desktop. - icon: install_desktop - link: /desktop/ -- title: Docker Engine - description: Vrrrrooooommm - icon: developer_board - link: /engine/ -- title: Docker Build - description: Clang bang - icon: build - link: /build/ -- title: Docker Compose - description: Figgy! - icon: account_tree - link: /compose/ -- title: Docker Hub - description: so much content, oh wow - icon: hub - link: /docker-hub/ ---- - -Cards can be added to a page using the `card` shortcode. -The parameters for this shortcode are: - -| Parameter | Description | -| ----------- | -------------------------------------------------------------------- | -| title | The title of the card | -| icon | The icon slug of the card | -| image | Use a custom image instead of an icon (mutually exclusive with icon) | -| link | (Optional) The link target of the card, when clicked | -| description | A description text, in Markdown | - -> [!NOTE] -> -> There's a known limitation with the Markdown description of cards, -> in that they can't contain relative links, pointing to other .md documents. -> Such links won't render correctly. Instead, use an absolute link to the URL -> path of the page that you want to link to. -> -> For example, instead of linking to `../install/linux.md`, write: -> `/engine/install/linux/`. - -## Example - -{{< card - title="Get your Docker on" - icon=favorite - link=https://docs.docker.com/ - description="Build, share, and run your apps with Docker" >}} - -## Markup - -```go -{{}} -``` - -### Grid - -There's also a built-in `grid` shortcode that generates a... well, grid... of cards. -The grid size is 3x3 on large screens, 2x2 on medium, and single column on small. - -{{< grid >}} - -Grid is a separate shortcode from `card`, but it implements the same component under the hood. -The markup you use to insert a grid is slightly unconventional. The grid shortcode takes no arguments. -All it does is let you specify where on a page you want your grid to appear. - -```go -{{}} -``` - -The data for the grid is defined in the front matter of the page, under the `grid` key, as follows: - -```yaml -# front matter section of a page -title: some page -grid: - - title: "Docker Engine" - description: Vrrrrooooommm - icon: "developer_board" - link: "/engine/" - - title: "Docker Build" - description: Clang bang - icon: "build" - link: "/build/" -``` diff --git a/content/contribute/components/code-blocks.md b/content/contribute/components/code-blocks.md deleted file mode 100644 index 7df04769a2b2..000000000000 --- a/content/contribute/components/code-blocks.md +++ /dev/null @@ -1,244 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Code blocks -toc_max: 3 ---- - -Rouge provides lots of different code block "hints". If you leave off the hint, -it tries to guess and sometimes gets it wrong. These are just a few hints that -we use often. - -## Variables - -If your example contains a placeholder value that's subject to change, -use the format `<[A-Z_]+>` for the placeholder value: `` - -```none -export name= -``` - -This syntax is reserved for variable names, and will cause the variable to -be rendered in a special color and font style. - -## Highlight lines - -```text {hl_lines=[7,8]} -incoming := map[string]interface{}{ - "asdf": 1, - "qwer": []interface{}{}, - "zxcv": []interface{}{ - map[string]interface{}{}, - true, - int(1e9), - "tyui", - }, -} -``` - -````markdown -```go {hl_lines=[7,8]} -incoming := map[string]interface{}{ - "asdf": 1, - "qwer": []interface{}{}, - "zxcv": []interface{}{ - map[string]interface{}{}, - true, - int(1e9), - "tyui", - }, -} -``` -```` - -## Collapsible code blocks - -```dockerfile {collapse=true} -# syntax=docker/dockerfile:1 - -ARG GO_VERSION="1.21" - -FROM golang:${GO_VERSION}-alpine AS base -ENV CGO_ENABLED=0 -ENV GOPRIVATE="github.com/foo/*" -RUN apk add --no-cache file git rsync openssh-client -RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts -WORKDIR /src - -FROM base AS vendor -# this step configure git and checks the ssh key is loaded -RUN --mount=type=ssh < - - -Welcome to nginx! - - -``` - -## Markdown - -```markdown -# Hello -``` - -If you want to include a triple-fenced code block inside your code block, -you can wrap your block in a quadruple-fenced code block: - -`````markdown -````markdown -# Hello - -```go -log.Println("did something") -``` -```` -````` - -## ini - -```ini -[supervisord] -nodaemon=true - -[program:sshd] -command=/usr/sbin/sshd -D -``` - -## Dockerfile - -```dockerfile -# syntax=docker/dockerfile:1 - -FROM ubuntu - -RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list - -RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 - -# Note: The official Debian and Ubuntu images automatically ``apt-get clean`` -# after each ``apt-get`` - -USER postgres - -RUN /etc/init.d/postgresql start &&\ - psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\ - createdb -O docker docker - -RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf - -RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf - -EXPOSE 5432 - -VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"] - -CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"] -``` - -## YAML - -```yaml -authorizedkeys: - image: dockercloud/authorizedkeys - deployment_strategy: every_node - autodestroy: always - environment: - - AUTHORIZED_KEYS=ssh-rsa AAAAB3Nsomelongsshkeystringhereu9UzQbVKy9o00NqXa5jkmZ9Yd0BJBjFmb3WwUR8sJWZVTPFL - volumes: - /root:/user:rw -``` diff --git a/content/contribute/components/icons.md b/content/contribute/components/icons.md deleted file mode 100644 index b89533075d26..000000000000 --- a/content/contribute/components/icons.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -description: Icons used across docs -title: Icons -grid: - - title: "Install" - icon: "download" - description: Icon name = download - - title: "FAQs" - icon: "help" - description: Icon name = help - - title: "Onboarding/quickstarts" - icon: "explore" - description: Icon name = explore - - title: "Release notes" - icon: "note_add" - description: Icon name = note_add - - title: "Feedback" - icon: "sms" - description: Icon name = sms - - title: "Multi-platform/arch" - icon: "content_copy" - description: Icon name = content_copy - - title: "Rootless/ECI" - icon: "security" - description: Icon name = security - - title: "Settings management" - icon: "shield_lock" - description: Icon name = shield_lock - - title: "Processes" - icon: "checklist" - description: Icon name = checklist - - title: "Networking" - icon: "network_node" - description: Icon name = network_node - - title: "Exploring a feature" - icon: "feature_search" - description: Icon name = feature_search - - title: "Company" - icon: "apartment" - description: Icon name = apartment - - title: "Organization" - icon: "store" - description: Icon name = store - - title: "Additional resources" - icon: "category" - description: Icon name = category - - title: "Designing" - icon: "design_services" - description: Icon name = design_services - - title: "Publishing" - icon: "publish" - description: Icon name = publish - - title: "Interacting" - icon: "multiple_stop" - description: Icon name = multiple_stop - - title: "Storage" - icon: "database" - description: Icon name = database - - title: "logs" - icon: "text_snippet" - description: Icon name = text_snippet - - title: "Prune/cut" - icon: "content_cut" - description: Icon name = content_cut - - title: "Configure" - icon: "tune" - description: Icon name = tune - - title: "Deprecated" - icon: "folder_delete" - description: Icon name = folder_delete - - title: "RAM" - icon: "home_storage" - description: Icon name = home_storage - - title: "IAM" - icon: "photo_library" - description: Icon name = photo_library - - title: "Packaging" - icon: "inventory_2" - description: Icon name = inventory_2 - - title: "Multi-stage" - icon: "stairs" - description: Icon name = stairs - - title: "Architecture" - icon: "construction" - description: Icon name = construction - - title: "Build drivers" - icon: "engineering" - description: Icon name = engineering - - title: "Export" - icon: "output" - description: Icon name = output - - title: "Cache" - icon: "cycle" - description: Icon name = cycle - - title: "Bake" - icon: "cake" - description: Icon name = cake - - title: "Docker ID" - icon: "fingerprint" - description: Icon name = fingerprint - - title: "Repository" - icon: "inbox" - description: Icon name = inbox - - title: "Access tokens" - icon: "password" - description: Icon name = password - - title: "official images" - icon: "verified" - description: Icon name = verified - - title: "Hardened Docker Desktop" - icon: "lock" - description: Icon name = lock - - title: "Sign in" - icon: "passkey" - description: Icon name = passkey - - title: "SSO and SCIM" - icon: "key" - description: Icon name = key - - title: "2FA" - icon: "phonelink_lock" - description: Icon name = phonelink_lock - - title: "Add/update payment method" - icon: "credit_score" - description: Icon name = credit_score - - title: "Update billing info" - icon: "contract_edit" - description: Icon name = contract_edit - - title: "Billing history" - icon: "payments" - description: Icon name = payments - - title: "Upgrade" - icon: "upgrade" - description: Icon name = upgrade - - title: "Add/manage more seats/users" - icon: "group_add" - description: Icon name = group_add - - title: "Domains" - icon: "domain_verification" - description: Icon name = domain_verification - - title: Company owner - description: Icon name = supervised_user_circle - icon: supervised_user_circle - - title: "General settings" - icon: "settings" - description: Icon name = settings ---- - -Below is an inventory of the icons we use to represent different topics or features across docs. To be used with the [cards component](cards.md). - -{{< grid >}} - diff --git a/content/contribute/components/images.md b/content/contribute/components/images.md deleted file mode 100644 index 305334c283e1..000000000000 --- a/content/contribute/components/images.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Images -toc_max: 3 ---- - -## Example - -- A small image: ![a small image](/assets/images/footer_moby_icon.png) - -- Large images occupy the full width of the reading column by default: - - ![a pretty wide image](/assets/images/banner_image_24512.png) - -- Image size can be set using query parameters: `?h=&w=` - - ![a pretty wide image](/assets/images/banner_image_24512.png?w=100&h=50) - -- Image with a border, also set with a query parameter: `?border=true` - - ![a small image](/assets/images/footer_moby_icon.png?border=true) - - -## HTML and Markdown - -```markdown -- A small image: ![a small image](/assets/images/footer_moby_icon.png) - -- Large images occupy the full width of the reading column by default: - - ![a pretty wide image](/assets/images/banner_image_24512.png) - -- Image size can be set using query parameters: `?h=&w=` - - ![a pretty wide image](/assets/images/banner_image_24512.png?w=100&h=50) - -- Image with a border, also set with a query parameter: `?border=true` - - ![a small image](/assets/images/footer_moby_icon.png?border=true) -``` diff --git a/content/contribute/components/links.md b/content/contribute/components/links.md deleted file mode 100644 index 97f47fbd4fc9..000000000000 --- a/content/contribute/components/links.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Links -toc_max: 3 ---- - -## Examples - -- [External links](https://docker.com) open in a new tab -- [Internal links](links.md) open in the same tab - -You can use relative links, using source filenames, -or you can use absolute links for pages as they appear on the final site. - -#### Links to auto-generated content - -When you link to heading IDs in auto-generated pages, such as CLI reference content, -you won't get any help from your editor in resolving the anchor names. That's -because the pages are generated at build-time and your editor or LSP doesn't know -about them in advance. - -## Syntax - -```md -[External links](https://docker.com) -[Internal links](links.md) -``` diff --git a/content/contribute/components/lists.md b/content/contribute/components/lists.md deleted file mode 100644 index 551b47af889b..000000000000 --- a/content/contribute/components/lists.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Lists -toc_max: 3 ---- - -## Examples - -Use dashes (`-`) or asterisks (`*`) for bullet points. - -- Bullet list item 1 -- Bullet list item 2 -- Bullet list item 3 - -1. Numbered list item 1. Two spaces between the period and the first letter - helps with alignment. - -2. Numbered list item 2. Let's put a note in it. - - > [!NOTE]: We did it! - -3. Numbered list item 3 with a code block in it. You need the blank line before - the code block happens. - - ```bash - $ docker run hello-world - ``` - -4. Numbered list item 4 with a bullet list inside it and a numbered list - inside that. - - - Sub-item 1 - - Sub-item 2 - - 1. Sub-sub-item 1 - 2. Sub-sub-item-2 with a table inside it because we like to party! - Indentation is super important. - - | Header 1 | Header 2 | - | -------- | -------- | - | Thing 1 | Thing 2 | - | Thing 3 | Thing 4 | - -## Markdown - -````md -- Bullet list item 1 -- Bullet list item 2 -- Bullet list item 3 - -1. Numbered list item 1. Two spaces between the period and the first letter - helps with alignment. - -2. Numbered list item 2. Let's put a note in it. - - > [!NOTE]: We did it! - -3. Numbered list item 3 with a code block in it. You need the blank line before - the code block happens. - - ```bash - $ docker run hello-world - ``` - -4. Numbered list item 4 with a bullet list inside it and a numbered list - inside that. - - - Sub-item 1 - - Sub-item 2 - - 1. Sub-sub-item 1 - 2. Sub-sub-item-2 with a table inside it. - Indentation is super important. - - | Header 1 | Header 2 | - | -------- | -------- | - | Thing 1 | Thing 2 | - | Thing 3 | Thing 4 | -```` diff --git a/content/contribute/components/tables.md b/content/contribute/components/tables.md deleted file mode 100644 index 1631bafb2bb4..000000000000 --- a/content/contribute/components/tables.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Tables -toc_max: 3 ---- - -## Example - -### Basic table - -| Permission level | Access | -| :----------------------------------------------------------------------- | :------------------------------------------------------------ | -| **Bold** or _italic_ within a table cell. Next cell is empty on purpose. | | -| | Previous cell is empty. A `--flag` in mono text. | -| Read | Pull | -| Read/Write | Pull, push | -| Admin | All of the above, plus update description, create, and delete | - -### Feature-support table - -| Platform | x86_64 / amd64 | -| :--------- | :------------: | -| Ubuntu | ✅ | -| Debian | ✅ | -| Fedora | | -| Arch (btw) | ✅ | - -## Markdown - -### Basic table - -```md -| Permission level | Access | -| :----------------------------------------------------------------------- | :------------------------------------------------------------ | -| **Bold** or _italic_ within a table cell. Next cell is empty on purpose. | | -| | Previous cell is empty. A `--flag` in mono text. | -| Read | Pull | -| Read/Write | Pull, push | -| Admin | All of the above, plus update description, create, and delete | -``` - -The alignment of the cells in the source doesn't really matter. The ending pipe -character is optional (unless the last cell is supposed to be empty). - -### Feature-support table - -```md -| Platform | x86_64 / amd64 | -| :--------- | :------------: | -| Ubuntu | ✅ | -| Debian | ✅ | -| Fedora | | -| Arch (btw) | ✅ | -``` diff --git a/content/contribute/components/tabs.md b/content/contribute/components/tabs.md deleted file mode 100644 index ceca66e690ee..000000000000 --- a/content/contribute/components/tabs.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -description: components and formatting examples used in Docker's docs -title: Tabs -toc_max: 3 ---- - -The tabs component consists of two shortcodes: - -- `{{}}` -- `{{}}` - -The `{{}}` shortcode is a parent, component, wrapping a number of `tabs`. -Each `{{}}` is given a name using the `name` attribute. - -You can optionally specify a `group` attribute for the `tabs` wrapper to indicate -that a tab section should belong to a group of tabs. See [Groups](#groups). - -## Example - -{{< tabs >}} -{{< tab name="JavaScript">}} - -```js -console.log("hello world") -``` - -{{< /tab >}} -{{< tab name="Go">}} - -```go -fmt.Println("hello world") -``` - -{{< /tab >}} -{{< /tabs >}} - -## Markup - -````markdown -{{}} -{{}} - -```js -console.log("hello world") -``` - -{{}} -{{}} - -```go -fmt.Println("hello world") -``` - -{{}} -{{}} -```` - -## Groups - -You can optionally specify a tab group on the `tabs` shortcode. -Doing so will synchronize the tab selection for all of the tabs that belong to the same group. - -### Tab group example - -The following example shows two tab sections belonging to the same group. - -{{< tabs group="code" >}} -{{< tab name="JavaScript">}} - -```js -console.log("hello world") -``` - -{{< /tab >}} -{{< tab name="Go">}} - -```go -fmt.Println("hello world") -``` - -{{< /tab >}} -{{< /tabs >}} - -{{< tabs group="code" >}} -{{< tab name="JavaScript">}} - -```js -const res = await fetch("/users/1") -``` - -{{< /tab >}} -{{< tab name="Go">}} - -```go -resp, err := http.Get("/users/1") -``` - -{{< /tab >}} -{{< /tabs >}} diff --git a/content/contribute/components/videos.md b/content/contribute/components/videos.md deleted file mode 100644 index 3e2f1bcec558..000000000000 --- a/content/contribute/components/videos.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -description: Learn about guidelines and best practices for videos in docs, and how to add a video component. -title: Videos -toc_max: 3 ---- - -## Video guidelines - -Videos are used rarely in Docker's documentation. When used, video should complement written text and not be the sole format of documentation. Videos can take longer to produce and be more difficult to maintain than written text or even screenshots, so consider the following before adding video: - -- Can you demonstrate a clear customer need for using video? -- Does the video offer new content, rather than directly reading or re-purposing official documentation? -- If the video contains user interfaces that may change regularly, do you have a maintenance plan to keep the video fresh? -- Does the [voice and tone](../style/voice-tone.md) of the video align with the rest of the documentation? -- Have you considered other options, such as screenshots or clarifying existing documentation? -- Is the quality of the video similar to the rest of Docker's documentation? -- Can the video be linked or embedded from the site? - -If all of the above criteria are met, you can reference the following best practices before creating a video to add to Docker documentation. - -### Best practices - -- Determine the audience for your video. Will the video be a broad overview for beginners, or will it be a deep dive into a technical process designed for an advanced user? -- Videos should be less than 5 minutes long. Keep in mind how long the video needs to be to properly explain the topic, and if the video needs to be longer than 5 minutes, consider text, diagrams, or screenshots instead. These are easier for a user to scan for relevant information. -- Videos should adhere to the same standards for accessibility as the rest of the documentation. -- Ensure the quality of your video by writing a script (if there's narration), making sure multiple browsers and URLs aren't visible, blurring or cropping out any sensitive information, and using smooth transitions between different browsers or screens. - -Videos are not hosted in the Docker documentation repository. To add a video, you can use a [link](./links.md) to hosted content, or embed using an [iframe](#iframe). - - -## iframe - -To embed a video on a docs page, use an ` -``` - -## asciinema - -`asciinema` is a command line tool for recording terminal sessions. The -recordings can be embedded on the documentation site. These are similar to -`console` code blocks, but since they're playable and scrubbable videos, they -add another level of usefulness over static codeblocks in some cases. Text in -an `asciinema` "video" can also be copied, which makes them more useful. - -Consider using an `asciinema` recording if: - -- The input/output of the terminal commands are too long for a static example - (you could also consider truncating the output) -- The steps you want to show are easily demonstrated in a few commands -- Where the it's useful to see both inputs and outputs of commands - -To create an `asciinema` recording and add it to docs: - -1. [Install](https://docs.asciinema.org/getting-started/) the `asciinema` CLI -2. Run `asciinema auth` to configure your client and create an account -3. Start a new recording with `asciinema rec` -4. Run the commands for your demo and stop the recording with `` or `exit` -5. Upload the recording to -6. Embed the player with a ` + +Pass a prompt directly as an argument: + +```console +$ docker ai "list my running containers" +``` + +Exit the TUI with `/exit` or Ctrl+C. + +## Working directory + +The working directory sets the default context for Gordon's file operations. + +Gordon uses your current shell directory as the working directory: + +```console +$ cd ~/my-project +$ docker ai +``` + +Override with `-C` or `--working-dir`: + +```console +$ docker ai -C ~/different-project +``` + +## Disabling Gordon + +Gordon CLI is part of Docker Desktop. To disable it, disable Gordon in Docker +Desktop Settings: + +1. Open Docker Desktop Settings. +2. Navigate to the **AI** section. +3. Clear the **Enable Gordon** option. +4. Select **Apply**. + +## Commands + +The `docker ai` command includes several subcommands: + +Interactive mode (default): + +```console +$ docker ai +``` + +Opens the TUI for conversational interaction. + +Version: + +```console +$ docker ai version +``` + +Displays the Gordon version. + +Feedback: + +```console +$ docker ai feedback +``` + +Opens a feedback form in your browser. diff --git a/content/manuals/ai/gordon/how-to/configure-tools.md b/content/manuals/ai/gordon/how-to/configure-tools.md new file mode 100644 index 000000000000..90c3b6ae11f7 --- /dev/null +++ b/content/manuals/ai/gordon/how-to/configure-tools.md @@ -0,0 +1,81 @@ +--- +title: Configure Gordon's tools +linkTitle: Configure tools +description: Enable and disable Gordon's built-in tools based on your needs +weight: 40 +--- + +{{< summary-bar feature_name="Gordon" >}} + +Gordon includes built-in tools that extend its capabilities. You can configure +which tools Gordon has access to based on your security requirements and +workflow needs. + +Tool configuration provides an additional layer of control: + +- Enabled tools: Gordon can propose actions using these tools (subject to + your approval) +- Disabled tools: Gordon cannot use these tools, and will not request + permission to use them + +## Accessing tool settings + +To configure Gordon's tools: + +1. Open Docker Desktop. +2. Select **Gordon** in the sidebar. +3. Select the settings icon at the bottom of the text input area. + + ![Session settings icon](../images/gordon_permission_settings.avif) + +The tool settings dialog opens with two tabs: **Basic** and **Advanced**. + +## Basic tool settings + +In the **Basic** tab, you can enable or disable individual tools globally. + +To disable a tool: + +1. Find the tool you want to disable in the list. +2. Toggle it off. +3. Select **Save**. + +Disabled tools cannot be used by Gordon, even with your approval. + +## Advanced tool settings + +The **Advanced** tab lets you create fine-grained allow-lists and deny-lists +for specific commands or patterns. + +Allow-lists: +Gordon can use allow-listed commands even when the main tool is disabled. For +example, disable the shell tool but allow `cat`, `grep`, and `ls`. + +Deny-lists: +Block specific commands while keeping the tool enabled. For example, allow the +shell tool but deny `chown` and `chmod`. + +To configure: + +1. Switch to the **Advanced** tab. +2. Add commands to **Allow rules** or **Deny rules**. +3. Select **Save**. + +![Advanced tool configuration](../images/gordon_advanced_tool_config.avif) + +Gordon still requests approval before running allow-listed tools, unless YOLO +mode (auto-approve mode that bypasses permission checks) is enabled. + +## Organizational controls + +For Business subscriptions, administrators can control tool access for the +entire organization using Settings Management. + +Administrators can: + +- Disable specific tools for all users +- Lock tool configuration to prevent users from changing it +- Set organization-wide tool policies + +See [Settings Management](/enterprise/security/hardened-desktop/settings-management/) +for details. diff --git a/content/manuals/ai/gordon/how-to/docker-desktop.md b/content/manuals/ai/gordon/how-to/docker-desktop.md new file mode 100644 index 000000000000..1586bdbccab7 --- /dev/null +++ b/content/manuals/ai/gordon/how-to/docker-desktop.md @@ -0,0 +1,57 @@ +--- +title: Using Gordon in Docker Desktop +linkTitle: Docker Desktop +description: Access and use Gordon through the Docker Desktop graphical interface +weight: 10 +--- + +{{< summary-bar feature_name="Gordon" >}} + +Gordon is integrated into Docker Desktop. Access it from the sidebar to open +the Gordon view. + +## Basic usage + +To access Gordon: + +1. Open Docker Desktop and sign in to your Docker account. +2. Select **Gordon** in the sidebar. +3. Type your question or request in the input field. +4. Press Enter or select the send button. + +Gordon responds in the chat view and maintains context throughout the session. + +## Working directory + +The working directory sets the default context for Gordon's file operations. +Select your working directory when you start Gordon or use the directory icon +to change it during a conversation: + +1. Select the directory icon in the Gordon input area. +2. Browse and select a different directory. + +## Contextual help + +The Gordon icon appears throughout Docker Desktop. Selecting it opens Gordon +pre-loaded with context about the item you are working with, such as container +logs or build output. + +## Usage indicator + +Docker Desktop shows a usage indicator so you can see how close you are to +your tier limit. See [Usage limits and tiers](../usage-limits.md) for details. + +## Disabling Gordon + +To disable Gordon: + +1. Open Docker Desktop Settings. +2. Navigate to the **AI** section. +3. Clear the **Enable Gordon** option. +4. Select **Apply**. + +## Configure tools + +You can control which tools Gordon has access to. See [Configure +tools](./configure-tools.md) for details on enabling, disabling, and +fine-tuning tool permissions. diff --git a/content/manuals/ai/gordon/how-to/permissions.md b/content/manuals/ai/gordon/how-to/permissions.md new file mode 100644 index 000000000000..3e08cfb3c58a --- /dev/null +++ b/content/manuals/ai/gordon/how-to/permissions.md @@ -0,0 +1,125 @@ +--- +title: Gordon's permission model +linkTitle: Permissions +description: How Gordon's ask-first approach keeps you in control +weight: 30 +--- + +{{< summary-bar feature_name="Gordon" >}} + +Before Gordon uses a tool or action that can modify your system, it proposes +the action and waits for your approval before executing. + +## What requires approval + +By default, the following actions require approval before Gordon can use them: + +- Commands executed in your shell +- Writing or changing files +- Fetching information from the internet + +## What doesn't require approval + +- Reading files, listing directories (even outside Gordon's working directory) +- Searching the Docker documentation +- Analyzing code or explaining errors + +## Configuring permission settings + +To change the default permission settings for Gordon: + +1. Open Docker Desktop. +2. Select **Gordon** in the sidebar. +3. Select the settings icon at the bottom of text input. + + ![Session settings icon](../images/gordon_permission_settings.avif) + +In the **Basic** tab you can configure whether Gordon should ask for permission +before using a tool. + +You can also enable YOLO mode to bypass permission checking altogether. + +The new permission settings apply immediately to all sessions. + +## Session-level permissions + +When you choose "Approve for this session" (Desktop) or "A" (CLI), Gordon can +use that specific tool without asking again during the current conversation. + +Example: + +```console +$ docker ai "check my containers and clean up stopped ones" + +Gordon proposes: + docker ps -a + +Approve? [Y/n/a]: a + +[Gordon executes docker ps -a] + +Gordon proposes: + docker container prune -f + +[Executes automatically - you approved shell access for this session] +``` + +Session permissions reset when: + +- You close the Gordon view (Desktop) +- You exit `docker ai` (CLI) +- You start a new conversation + +## Security considerations + +Working directory +: The working directory sets the default context for file operations. It does + not constrain Gordon's access to files or directories; Gordon can read files + outside this directory. + +Verify before approving +: Gordon can make mistakes. Before approving: + + - Confirm commands match your intent + - Check container names and image tags are correct + - Verify volume mounts and port mappings + - Review file changes for important logic + + If you don't understand an operation, ask Gordon to explain it or reject and + request a different approach. + +Destructive operations +: Gordon warns about destructive operations but won't prevent them. Operations + like `docker container rm`, `docker system prune`, and `docker volume rm` can + cause permanent data loss. Back up important data first. + +## Stopping and reverting + +Stop Gordon during execution by pressing `Ctrl+C` (CLI) or selecting **Cancel** +(Desktop). + +Revert Gordon's actions using Docker commands or version control: + +- Restore files from Git +- Restart stopped containers +- Rebuild images +- Recreate volumes from backups + +Use version control for all files in your working directory. + +## Organizational controls + +Administrators can control Gordon's capabilities at the organization level +using Settings Management. + +Available controls: + +- Disable Gordon entirely +- Restrict tool capabilities +- Set working directory boundaries + +For Business subscriptions, Gordon must be enabled by an administrator before +users can access it. + +See [Settings Management](/enterprise/security/hardened-desktop/settings-management/) +for details. diff --git a/content/manuals/ai/gordon/images/delete.webp b/content/manuals/ai/gordon/images/delete.webp deleted file mode 100644 index e939fb150e69..000000000000 Binary files a/content/manuals/ai/gordon/images/delete.webp and /dev/null differ diff --git a/content/manuals/ai/gordon/images/gordon.webp b/content/manuals/ai/gordon/images/gordon.webp deleted file mode 100644 index ebf97291489d..000000000000 Binary files a/content/manuals/ai/gordon/images/gordon.webp and /dev/null differ diff --git a/content/manuals/ai/gordon/images/gordon_advanced_tool_config.avif b/content/manuals/ai/gordon/images/gordon_advanced_tool_config.avif new file mode 100644 index 000000000000..2b02955daa46 Binary files /dev/null and b/content/manuals/ai/gordon/images/gordon_advanced_tool_config.avif differ diff --git a/content/manuals/ai/gordon/images/gordon_gui.avif b/content/manuals/ai/gordon/images/gordon_gui.avif new file mode 100644 index 000000000000..5b77c21d56cc Binary files /dev/null and b/content/manuals/ai/gordon/images/gordon_gui.avif differ diff --git a/content/manuals/ai/gordon/images/gordon_permission_settings.avif b/content/manuals/ai/gordon/images/gordon_permission_settings.avif new file mode 100644 index 000000000000..eea123b3e84e Binary files /dev/null and b/content/manuals/ai/gordon/images/gordon_permission_settings.avif differ diff --git a/content/manuals/ai/gordon/images/gordon_permissions_prompt.avif b/content/manuals/ai/gordon/images/gordon_permissions_prompt.avif new file mode 100644 index 000000000000..8ddbf4e91304 Binary files /dev/null and b/content/manuals/ai/gordon/images/gordon_permissions_prompt.avif differ diff --git a/content/manuals/ai/gordon/images/gordon_tui.avif b/content/manuals/ai/gordon/images/gordon_tui.avif new file mode 100644 index 000000000000..e429b2aae814 Binary files /dev/null and b/content/manuals/ai/gordon/images/gordon_tui.avif differ diff --git a/content/manuals/ai/gordon/images/toolbox.webp b/content/manuals/ai/gordon/images/toolbox.webp deleted file mode 100644 index ae8fcf006804..000000000000 Binary files a/content/manuals/ai/gordon/images/toolbox.webp and /dev/null differ diff --git a/content/manuals/ai/gordon/mcp/_index.md b/content/manuals/ai/gordon/mcp/_index.md deleted file mode 100644 index af49c24ed450..000000000000 --- a/content/manuals/ai/gordon/mcp/_index.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: MCP -description: Learn how to use MCP servers with Gordon -keywords: ai, mcp, gordon, docker desktop, docker, llm, -grid: -- title: Built-in tools - description: Use the built-in tools. - icon: construction - link: /ai/gordon/mcp/built-in-tools -- title: MCP configuration - description: Configure MCP tools on a per-project basis. - icon: manufacturing - link: /ai/gordon/mcp/yaml -- title: MCP Server - description: Use Gordon as an MCP server - icon: dns - link: /ai/gordon/mcp/gordon-mcp-server/ -aliases: - - /desktop/features/gordon/mcp/ ---- - -## What is MCP? - -[Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) is -an open protocol that standardizes how applications provide context and extra -functionality to large language models. MCP functions as a client-server -protocol, where the client, for example an application like Gordon, sends -requests, and the server processes those requests to deliver the necessary -context to the AI. This context may be gathered by the MCP server by executing -some code to perform an action and getting the result of the action, calling -external APIs, etc. - -Gordon, along with other MCP clients like Claude Desktop or Cursor, can interact -with MCP servers running as containers. - -{{< grid >}} \ No newline at end of file diff --git a/content/manuals/ai/gordon/mcp/built-in-tools.md b/content/manuals/ai/gordon/mcp/built-in-tools.md deleted file mode 100644 index 9fd76880ac10..000000000000 --- a/content/manuals/ai/gordon/mcp/built-in-tools.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -title: Built-in tools -description: How to use Gordon's built-in tools -keywords: ai, mcp, gordon -aliases: - - /desktop/features/gordon/mcp/built-in-tools/ ---- - -Gordon comes with an integrated toolbox providing access to various system tools -and capabilities. These tools extend Gordon's functionality by allowing it to -interact with the Docker Engine, Kubernetes, Docker Scout's security scanning, -and other developer utilities. This documentation covers the available tools, -their configuration, and usage patterns. - -## Configuration - -Tools can be configured globally in the toolbox, making them accessible -throughout the Gordon interfaces, including both Docker Desktop and the CLI. - -To configure: - -1. On the **Ask Gordon** view in Docker Desktop, select the `Toolbox` button in the bottom left of the input area. - - ![Gordon page with the toolbox button](../images/gordon.webp) - -2. Choose the tools you want to make available. Selecting a card lets you view extra information regarding each tool and what it does. - - ![Gordon's Toolbox](../images/toolbox.webp) - - For more information on the possible tools, see [Reference](#reference). - -## Usage examples - -This section provides task-oriented examples for common operations with Gordon -tools. - -### Managing Docker containers - -#### List and monitor containers - -```console -# List all running containers -$ docker ai "Show me all running containers" - -# List containers using specific resources -$ docker ai "List all containers using more than 1GB of memory" - -# View logs from a specific container -$ docker ai "Show me logs from my running api-container from the last hour" -``` - -#### Manage container lifecycle - -```console -# Run a new container -$ docker ai "Run a nginx container with port 80 exposed to localhost" - -# Stop a specific container -$ docker ai "Stop my database container" - -# Clean up unused containers -$ docker ai "Remove all stopped containers" -``` - -### Working with Docker images - -```console -# List available images -$ docker ai "Show me all my local Docker images" - -# Pull a specific image -$ docker ai "Pull the latest Ubuntu image" - -# Build an image from a Dockerfile -$ docker ai "Build an image from my current directory and tag it as myapp:latest" - -# Clean up unused images -$ docker ai "Remove all my unused images" -``` - -### Managing Docker volumes - -```console -# List volumes -$ docker ai "List all my Docker volumes" - -# Create a new volume -$ docker ai "Create a new volume called postgres-data" - -# Backup data from a container to a volume -$ docker ai "Create a backup of my postgres container data to a new volume" -``` - -### Kubernetes operations - -```console -# Create a deployment -$ docker ai "Create an nginx deployment and make sure it's exposed locally" - -# List resources -$ docker ai "Show me all deployments in the default namespace" - -# Get logs -$ docker ai "Show me logs from the auth-service pod" -``` - -### Security analysis - - -```console -# Scan for CVEs -$ docker ai "Scan my application for security vulnerabilities" - -# Get security recommendations -$ docker ai "Give me recommendations for improving the security of my nodejs-app image" -``` - -### Development workflows - -```console -# Analyze and commit changes -$ docker ai "Look at my local changes, create multiple commits with sensible commit messages" - -# Review branch status -$ docker ai "Show me the status of my current branch compared to main" -``` - -## Reference - -This section provides a comprehensive listing of the built-in tools you can find -in Gordon's toolbox. - -### Docker tools - -Tools to interact with your Docker containers, images, and volumes. - -#### Container management - -| Name | Description | -|------|-------------| -| `list_containers` | List all Docker containers | -| `remove_containers` | Remove one or more Docker containers | -| `stop_container` | Stop a running Docker container | -| `fetch_container_logs` | Retrieve logs from a Docker container | -| `run_container` | Run a new Docker container | - -#### Volume management - -| Tool | Description | -|------|-------------| -| `list_volumes` | List all Docker volumes | -| `remove_volume` | Remove a Docker volume | -| `create_volume` | Create a new Docker volume | - -#### Image management - -| Tool | Description | -|------|-------------| -| `list_images` | List all Docker images | -| `remove_images` | Remove Docker images | -| `pull_image` | Pull an image from a registry | -| `push_image` | Push an image to a registry | -| `build_image` | Build a Docker image | -| `tag_image` | Tag a Docker image | -| `inspect` | Inspect a Docker object | - -### Kubernetes tools - -Tools to interact with your Kubernetes cluster - -#### Pods - -| Tool | Description | -|------|-------------| -| `list_pods` | List all pods in the cluster | -| `get_pod_logs` | Get logs from a specific pod | - -#### Deployment management - - -| Tool | Description | -|------|-------------| -| `list_deployments` | List all deployments | -| `create_deployment` | Create a new deployment | -| `expose_deployment` | Expose a deployment as a service | -| `remove_deployment` | Remove a deployment | - -#### Service management - -| Tool | Description | -|------|-------------| -| `list_services` | List all services | -| `remove_service` | Remove a service | - -#### Cluster information - -| Tool | Description | -|------|-------------| -| `list_namespaces` | List all namespaces | -| `list_nodes` | List all nodes in the cluster | - -### Docker Scout tools - -Security analysis tools powered by Docker Scout. - -| Tool | Description | -|------|-------------| -| `search_for_cves` | Analyze a Docker image, a project directory, or other artifacts for vulnerabilities using Docker Scout CVEs.search for cves | -| `get_security_recommendations` | Analyze a Docker image, a project directory, or other artifacts for base image update recommendations using Docker Scout. | - -### Developer tools - -General-purpose development utilities. - -| Tool | Description | -|------|-------------| -| `fetch` | Retrieve content from a URL | -| `get_command_help` | Get help for CLI commands | -| `run_command` | Execute shell commands | -| `filesystem` | Perform filesystem operations | -| `git` | Execute git commands | - -### AI model tools - -| Tool | Description | -|------|-------------| -| `list_models` | List all available AI models | -| `pull_model` | Download an AI model | -| `run_model` | Query a model with a prompt | -| `remove_model` | Remove an AI model | - -### AI Tool Catalog - -When the [AI Tool -Catalog](https://open.docker.com/extensions/marketplace?extensionId=docker/labs-ai-tools-for-devs) -Docker Desktop extension is installed, all the tools enabled in the catalog are -available for Gordon to use. After installation, you can enable the usage of the -AI Tool Catalog tools in the toolbox section of Gordon. diff --git a/content/manuals/ai/gordon/mcp/gordon-mcp-server.md b/content/manuals/ai/gordon/mcp/gordon-mcp-server.md deleted file mode 100644 index 39a163ca87d8..000000000000 --- a/content/manuals/ai/gordon/mcp/gordon-mcp-server.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: Gordon as an MCP server -description: How to use Gordon as an MCP server -keywords: ai, mcp, gordon -aliases: - - /desktop/features/gordon/mcp/gordon-mcp-server/ ---- - -## Gordon as an MCP server - -In addition to functioning as an MCP client, Gordon can also act as an MCP -server. This means that all the tools configured in the toolbox section of -Gordon can be exposed to another MCP client like Claude Desktop, Cursor and -others. - -To use Gordon’s built-in tools in other MCP clients, configure your client of -choice to use the `docker ai mcpserver` command. This allows Gordon to serve its -built-in tools via the MCP protocol for various clients. - -For example, to enable Gordon’s tools in Claude Desktop, add the following -configuration to the Claude configuration file: - -```json -{ - "mcpServers": { - "gordon": { - "command": "docker", - "args": ["ai", "mcpserver"] - } - } -} -``` - -This setup ensures that Claude Desktop can communicate with Gordon as an MCP -server, leveraging its built-in tools. You can follow the [Claude Desktop -documentation](https://modelcontextprotocol.io/quickstart/user) to explore -further. - -### Tool permissions and security - -These tools operate with the same permissions as the user running the -application. - -Any potentially destructive tool call, changing files, deleting images or -stopping containers will ask for your confirmation before proceeding. - -![Gordon page with the delete confirmation question](../images/delete.webp) diff --git a/content/manuals/ai/gordon/mcp/yaml.md b/content/manuals/ai/gordon/mcp/yaml.md deleted file mode 100644 index 326c5d6071a2..000000000000 --- a/content/manuals/ai/gordon/mcp/yaml.md +++ /dev/null @@ -1,173 +0,0 @@ ---- -title: YAML configuration -description: Learn how to use MCP servers with Gordon -keywords: ai, mcp, gordon -aliases: - - /desktop/features/gordon/mcp/yaml/ ---- - -Docker has partnered with Anthropic to build container images for the [reference -implementations](https://github.com/modelcontextprotocol/servers/) of MCP -servers available on Docker Hub under [the mcp -namespace](https://hub.docker.com/u/mcp). - -When you run the `docker ai` command in your terminal to ask a question, Gordon -looks in the `gordon-mcp.yml` file in your working directory (if present) for a -list of MCP servers that should be used when in that context. The -`gordon-mcp.yml` file is a Docker Compose file that configures MCP servers as -Compose services for Gordon to access. - -The following minimal example shows how you can use the [mcp-time -server](https://hub.docker.com/r/mcp/time) to provide temporal capabilities to -Gordon. For more information, you can check out the [source code and -documentation](https://github.com/modelcontextprotocol/servers/tree/main/src/time). - -Create the `gordon-mcp.yml` file in your working directory and add the time - server: - -```yaml -services: - time: - image: mcp/time -``` - -With this file present, you can now ask Gordon to tell you the time in - another timezone: - - ```bash - $ docker ai 'what time is it now in kiribati?' - - • Calling get_current_time - - The current time in Kiribati (Tarawa) is 9:38 PM on January 7, 2025. - - ``` - -As you can see, Gordon found the MCP time server and called its tool when -needed. - -## Advanced usage - -Some MCP servers need access to your filesystem or system environment variables. -Docker Compose can help with this. Since `gordon-mcp.yml` is a Compose file you -can add bind mounts using the regular Docker Compose syntax, which makes your -filesystem resources available to the container: - -```yaml -services: - fs: - image: mcp/filesystem - command: - - /rootfs - volumes: - - .:/rootfs -``` - -The `gordon-mcp.yml` file adds filesystem access capabilities to Gordon and -since everything runs inside a container Gordon only has access to the -directories you specify. - -Gordon can handle any number of MCP servers. For example, if you give Gordon -access to the internet with the `mcp/fetch` server: - -```yaml -services: - fetch: - image: mcp/fetch - fs: - image: mcp/filesystem - command: - - /rootfs - volumes: - - .:/rootfs -``` - -You can now ask things like: - -```bash -$ docker ai can you fetch rumpl.dev and write the summary to a file test.txt - - • Calling fetch ✔️ - • Calling write_file ✔️ - - The summary of the website rumpl.dev has been successfully written to the file test.txt in the allowed directory. Let me know if you need further assistance! - - -$ cat test.txt -The website rumpl.dev features a variety of blog posts and articles authored by the site owner. Here's a summary of the content: - -1. **Wasmio 2023 (March 25, 2023)**: A recap of the WasmIO 2023 conference held in Barcelona. The author shares their experience as a speaker and praises the organizers for a successful event. - -2. **Writing a Window Manager in Rust - Part 2 (January 3, 2023)**: The second part of a series on creating a window manager in Rust. This installment focuses on enhancing the functionality to manage windows effectively. - -3. **2022 in Review (December 29, 2022)**: A personal and professional recap of the year 2022. The author reflects on the highs and lows of the year, emphasizing professional achievements. - -4. **Writing a Window Manager in Rust - Part 1 (December 28, 2022)**: The first part of the series on building a window manager in Rust. The author discusses setting up a Linux machine and the challenges of working with X11 and Rust. - -5. **Add docker/docker to your dependencies (May 10, 2020)**: A guide for Go developers on how to use the Docker client library in their projects. The post includes a code snippet demonstrating the integration. - -6. **First (October 11, 2019)**: The inaugural post on the blog, featuring a simple "Hello World" program in Go. -``` - -## What’s next? - -Now that you’ve learned how to use MCP servers with Gordon, here are a few ways -you can get started: - -- Experiment: Try integrating one or more of the tested MCP servers into your - `gordon-mcp.yml` file and explore their capabilities. -- Explore the ecosystem: Check out the [reference implementations on - GitHub](https://github.com/modelcontextprotocol/servers/) or browse the - [Docker Hub MCP namespace](https://hub.docker.com/u/mcp) for additional - servers that might suit your needs. -- Build your own: If none of the existing servers meet your needs, or you’re - curious about exploring how they work in more detail, consider developing a - custom MCP server. Use the [MCP - specification](https://www.anthropic.com/news/model-context-protocol) as a - guide. -- Share your feedback: If you discover new servers that work well with Gordon - or encounter issues with existing ones, [share your findings to help improve - the ecosystem](https://docker.qualtrics.com/jfe/form/SV_9tT3kdgXfAa6cWa). - -With MCP support, Gordon offers powerful extensibility and flexibility to meet -your specific use cases whether you’re adding temporal awareness, file -management, or internet access. - -### Compatible MCP servers - -These are MCP servers that have been tested with Gordon and are known to be -working: - -- `mcp/time` -- `mcp/fetch` -- `mcp/filesystem` -- `mcp/postgres` -- `mcp/git` -- `mcp/sqlite` -- `mcp/github` - -### Untested (should work with appropriate API tokens) - -These are MCP servers that were not tested but should work if given the -appropriate API tokens: - -- `mcp/brave-search` -- `mcp/gdrive` -- `mcp/slack` -- `mcp/google-maps` -- `mcp/gitlab` -- `mcp/everything` -- `mcp/aws-kb-retrieval-server` -- `mcp/sentry` - -### Unsupported - -These are MCP servers that are currently known to be unsupported: - -- `mcp/sequentialthinking` - (The tool description is too long) -- `mcp/puppeteer` - Puppeteer sends back images and Gordon doesn’t know how to - handle them, it only handles text responses from tools -- `mcp/everart` - Everart sends back images and Gordon doesn’t know how to - handle them, it only handles text responses from tools -- `mcp/memory` - There is no way to configure the server to use a custom path - for its knowledge base diff --git a/content/manuals/ai/gordon/usage-limits.md b/content/manuals/ai/gordon/usage-limits.md new file mode 100644 index 000000000000..73568fad124a --- /dev/null +++ b/content/manuals/ai/gordon/usage-limits.md @@ -0,0 +1,49 @@ +--- +title: Gordon usage limits and tiers +linkTitle: Usage limits +description: Gordon subscription tiers and usage limits for Docker Desktop and the CLI +weight: 50 +keywords: [gordon, usage, limits, tiers, base, plus, max, ultra, subscription] +--- + +{{< summary-bar feature_name="Gordon" >}} + +Gordon is included with every Docker account at the Base tier. Paid Gordon +plans unlock higher usage limits. + +## Tiers + +| Tier | Usage allocation | +| ----- | -------------------------------- | +| Base | Included with any Docker account | +| Plus | 2× Base | +| Max | 5× Base | +| Ultra | 10× Base | + +For more information about Gordon tiers and how to upgrade, go to +[docker.com](https://www.docker.com/products/gordon). + +## Usage limits + +Gordon usage is measured in questions. The number you can ask depends on +complexity: questions that involve more context, files, or Docker operations +count more toward your limit. + +| Tier | Per 4 hours | Per day | Per month | +| ----- | ----------- | ------- | --------- | +| Base | ~40 | ~100 | ~180 | +| Plus | ~80 | ~200 | ~360 | +| Max | ~200 | ~500 | ~900 | +| Ultra | ~400 | ~1000 | ~1800 | + +These are estimates and vary based on question complexity. + +Usage limits reset at fixed UTC times, not on a sliding window. The 4-hour +window resets every 4 hours starting at 00:00 UTC, the daily window resets at +00:00 UTC, and the monthly window resets on the first day of each calendar +month at 00:00 UTC. + +## View your usage + +Docker Desktop shows a usage indicator so you can see how close you are to +your limit. To get more usage, upgrade your tier. diff --git a/content/manuals/ai/gordon/use-cases.md b/content/manuals/ai/gordon/use-cases.md new file mode 100644 index 000000000000..460f3ddfc345 --- /dev/null +++ b/content/manuals/ai/gordon/use-cases.md @@ -0,0 +1,157 @@ +--- +title: Gordon use cases and examples +linkTitle: Use cases +description: Example prompts for common Docker workflows +weight: 10 +--- + +{{< summary-bar feature_name="Gordon" >}} + +Gordon handles Docker workflows through natural conversation. In Docker +Desktop, Gordon is available from the sidebar for open-ended sessions and from +contextual entry points in views like Containers, Images, Builds, and Volumes. +Selecting Gordon from one of these views opens a conversation pre-loaded with +context about the item you're looking at. You can ask the same questions from +the CLI with `docker ai`. + +## Debug a failing container + +You're in the Containers view and a container has crashed or behaves +unexpectedly. Open Gordon from the container row to ask about that container's +state and configuration: + +- "Why did this container exit?" +- "What environment variables are set in this container?" +- "How long did this container run?" +- "What security settings are applied to this container?" + +From the CLI: + +```console +$ docker ai "why is my postgres container crashing on startup?" +``` + +## Debug a failed build + +You're in the Builds view looking at a build that failed or is slower than +expected. Open Gordon from the build to inspect the Dockerfile, build +arguments, and cache behavior: + +- "Why did this build fail?" +- "How can I improve cache usage for this build?" +- "What Dockerfile instructions were used?" +- "What build arguments were used?" + +From the CLI: + +```console +$ docker ai "my build is failing at the pip install step, what's wrong?" +``` + +## Inspect an image + +You're in the Images view and want to understand what's in an image before +running it, or you want to size up a base image: + +- "How do I run this image in the CLI?" +- "What environment variables are configured?" +- "What entrypoint is configured?" +- "What's the base architecture of this image?" +- "Is there a lighter version of this image?" + +From the CLI: + +```console +$ docker ai "compare my python:3.12 image to python:3.12-slim" +``` + +## Manage volumes and resources + +From the Volumes view, ask Gordon about what's stored, which containers use a +volume, or how to clean up. From any view, use the Gordon sidebar to inspect +your wider environment: + +- "Which containers are using this volume?" +- "Show me all my containers and their status" +- "How much disk space is Docker using?" +- "List my images sorted by size" + +From the CLI: + +```console +$ docker ai "clean up all unused Docker resources" +``` + +## Build and containerize + +For new projects, start a conversation in the Gordon sidebar or via `docker +ai` from your project directory. Gordon reads your working directory and +proposes the right files: + +- "Containerize my Node.js app" +- "Create a docker-compose for my stack" +- "Set up a dev environment with Postgres and Redis" + +From the CLI: + +```console +$ cd ~/my-project +$ docker ai "create a Dockerfile for this application" +``` + +## Develop and optimize + +Ask Gordon to review and improve existing Dockerfiles or service definitions. +You can start from the Images view (for an image you've already built) or from +the Gordon sidebar with your project context: + +- "Optimize this Dockerfile" +- "Add a health check to my service" +- "Make my Dockerfile more secure" + +From the CLI: + +```console +$ docker ai "rate my Dockerfile and suggest improvements" +``` + +## Learn Docker + +For conceptual questions, use the Gordon sidebar or CLI. Gordon explains +concepts grounded in your environment, not generic answers: + +- "What is a Docker volume?" +- "Explain multi-stage builds" +- "How does networking work in Docker?" + +From the CLI: + +```console +$ docker ai "what's the difference between COPY and ADD in a Dockerfile?" +``` + +## Writing effective prompts + +Be specific: + +- Include relevant context: "my postgres container" not "the database" +- State your goal: "make my build faster" not "optimize" +- Include error messages when debugging + +Gordon works best when you describe what you want to achieve rather than how +to do it. Gordon maintains context across a conversation, so you can follow up +with clarifications or ask related questions without repeating yourself. + +### Working directory context + +When using `docker ai` in the CLI, Gordon uses your current working directory +as the default context for file operations. Change to your project directory +before starting Gordon to ensure it has access to the right files: + +```console +$ cd ~/my-project +$ docker ai "review my Dockerfile" +``` + +You can also override the working directory with the `-C` flag. See [Using +Gordon via CLI](./how-to/cli.md#working-directory) for details. diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/_index.md b/content/manuals/ai/mcp-catalog-and-toolkit/_index.md new file mode 100644 index 000000000000..5841670b91d1 --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/_index.md @@ -0,0 +1,95 @@ +--- +title: Docker MCP Catalog and Toolkit +linkTitle: MCP Catalog and Toolkit +params: + sidebar: + group: AI and agents + badge: + color: blue + text: Beta +weight: 20 +description: Learn about Docker's MCP catalog on Docker Hub +keywords: Docker, ai, mcp servers, ai agents, extension, docker desktop, llm, docker hub +grid: + - title: Get started with MCP Toolkit + description: Learn how to quickly install and use the MCP Toolkit to set up servers and clients. + icon: magnifying-glass-plus + link: /ai/mcp-catalog-and-toolkit/get-started/ + - title: MCP Catalog + description: Browse Docker's curated collection of verified MCP servers + icon: globe-alt + link: /ai/mcp-catalog-and-toolkit/catalog/ + - title: MCP Profiles + description: Organize servers into profiles for different projects and share configurations + icon: folder + link: /ai/mcp-catalog-and-toolkit/profiles/ + - title: MCP Toolkit + description: Use Docker Desktop's UI to discover, configure, and manage MCP servers + icon: /icons/toolkit.svg + link: /ai/mcp-catalog-and-toolkit/toolkit/ + - title: MCP Gateway + description: Use the CLI and Gateway to run MCP servers with custom configurations + icon: cpu-chip + link: /ai/mcp-catalog-and-toolkit/mcp-gateway/ + - title: Dynamic MCP + description: Discover and add MCP servers on-demand using natural language. This feature is experimental. + icon: magnifying-glass + link: /ai/mcp-catalog-and-toolkit/dynamic-mcp/ + - title: Security FAQs + description: Common questions about MCP security, credentials, and server verification + icon: shield-check + link: /ai/mcp-catalog-and-toolkit/faqs/ + - title: E2B sandboxes + description: Cloud sandboxes for AI agents with built-in MCP Catalog access + icon: cloud + link: /ai/mcp-catalog-and-toolkit/e2b-sandboxes/ +--- + +{{< summary-bar feature_name="Docker MCP Catalog and Toolkit" >}} + +[Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) is +an open protocol that standardizes how AI applications access external tools +and data sources. By connecting LLMs to local development tools, databases, +APIs, and other resources, MCP extends their capabilities beyond their base +training. + +The challenge is that running MCP servers locally creates operational friction. +Each server requires separate installation and configuration for every +application you use. You run untrusted code directly on your machine, manage +updates manually, and troubleshoot dependency conflicts yourself. Configure a +GitHub server for Claude, then configure it again for Cursor, and so on. Each +time you manage credentials, permissions, and environment setup. + +## Docker MCP features + +The [MCP Toolkit](/ai/mcp-catalog-and-toolkit/toolkit/) and [MCP +Gateway](/ai/mcp-catalog-and-toolkit/mcp-gateway/) solve these challenges +through centralized management. Instead of configuring each server for every AI +application separately, you set things up once and connect all your clients to +it. The workflow centers on three concepts: catalogs, profiles, and clients. + +![MCP overview](./images/mcp_toolkit.avif) + +[Catalogs](/ai/mcp-catalog-and-toolkit/catalog/) are curated collections of +MCP servers. The Docker MCP Catalog provides 300+ verified servers packaged as +container images with versioning, provenance, and security updates. Organizations +can create [custom +catalogs](/ai/mcp-catalog-and-toolkit/catalog/#custom-catalogs) with approved +servers for their teams. + +[Profiles](/ai/mcp-catalog-and-toolkit/profiles/) organize servers into named +collections for different projects. Your "web-dev" profile might use GitHub and +Playwright; your "backend" profile, database tools. Profiles support both +containerized servers from catalogs and remote MCP servers. Configure a profile +once, then share it across clients or with your team. + +Clients are the AI applications that connect to your profiles. Claude Code, +Cursor, Zed, and others connect through the MCP Gateway, which routes requests +to the right server and handles authentication and lifecycle management. + +> [!NOTE] +> MCP Gateway as part of Docker AI Governance is an invite-only feature. [Contact Docker Sales](https://www.docker.com/pricing/contact-sales/) to learn more. + +## Learn more + +{{< grid >}} diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/catalog.md b/content/manuals/ai/mcp-catalog-and-toolkit/catalog.md new file mode 100644 index 000000000000..284d4198b31b --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/catalog.md @@ -0,0 +1,139 @@ +--- +title: Docker MCP Catalog +linkTitle: Catalog +description: Browse Docker's curated collection of verified MCP servers, and create custom catalogs for your team or organization. +keywords: docker hub, mcp, mcp servers, ai agents, catalog, custom catalog, docker +weight: 20 +--- + +{{< summary-bar feature_name="Docker MCP Catalog" >}} + +The [Docker MCP Catalog](https://hub.docker.com/mcp) is a curated collection of +verified MCP servers, packaged as Docker images and distributed through Docker +Hub. It solves common challenges with running MCP servers locally: environment +conflicts, setup complexity, and security concerns. + +The catalog serves as the source of available MCP servers. When you add servers +to your [profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md), you select +them from the catalog. Each server runs as an isolated container, making it +portable and consistent across different environments. + +> [!NOTE] +> E2B sandboxes now include direct access to the Docker MCP Catalog, giving +> developers access to over 200 tools and services to seamlessly build and run +> AI agents. For more information, see [E2B Sandboxes](e2b-sandboxes.md). + +## What's in the catalog + +The Docker MCP Catalog includes: + +- Verified servers: All servers are versioned with full provenance and SBOM + metadata +- Partner tools: Servers from New Relic, Stripe, Grafana, and other trusted + partners +- Docker-built servers: Locally-running servers built and digitally signed by + Docker for enhanced security +- Remote services: Cloud-hosted servers that connect to external services like + GitHub, Notion, and Linear + +### Local versus remote servers + +The catalog contains two types of servers based on where they run: + +Local servers run as containers on your machine. They work offline once +downloaded and offer predictable performance and complete data privacy. Docker +builds and signs all local servers in the catalog. + +Remote servers run on the provider's infrastructure and connect to external +services. Many remote servers use OAuth authentication, which the MCP Toolkit +handles automatically through your browser. + +## Browse the catalog + +Browse available MCP servers at [hub.docker.com/mcp](https://hub.docker.com/mcp) +or directly in Docker Desktop: + +1. In Docker Desktop, select **MCP Toolkit**. +2. Select the **Catalog** tab to browse available servers. +3. Select a server to view its description, tools, and configuration options. + +## Add servers to a profile + +To add a server from the catalog to a profile: + +1. In the **Catalog** tab, select the checkbox next to a server. +2. Choose the profile to add it to from the drop-down. + +For step-by-step instructions and client connection, see +[Get started with MCP Toolkit](get-started.md) or +[MCP Profiles](profiles.md). + +## Custom catalogs + +Custom catalogs let you curate focused collections of servers for your team or +organization. Instead of exposing all 300+ servers in the Docker catalog, you +define exactly which servers are available. + +Common use cases: + +- Restrict which servers your organization approves for use +- Add your organization's private MCP servers alongside public ones +- Control which server versions your team uses +- Define the server set available to AI agents using [Dynamic MCP](dynamic-mcp.md) + +### Custom catalogs with Dynamic MCP + +Custom catalogs work particularly well with +[Dynamic MCP](/ai/mcp-catalog-and-toolkit/dynamic-mcp/), where agents discover +and add MCP servers on-demand during conversations. When you run the gateway +with a custom catalog, the `mcp-find` tool searches only within that catalog. +If your catalog contains 20 servers instead of 300+, agents work within that +focused set, discovering and enabling tools as needed without manual +configuration each time. + +### Import a custom catalog + +If someone on your team has created and published a catalog, you can import it +using its OCI registry reference. + +In Docker Desktop: + +1. Select **MCP Toolkit** and select the **Catalog** tab. +2. Select **Import catalog**. +3. Enter the OCI reference for the catalog (for example, + `registry.example.com/mcp/team-catalog:latest`). +4. Select **Import**. + +Using the CLI: + +```console +$ docker mcp catalog pull +``` + +Once imported, the catalog appears alongside the Docker catalog and you can add +its servers to your profiles. + +### Create and manage custom catalogs + +Creating and managing custom catalogs requires the CLI. See +[Custom catalogs](/manuals/ai/mcp-catalog-and-toolkit/cli.md#custom-catalogs) +in the CLI how-to for step-by-step instructions, including: + +- Curating a subset of the Docker catalog +- Adding private servers to a catalog +- Building a focused catalog from scratch +- Pushing a catalog to a registry for your team to import + +## Contribute an MCP server to the catalog + +The MCP server registry is available at +https://github.com/docker/mcp-registry. To submit an MCP server, follow the +[contributing guidelines](https://github.com/docker/mcp-registry/blob/main/CONTRIBUTING.md). + +When your pull request is reviewed and approved, your MCP server is available +within 24 hours on: + +- Docker Desktop's [MCP Toolkit feature](toolkit.md). +- The [Docker MCP Catalog](https://hub.docker.com/mcp). +- The [Docker Hub](https://hub.docker.com/u/mcp) `mcp` namespace (for MCP + servers built by Docker). diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/cli.md b/content/manuals/ai/mcp-catalog-and-toolkit/cli.md new file mode 100644 index 000000000000..dd80b53564a6 --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/cli.md @@ -0,0 +1,385 @@ +--- +title: Use MCP Toolkit from the CLI +linkTitle: Use with CLI +description: Manage MCP profiles, servers, and catalogs using Docker MCP CLI. +keywords: docker mcp, cli, profiles, servers, catalog, gateway +weight: 35 +--- + +{{< summary-bar feature_name="Docker MCP Toolkit" >}} + +> [!NOTE] +> The `docker mcp` commands documented here are available in Docker Desktop +> 4.62 and later. Earlier versions may not support all commands shown. + +The `docker mcp` commands let you manage MCP profiles, servers, OAuth +credentials, and catalogs from the terminal. Use the CLI for scripting, +automation, and headless environments. + +## Profiles + +### Create a profile + +```console +$ docker mcp profile create --name +``` + +The profile ID is used to reference the profile in subsequent commands: + +```console +$ docker mcp profile create --name web-dev +``` + +### List profiles + +```console +$ docker mcp profile list +``` + +### View a profile + +```console +$ docker mcp profile show +``` + +### Remove a profile + +```console +$ docker mcp profile remove +``` + +> [!CAUTION] +> Removing a profile deletes all its server configurations and settings. This +> action can't be undone. + +## Servers + +### Browse the catalog + +List available servers and their IDs: + +```console +$ docker mcp catalog server ls mcp/docker-mcp-catalog +``` + +The output lists each server by name. The name (for example, `playwright` or +`github-official`) is the server ID to use in `catalog://` URIs. + +To look up a server ID in Docker Desktop, open **MCP Toolkit** > **Catalog**, +select a server, and check the **Server ID** field. + +### Add servers to a profile + +Servers are referenced by URI. The URI format depends on where the server +comes from: + +| Format | Source | +| ------------------------------------- | -------------------------- | +| `catalog:///` | An OCI catalog | +| `docker://:` | A Docker image | +| `https:///v0/servers/` | The MCP community registry | +| `file://` | A local YAML or JSON file | + +The most common format is `catalog://`, where `` matches the +**Catalog** field and `` matches the **Server ID** field shown in +Docker Desktop or in the `catalog server ls` output: + +```console +$ docker mcp profile server add \ + --server catalog:/// +``` + +Add multiple servers in one command: + +```console +$ docker mcp profile server add web-dev \ + --server catalog://mcp/docker-mcp-catalog/github-official \ + --server catalog://mcp/docker-mcp-catalog/playwright +``` + +To add a server defined in a local YAML file: + +```console +$ docker mcp profile server add my-profile \ + --server file://./my-server.yaml +``` + +The YAML file defines the server image and configuration: + +```yaml +name: my-server +title: My Server +type: server +image: myimage:latest +description: Description of the server +``` + +If the server requires OAuth authentication, authorize it in Docker Desktop +after adding. See [OAuth authentication](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md#oauth-authentication). + +### List servers + +List all servers across all profiles: + +```console +$ docker mcp profile server ls +``` + +Filter by profile: + +```console +$ docker mcp profile server ls --filter profile=web-dev +``` + +### Remove a server + +```console +$ docker mcp profile server remove --name +``` + +Remove multiple servers at once: + +```console +$ docker mcp profile server remove web-dev \ + --name github-official \ + --name playwright +``` + +### Configure server settings + +Set and retrieve configuration values for servers in a profile: + +```console +$ docker mcp profile config --set .= +$ docker mcp profile config --get-all +$ docker mcp profile config --del . +``` + +Server configuration keys and their expected values are defined by each server. +Check the server's documentation or its entry in Docker Desktop under +**MCP Toolkit** > **Catalog** > **Configuration**. + +## Gateway + +Run the MCP Gateway with a specific profile: + +```console +$ docker mcp gateway run --profile +``` + +Omit `--profile` to use the default profile. + +### Connect a client manually + +To connect any client that isn't listed in Docker Desktop, configure it to run +the gateway over `stdio`. For example, in a JSON-based client configuration: + +```json +{ + "servers": { + "MCP_DOCKER": { + "command": "docker", + "args": ["mcp", "gateway", "run", "--profile", "web-dev"], + "type": "stdio" + } + } +} +``` + +For Claude Desktop, the format is: + +```json +{ + "mcpServers": { + "MCP_DOCKER": { + "command": "docker", + "args": ["mcp", "gateway", "run", "--profile", "web-dev"] + } + } +} +``` + +### Connect a named client + +Connect a supported client to a profile: + +```console +$ docker mcp client connect --profile +``` + +For example, to connect VS Code to a project-specific profile: + +```console +$ docker mcp client connect vscode --profile my-project +``` + +This creates a `.vscode/mcp.json` file in the current directory. Because this +is a user-specific file, add it to `.gitignore`: + +```console +$ echo ".vscode/mcp.json" >> .gitignore +``` + +## Share profiles + +Share profiles with your team using OCI registries or version control. + +### Share via OCI registry + +Profiles are shared as OCI artifacts via any OCI-compatible registry. +Credentials are not included for security reasons. Team members configure +authentication credentials separately after pulling. + +To push an existing profile called `web-dev` to an OCI registry: + +```console +$ docker mcp profile push web-dev registry.example.com/profiles/web-dev:v1 +``` + +To pull the same profile: + +```console +$ docker mcp profile pull registry.example.com/profiles/team-standard:latest +``` + +### Share via version control + +For project-specific profiles, you can use the `export` and `import` commands +and store the profiles in version control alongside your code. Team members can +import the file to get the same configuration. + +To export a profile to your project directory: + +```console +$ mkdir -p .docker +$ docker mcp profile export web-dev .docker/mcp-profile.json +``` + +Team members who clone the repository can import the profile: + +```console +$ docker mcp profile import .docker/mcp-profile.json +``` + +This creates a profile with the servers and configuration defined in the +file. Any authentication credentials must be configured separately if needed. + +## Custom catalogs + +Custom catalogs let you curate a focused collection of servers for your team +or organization. For an overview of what custom catalogs are and when to use +them, see [Custom catalogs](/manuals/ai/mcp-catalog-and-toolkit/catalog.md#custom-catalogs). + +Catalogs are referenced by OCI reference, for example +`registry.example.com/mcp/my-catalog:latest`. Servers within a catalog use +the same URI schemes as when +[adding servers to a profile](#add-servers-to-a-profile). + +### Customize the Docker catalog + +Use the Docker catalog as a base, then add or remove servers to fit your +organization's needs. Copy it first: + +```console +$ docker mcp catalog tag mcp/docker-mcp-catalog \ + registry.example.com/mcp/company-tools:latest +``` + +List the servers it contains: + +```console +$ docker mcp catalog server ls registry.example.com/mcp/company-tools:latest +``` + +Remove servers your organization doesn't approve: + +```console +$ docker mcp catalog server remove \ + registry.example.com/mcp/company-tools:latest \ + --name +``` + +Add your own private servers, packaged as Docker images: + +```console +$ docker mcp catalog server add registry.example.com/mcp/company-tools:latest \ + --server docker://registry.example.com/mcp/internal-api:latest \ + --server docker://registry.example.com/mcp/data-pipeline:latest +``` + +Push when ready: + +```console +$ docker mcp catalog push registry.example.com/mcp/company-tools:latest +``` + +### Build a catalog from scratch + +To include exactly what you choose and nothing else, create a catalog from +scratch. You can include servers from the Docker catalog, your own private +images, or both. + +Create a catalog and specify which servers to include: + +```console +$ docker mcp catalog create registry.example.com/mcp/data-tools:latest \ + --title "Data Analysis Tools" \ + --server catalog://mcp/docker-mcp-catalog/sequentialthinking \ + --server catalog://mcp/docker-mcp-catalog/brave \ + --server docker://registry.example.com/mcp/analytics:latest +``` + +View the result: + +```console +$ docker mcp catalog show registry.example.com/mcp/data-tools:latest +``` + +Push to distribute: + +```console +$ docker mcp catalog push registry.example.com/mcp/data-tools:latest +``` + +### Distribute a catalog + +Push your catalog so team members can import it: + +```console +$ docker mcp catalog push +``` + +Team members can pull it using the CLI: + +```console +$ docker mcp catalog pull +``` + +Or import it using Docker Desktop: select **MCP Toolkit** > **Catalog** > +**Import catalog** and enter the OCI reference. + +### Use a custom catalog with the gateway + +Run the gateway with your catalog instead of the default Docker catalog: + +```console +$ docker mcp gateway run --catalog +``` + +For [Dynamic MCP](/manuals/ai/mcp-catalog-and-toolkit/dynamic-mcp.md), where +agents discover and add servers during conversations, this limits what agents +can find to your curated set. + +To enable specific servers from your catalog without using a profile: + +```console +$ docker mcp gateway run --catalog \ + --servers --servers +``` + +## Further reading + +- [Get started with MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/get-started.md) +- [MCP Profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md) +- [MCP Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) +- [MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md) diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/dynamic-mcp.md b/content/manuals/ai/mcp-catalog-and-toolkit/dynamic-mcp.md new file mode 100644 index 000000000000..4194002b1bc5 --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/dynamic-mcp.md @@ -0,0 +1,152 @@ +--- +title: Dynamic MCP +linkTitle: Dynamic discovery +description: Discover and add MCP servers on-demand using natural language with Dynamic MCP servers +keywords: dynamic mcps, mcp discovery, mcp-find, mcp-add, code-mode, ai agents, model context protocol +weight: 40 +--- + +Dynamic MCP enables AI agents to discover and add MCP servers on-demand during +a conversation, without manual configuration. Instead of pre-configuring every +MCP server before starting your agent session, clients can search the +[MCP Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) and add servers +as needed. + +This capability is enabled automatically when you connect an MCP client to the +[MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md). The gateway +provides a set of primordial tools that agents use to discover and manage +servers during runtime. + +{{% experimental %}} + +Dynamic MCP is an experimental feature in early development. While you're +welcome to try it out and explore its capabilities, you may encounter +unexpected behavior or limitations. Feedback is welcome via at [GitHub +issues](https://github.com/docker/mcp-gateway/issues) for bug reports and +[GitHub discussions](https://github.com/docker/mcp-gateway/discussions) for +general questions and feature requests. + +{{% /experimental %}} + +## How it works + +When you connect a client to the MCP Gateway, the gateway exposes a small set +of management tools alongside any MCP servers in your active profile. These +management tools let agents interact with the gateway's configuration: + +| Tool | Description | +| ---------------- | ------------------------------------------------------------------------ | +| `mcp-find` | Search for MCP servers in the catalog by name or description | +| `mcp-add` | Add a new MCP server to the current session | +| `mcp-config-set` | Configure settings for an MCP server | +| `mcp-remove` | Remove an MCP server from the session | +| `mcp-exec` | Execute a tool by name that exists in the current session | +| `code-mode` | Create a JavaScript-enabled tool that combines multiple MCP server tools | + +With these tools available, an agent can search the catalog, add servers, +handle authentication, and use newly added tools directly without requiring a +restart or manual configuration. + +Dynamically added servers and tools are associated with your _current session +only_. They're not persisted to your profile. When you start a new session, +only servers you've added to your profile through the +[MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) or +[Profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md) are available. + +## Prerequisites + +To use Dynamic MCP, you need: + +- Docker Desktop version 4.50 or later, with [MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) enabled +- An LLM application that supports MCP (such as Claude Desktop, Visual Studio Code, or Claude Code) +- Your client configured to connect to the MCP Gateway + +See [Get started with Docker MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/get-started.md) +for setup instructions. + +## Usage + +Dynamic MCP is enabled automatically when you use the MCP Toolkit. Your +connected clients can now use `mcp-find`, `mcp-add`, and other management tools +during conversations. + +To see Dynamic MCP in action, connect your AI client to the Docker MCP Toolkit +and try this prompt: + +```plaintext +What MCP servers can I use for working with SQL databases? +``` + +Given this prompt, your agent will use the `mcp-find` tool provided by MCP +Toolkit to search for SQL-related servers in the [MCP Catalog](./catalog.md). + +And to add a server to a session, simply write a prompt and the MCP Toolkit +takes care of installing and running the server: + +```plaintext +Add the postgres mcp server +``` + +## Tool composition with code mode + +The `code-mode` tool is available as an experimental capability for creating +custom JavaScript functions that combine multiple MCP server tools. The +intended use case is to enable workflows that coordinate multiple services +in a single operation. + +> **Note** +> +> Code mode is in early development and is not yet reliable for general use. +> The documentation intentionally omits usage examples at this time. +> +> The core Dynamic MCP capabilities (`mcp-find`, `mcp-add`, `mcp-config-set`, +> `mcp-remove`) work as documented and are the recommended focus for current +> use. + +The architecture works as follows: + +1. The agent calls `code-mode` with a list of server names and a tool name +2. The gateway creates a sandbox with access to those servers' tools +3. A new tool is registered in the current session with the specified name +4. The agent calls the newly created tool +5. The code executes in the sandbox with access to the specified tools +6. Results are returned to the agent + +The sandbox can only interact with the outside world through MCP tools, +which are already running in isolated containers with restricted privileges. + +## Security considerations + +Dynamic MCP maintains the same security model as static MCP server +configuration in MCP Toolkit: + +- All servers in the MCP Catalog are built, signed, and maintained by Docker +- Servers run in isolated containers with restricted resources +- Code mode runs agent-written JavaScript in an isolated sandbox that can only + interact through MCP tools +- Credentials are managed by the gateway and injected securely into containers + +The key difference with dynamic capabilities is that agents can add new tools +during runtime. + +## Disabling Dynamic MCP + +Dynamic MCP is enabled by default in the MCP Toolkit. If you prefer to use only +statically configured MCP servers, you can disable the dynamic tools feature: + +```console +$ docker mcp feature disable dynamic-tools +``` + +To re-enable the feature later: + +```console +$ docker mcp feature enable dynamic-tools +``` + +After changing this setting, you may need to restart any connected MCP clients. + +## Further reading + +Check out the [Dynamic MCP servers with Docker](https://docker.com/blog) blog +post for more examples and inspiration on how you can use dynamic tools. diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/e2b-sandboxes.md b/content/manuals/ai/mcp-catalog-and-toolkit/e2b-sandboxes.md new file mode 100644 index 000000000000..d5501b8c4204 --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/e2b-sandboxes.md @@ -0,0 +1,452 @@ +--- +title: E2B sandboxes +description: Cloud-based secure sandboxes for AI agents with built-in Docker MCP Gateway integration +keywords: E2B, cloud sandboxes, MCP Gateway, AI agents, MCP Catalog +aliases: + - /ai/mcp-catalog-and-toolkit/sandboxes/ +--- + +[E2B](https://e2b.dev/) provides secure cloud sandboxes for AI agents with direct access to Docker's [MCP Catalog](https://hub.docker.com/mcp), a collection of 200+ tools from publishers including GitHub, Notion, and Stripe. + +When you create an E2B sandbox, you specify which MCP tools it should access. E2B launches these tools and provides access through the Docker MCP Gateway. + +## Example: Using GitHub and Notion MCP server + +This example demonstrates how to connect multiple MCP servers in an E2B sandbox. You'll analyze data in Notion and create GitHub issues using Claude. + +### Prerequisites + +Before you begin, make sure you have the following: + +- [E2B account](https://e2b.dev/docs/quickstart) with API access +- Anthropic API key for Claude + + > [!NOTE] + > This example uses Claude Code, which is pre-installed in E2B sandboxes. + > However, you can adapt the example to work with other AI assistants of your + > choice. See [E2B's MCP documentation](https://e2b.dev/docs/mcp/quickstart) + > for alternative connection methods. + +- Node.js 18+ installed on your machine +- Notion account with: + - A database containing sample data + - [Integration token](https://www.notion.com/help/add-and-manage-connections-with-the-api) +- GitHub account with: + - A repository for testing + - Personal access token with `repo` scope + +### Set up your environment + +Create a new directory and initialize a Node.js project: + +```console +$ mkdir mcp-e2b-quickstart +$ cd mcp-e2b-quickstart +$ npm init -y +``` + +Configure your project for ES modules by updating `package.json`: + +```json +{ + "name": "mcp-e2b-quickstart", + "version": "1.0.0", + "type": "module", + "scripts": { + "start": "node index.js" + } +} +``` + +Install required dependencies: + +```console +$ npm install e2b dotenv +``` + +Create a `.env` file with your credentials: + +```console +$ cat > .env << 'EOF' +E2B_API_KEY=your_e2b_api_key_here +ANTHROPIC_API_KEY=your_anthropic_api_key_here +NOTION_INTEGRATION_TOKEN=ntn_your_notion_integration_token_here +GITHUB_TOKEN=ghp_your_github_pat_here +EOF +``` + +Protect your credentials: + +```console +$ echo ".env" >> .gitignore +$ echo "node_modules/" >> .gitignore +``` + +### Create an E2B sandbox with MCP servers + +{{< tabs group="" >}} +{{< tab name="Typescript">}} + +Create a file named `index.ts`: + +```typescript +import "dotenv/config"; +import { Sandbox } from "e2b"; + +async function quickstart(): Promise { + console.log("Creating E2B sandbox with Notion and GitHub MCP servers...\n"); + + const sbx: Sandbox = await Sandbox.create({ + envs: { + ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY as string, + }, + mcp: { + notion: { + internalIntegrationToken: process.env + .NOTION_INTEGRATION_TOKEN as string, + }, + githubOfficial: { + githubPersonalAccessToken: process.env.GITHUB_TOKEN as string, + }, + }, + }); + + const mcpUrl = sbx.getMcpUrl(); + const mcpToken = await sbx.getMcpToken(); + + console.log("Sandbox created successfully!"); + console.log(`MCP Gateway URL: ${mcpUrl}\n`); + + // Wait for MCP initialization + await new Promise((resolve) => setTimeout(resolve, 1000)); + + // Connect Claude to MCP gateway + console.log("Connecting Claude to MCP gateway..."); + await sbx.commands.run( + `claude mcp add --transport http e2b-mcp-gateway ${mcpUrl} --header "Authorization: Bearer ${mcpToken}"`, + { + timeoutMs: 0, + onStdout: console.log, + onStderr: console.log, + }, + ); + + console.log("\nConnection successful! Cleaning up..."); + await sbx.kill(); +} + +quickstart().catch(console.error); +``` + +Run the script: + +```console +$ npx tsx index.ts +``` + +{{< /tab >}} +{{< tab name="Python">}} + +Create a file named `index.py`: + +```python +import os +import asyncio +from dotenv import load_dotenv +from e2b import Sandbox + +load_dotenv() + +async def quickstart(): + print("Creating E2B sandbox with Notion and GitHub MCP servers...\n") + + sbx = await Sandbox.beta_create( + envs={ + "ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY"), + }, + mcp={ + "notion": { + "internalIntegrationToken": os.getenv("NOTION_INTEGRATION_TOKEN"), + }, + "githubOfficial": { + "githubPersonalAccessToken": os.getenv("GITHUB_TOKEN"), + }, + }, + ) + + mcp_url = sbx.beta_get_mcp_url() + mcp_token = await sbx.beta_get_mcp_token() + + print("Sandbox created successfully!") + print(f"MCP Gateway URL: {mcp_url}\n") + + # Wait for MCP initialization + await asyncio.sleep(1) + + # Connect Claude to MCP gateway + print("Connecting Claude to MCP gateway...") + + def on_stdout(output): + print(output, end='') + + def on_stderr(output): + print(output, end='') + + await sbx.commands.run( + f'claude mcp add --transport http e2b-mcp-gateway {mcp_url} --header "Authorization: Bearer {mcp_token}"', + timeout_ms=0, + on_stdout=on_stdout, + on_stderr=on_stderr + ) + + print("\nConnection successful! Cleaning up...") + await sbx.kill() + +if __name__ == "__main__": + try: + asyncio.run(quickstart()) + except Exception as e: + print(f"Error: {e}") + +``` + +Run the script: + +```console +$ python index.py +``` + +{{< /tab >}} +{{}} + +You should see: + +```console +Creating E2B sandbox with Notion and GitHub MCP servers... + +Sandbox created successfully! +MCP Gateway URL: https://50005-xxxxx.e2b.app/mcp + +Connecting Claude to MCP gateway... +Added HTTP MCP server e2b-mcp-gateway with URL: https://50005-xxxxx.e2b.app/mcp + +Connection successful! Cleaning up... +``` + +### Test with example workflow + +Now, test the setup by running a simple workflow that searches Notion and creates a GitHub issue. + +{{< tabs group="" >}} +{{< tab name="Typescript">}} + +> [!IMPORTANT] +> +> Replace `owner/repo` in the prompt with your actual GitHub username and repository +> name (for example, `yourname/test-repo`). + +Update `index.ts` with the following example: + +```typescript +import "dotenv/config"; +import { Sandbox } from "e2b"; + +async function exampleWorkflow(): Promise { + console.log("Creating sandbox...\n"); + + const sbx: Sandbox = await Sandbox.create({ + envs: { + ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY as string, + }, + mcp: { + notion: { + internalIntegrationToken: process.env + .NOTION_INTEGRATION_TOKEN as string, + }, + githubOfficial: { + githubPersonalAccessToken: process.env.GITHUB_TOKEN as string, + }, + }, + }); + + const mcpUrl = sbx.getMcpUrl(); + const mcpToken = await sbx.getMcpToken(); + + console.log("Sandbox created successfully\n"); + + // Wait for MCP servers to initialize + await new Promise((resolve) => setTimeout(resolve, 3000)); + + console.log("Connecting Claude to MCP gateway...\n"); + await sbx.commands.run( + `claude mcp add --transport http e2b-mcp-gateway ${mcpUrl} --header "Authorization: Bearer ${mcpToken}"`, + { + timeoutMs: 0, + onStdout: console.log, + onStderr: console.log, + }, + ); + + console.log("\nRunning example: Search Notion and create GitHub issue...\n"); + + const prompt: string = `Using Notion and GitHub MCP tools: +1. Search my Notion workspace for databases +2. Create a test issue in owner/repo titled "MCP Toolkit Test" with description "Testing E2B + Docker MCP integration" +3. Confirm both operations completed successfully`; + + await sbx.commands.run( + `echo '${prompt.replace(/'/g, "'\\''")}' | claude -p --dangerously-skip-permissions`, + { + timeoutMs: 0, + onStdout: console.log, + onStderr: console.log, + }, + ); + + await sbx.kill(); +} + +exampleWorkflow().catch(console.error); +``` + +Run the script: + +```console +$ npx tsx index.ts +``` + +{{< /tab >}} +{{< tab name="Python">}} + +Update `index.py` with this example: + +> [!IMPORTANT] +> +> Replace `owner/repo` in the prompt with your actual GitHub username and repository +> name (for example, `yourname/test-repo`). + +```python +import os +import asyncio +import shlex +from dotenv import load_dotenv +from e2b import Sandbox + +load_dotenv() + +async def example_workflow(): + print("Creating sandbox...\n") + + sbx = await Sandbox.beta_create( + envs={ + "ANTHROPIC_API_KEY": os.getenv("ANTHROPIC_API_KEY"), + }, + mcp={ + "notion": { + "internalIntegrationToken": os.getenv("NOTION_INTEGRATION_TOKEN"), + }, + "githubOfficial": { + "githubPersonalAccessToken": os.getenv("GITHUB_TOKEN"), + }, + }, + ) + + mcp_url = sbx.beta_get_mcp_url() + mcp_token = await sbx.beta_get_mcp_token() + + print("Sandbox created successfully\n") + + # Wait for MCP servers to initialize + await asyncio.sleep(3) + + print("Connecting Claude to MCP gateway...\n") + + def on_stdout(output): + print(output, end='') + + def on_stderr(output): + print(output, end='') + + await sbx.commands.run( + f'claude mcp add --transport http e2b-mcp-gateway {mcp_url} --header "Authorization: Bearer {mcp_token}"', + timeout_ms=0, + on_stdout=on_stdout, + on_stderr=on_stderr + ) + + print("\nRunning example: Search Notion and create GitHub issue...\n") + + prompt = """Using Notion and GitHub MCP tools: +1. Search my Notion workspace for databases +2. Create a test issue in owner/repo titled "MCP Toolkit Test" with description "Testing E2B + Docker MCP integration" +3. Confirm both operations completed successfully""" + + # Escape single quotes for shell + escaped_prompt = prompt.replace("'", "'\\''") + + await sbx.commands.run( + f"echo '{escaped_prompt}' | claude -p --dangerously-skip-permissions", + timeout_ms=0, + on_stdout=on_stdout, + on_stderr=on_stderr + ) + + await sbx.kill() + +if __name__ == "__main__": + try: + asyncio.run(example_workflow()) + except Exception as e: + print(f"Error: {e}") +``` + +Run the script: + +```console +$ python workflow.py +``` + +{{< /tab >}} +{{}} + +You should see: + +```console +Creating sandbox... + +Running example: Search Notion and create GitHub issue... + +## Task Completed Successfully + +I've completed both operations using the Notion and GitHub MCP tools: + +### 1. Notion Workspace Search + +Found 3 databases in your Notion workspace: +- **Customer Feedback** - Database with 12 entries tracking feature requests +- **Product Roadmap** - Planning database with 8 active projects +- **Meeting Notes** - Shared workspace with 45 pages + +### 2. GitHub Issue Creation + +Successfully created test issue: +- **Repository**: your-org/your-repo +- **Issue Number**: #47 +- **Title**: "MCP Test" +- **Description**: "Testing E2B + Docker MCP integration" +- **Status**: Open +- **URL**: https://github.com/your-org/your-repo/issues/47 + +Both operations completed successfully. The MCP servers are properly configured and working. +``` + +The sandbox connected multiple MCP servers and orchestrated a workflow across Notion and GitHub. You can extend this pattern to combine any of the 200+ MCP servers in the Docker MCP Catalog. + +## Related pages + +- [How to build an AI-powered code quality workflow with SonarQube and E2B](/guides/github-sonarqube-sandbox.md) +- [Docker + E2B: Building the Future of Trusted AI](https://www.docker.com/blog/docker-e2b-building-the-future-of-trusted-ai/) +- [Docker Sandboxes](/manuals/ai/sandboxes/_index.md) +- [Docker MCP Toolkit and Catalog](/manuals/ai/mcp-catalog-and-toolkit/_index.md) +- [Docker MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md) +- [E2B MCP documentation](https://e2b.dev/docs/mcp) diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/faqs.md b/content/manuals/ai/mcp-catalog-and-toolkit/faqs.md new file mode 100644 index 000000000000..6d803b1c97dd --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/faqs.md @@ -0,0 +1,114 @@ +--- +title: MCP Toolkit FAQs +linkTitle: FAQs +description: Frequently asked questions related to MCP Catalog and Toolkit security +keywords: MCP, Toolkit, MCP server, MCP client, security, faq +tags: [FAQ] +weight: 70 +--- + +Docker MCP Catalog and Toolkit is a solution for securely building, sharing, and +running MCP tools. This page answers common questions about MCP Catalog and Toolkit security. + +### What process does Docker follow to add a new MCP server to the catalog? + +Developers can submit a pull request to the [Docker MCP Registry](https://github.com/docker/mcp-registry) to propose new servers. Docker provides detailed [contribution guidelines](https://github.com/docker/mcp-registry/blob/main/CONTRIBUTING.md) to help developers meet the required standards. + +Currently, a majority of the servers in the catalog are built directly by Docker. Each server includes attestations such as: + +- Build attestation: Servers are built on Docker Build Cloud. +- Source provenance: Verifiable source code origins. +- Signed SBOMs: Software Bill of Materials with cryptographic signatures. + +> [!NOTE] +> When using the images with [Docker MCP gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md), +> you can verify attestations at runtime using the `docker mcp gateway run +--verify-signatures` CLI command. + + +In addition to Docker-built servers, the catalog includes select servers from trusted registries such as GitHub and HashiCorp. Each third-party server undergoes a verification process that includes: + +- Pulling and building the code in an ephemeral build environment. +- Testing initialization and functionality. +- Verifying that tools can be successfully listed. + +### Under what conditions does Docker reject MCP server submissions? + +Docker rejects MCP server submissions that fail automated testing and validation processes during pull request review. Additionally, Docker reviewers evaluate submissions against specific requirements and reject MCP servers that don't meet these criteria. + +### Does Docker take accountability for malicious MCP servers in the Toolkit? + +Docker’s security measures currently represent a best-effort approach. While Docker implements automated testing, scanning, and metadata extraction for each server in the catalog, these security measures are not yet exhaustive. Docker is actively working to enhance its security processes and expand testing coverage. Enterprise customers can contact their Docker account manager for specific security requirements and implementation details. + +### How are credentials managed for MCP servers? + +Starting with Docker Desktop version 4.43.0, credentials are stored securely in the Docker Desktop VM. The storage implementation depends on the platform (for example, macOS, WSL2). You can manage the credentials using the following CLI commands: + +- `docker mcp secret ls` - List stored credentials +- `docker mcp secret rm` - Remove specific credentials +- `docker mcp oauth revoke` - Revoke OAuth-based credentials + +In the upcoming versions of Docker Desktop, Docker plans to support pluggable storage for these secrets and additional out-of-the-box storage providers to give users more flexibility in managing credentials. + +### Are credentials removed when an MCP server is uninstalled? + +No. MCP servers are not technically uninstalled since they exist as Docker containers pulled to your local Docker Desktop. Removing an MCP server stops the container but leaves the image on your system. Even if the container is deleted, credentials remain stored until you remove them manually. + +### Why don't I see remote MCP servers in the catalog? + +If remote MCP servers aren't visible in the Docker Desktop catalog, your local +catalog may be out of date. Remote servers are indicated by a cloud icon and +include services like GitHub, Notion, and Linear. + +Update your catalog by running: + +```console +$ docker mcp catalog update +``` + +After the update completes, refresh the **Catalog** tab in Docker Desktop. + +### What's the difference between profiles and the catalog? + +The [catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) is the source of +available MCP servers - a library of tools you can choose from. +[Profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md) are collections of +servers you've added to organize your work. Think of the catalog as a library, +and profiles as your personal bookshelves containing the books you've selected +for different purposes. + +### Can I share profiles with my team? + +Yes. Profiles can be pushed to OCI-compliant registries using +`docker mcp profile push my-profile registry.example.com/profiles/my-profile:v1`. +Team members can pull your profile with +`docker mcp profile pull registry.example.com/profiles/my-profile:v1`. Note +that credentials aren't included in shared profiles for security reasons - team +members need to configure OAuth and other credentials separately. + +### Do I need to create a profile to use MCP Toolkit? + +Yes, MCP Toolkit requires a profile to run servers. If you're upgrading from a +version before profiles were introduced, a default profile is automatically +created for you with your existing server configurations. You can create +additional named profiles to organize servers for different projects or +environments. + +### What happens to servers when I switch profiles? + +Each profile contains its own set of servers and configurations. When you run +the gateway with `--profile profile-name`, only servers in that profile are +available to clients. The default profile is used when no profile is specified. +Switching between profiles changes which servers your AI applications can +access. + +### Can I use the same server in multiple profiles? + +Yes. You can add the same MCP server to multiple profiles, each with different +configurations if needed. This is useful when you need the same server with +different settings for different projects or environments. + +## Related pages + +- [Get started with MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/get-started.md) +- [Open-source MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md) diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md b/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md new file mode 100644 index 000000000000..69c4af74f8be --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/get-started.md @@ -0,0 +1,461 @@ +--- +title: Get started with Docker MCP Toolkit +linkTitle: Get started +description: Learn how to quickly install and use the MCP Toolkit to set up servers and clients. +keywords: Docker MCP Toolkit, MCP server, MCP client, AI agents +weight: 5 +params: + test_prompt: Use the GitHub MCP server to show me my open pull requests +--- + +{{< summary-bar feature_name="Docker MCP Toolkit" >}} + +> [!NOTE] +> This page describes the MCP Toolkit interface in Docker Desktop 4.62 and +> later. Earlier versions have a different UI. Upgrade to follow these +> instructions exactly. + +The Docker MCP Toolkit makes it easy to set up, manage, and run containerized +Model Context Protocol (MCP) servers in profiles, and connect them to AI +agents. It provides secure defaults and support for a growing ecosystem of +LLM-based clients. This page shows you how to get started quickly with the +Docker MCP Toolkit. + +## Setup + +Before you begin, make sure you meet the following requirements to get started with Docker MCP Toolkit. + +1. Download and install the latest version of [Docker Desktop](/get-started/get-docker/). +2. Open the Docker Desktop settings and select **Beta features**. +3. Select **Enable Docker MCP Toolkit**. +4. Select **Apply**. + +The **Learning center** in Docker Desktop provides walkthroughs and resources +to help you get started with Docker products and features. On the **MCP +Toolkit** page, the **Get started** walkthrough guides you through installing +an MCP server, connecting a client, and testing your setup. + +Alternatively, follow the step-by-step instructions on this page: + +- [Create a profile](#create-a-profile) - Your workspace for organizing servers +- [Add MCP servers to your profile](#add-mcp-servers) - Select tools from the catalog +- [Connect clients](#connect-clients) - Link AI applications to your profile +- [Verify connections](#verify-connections) - Test that everything works + +Once configured, your AI applications can use all the servers in your profile. + +> [!TIP] +> Prefer working from the terminal? See [Use MCP Toolkit from the CLI](cli.md) +> for instructions on using the `docker mcp` commands. + +## Create a profile + +Profiles organize your MCP servers into collections. Create a profile for your +work: + +> [!NOTE] +> If you're upgrading from a previous version of MCP Toolkit, your existing +> server configurations are already in a `default` profile. You can continue +> using the default profile or create new profiles for different projects. + +1. In Docker Desktop, select **MCP Toolkit** and select the **Profiles** tab. +2. Select **Create profile**. +3. Enter a name for your profile (e.g., "Frontend development"). +4. Optionally, add servers and clients now, or add them later. +5. Select **Create**. + +Your new profile appears in the profiles list. + +## Add MCP servers + +1. In Docker Desktop, select **MCP Toolkit** and select the **Catalog** tab. +2. Browse the catalog and select the servers you want to add. +3. Select the **Add to** button and choose whether you want to add the servers + to an existing profile, or create a new profile. + +If a server requires configuration, a **Configuration Required** badge appears +next to the server's name. You must complete the mandatory configuration before +you can use the server. + +You've now successfully added MCP servers to your profile. Next, connect an MCP +client to use the servers in your profile. + +## Connect clients + +To connect a client to MCP Toolkit: + +1. In Docker Desktop, select **MCP Toolkit** and select the **Clients** tab. +2. Find your application in the list. +3. Select **Connect** to configure the client. + +If your client isn't listed, you can connect the MCP Toolkit manually over +`stdio` by configuring your client to run the gateway with your profile: + +```plaintext +docker mcp gateway run --profile my_profile +``` + +For example, if your client uses a JSON file to configure MCP servers, you may +add an entry like: + +```json {title="Example configuration" +{ + "servers": { + "MCP_DOCKER": { + "command": "docker", + "args": ["mcp", "gateway", "run", "--profile", "my_profile"], + "type": "stdio" + } + } +} +``` + +Consult the documentation of the application you're using for instructions on +how to set up MCP servers manually. + +## Verify connections + +Refer to the relevant section for instructions on how to verify that your setup +is working: + +- [Claude Code](#claude-code) +- [Claude Desktop](#claude-desktop) +- [OpenAI Codex](#codex) +- [Continue](#continue) +- [Cursor](#cursor) +- [Gemini](#gemini) +- [Goose](#goose) +- [LM Studio](#lm-studio) +- [OpenCode](#opencode) +- [Sema4.ai](#sema4) +- [Visual Studio Code](#vscode) +- [Zed](#zed) +- [Mistral Vibe](#mistral-vibe) + +### Claude Code + +If you configured the MCP Toolkit for a specific project, navigate to the +relevant project directory. Then run `claude mcp list`. The output should show +`MCP_DOCKER` with a "connected" status: + +```console +$ claude mcp list +Checking MCP server health... + +MCP_DOCKER: docker mcp gateway run - ✓ Connected +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ claude "{{% param test_prompt %}}" +``` + +### Claude Desktop + +Restart Claude Desktop and check the **Search and tools** menu in the chat +input. You should see the `MCP_DOCKER` server listed and enabled: + +![Claude Desktop](images/claude-desktop.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param test_prompt %}} +``` + +### Codex + +Run `codex mcp list` to view active MCP servers and their statuses. The +`MCP_DOCKER` server should appear in the list with an "enabled" status: + +```console +$ codex mcp list +Name Command Args Env Cwd Status Auth +MCP_DOCKER docker mcp gateway run - - enabled Unsupported +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ codex "{{% param test_prompt %}}" +``` + +### Continue + +Launch the Continue terminal UI by running `cn`. Use the `/mcp` command to view +active MCP servers and their statuses. The `MCP_DOCKER` server should appear in +the list with a "connected" status: + +```plaintext + MCP Servers + + ➤ 🟢 MCP_DOCKER (🔧75 📝3) + 🔄 Restart all servers + ⏹️ Stop all servers + 🔍 Explore MCP Servers + Back + + ↑/↓ to navigate, Enter to select, Esc to go back +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ cn "{{% param test_prompt %}}" +``` + +### Cursor + +Open Cursor. If you configured the MCP Toolkit for a specific project, open the +relevant project directory. Then navigate to **Cursor Settings > Tools & MCP**. +You should see `MCP_DOCKER` under **Installed MCP Servers**: + +![Cursor](images/cursor.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param test_prompt %}} +``` + +### Gemini + +Run `gemini mcp list` to view active MCP servers and their statuses. The +`MCP_DOCKER` should appear in the list with a "connected" status. + +```console +$ gemini mcp list +Configured MCP servers: + +✓ MCP_DOCKER: docker mcp gateway run (stdio) - Connected +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ gemini "{{% param test_prompt %}}" +``` + +### Goose + +{{< tabs >}} +{{< tab name="Desktop app" >}} + +Open the Goose desktop application and select **Extensions** in the sidebar. +Under **Enabled Extensions**, you should see an extension named `Mcpdocker`: + +![Goose desktop app](images/goose.avif) + +{{< /tab >}} +{{< tab name="CLI" >}} + +Run `goose info -v` and look for an entry named `mcpdocker` under extensions. +The status should show `enabled: true`: + +```console +$ goose info -v +… + mcpdocker: + args: + - mcp + - gateway + - run + available_tools: [] + bundled: null + cmd: docker + description: The Docker MCP Toolkit allows for easy configuration and consumption of MCP servers from the Docker MCP Catalog + enabled: true + env_keys: [] + envs: {} + name: mcpdocker + timeout: 300 + type: stdio +``` + +{{< /tab >}} +{{< /tabs >}} + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param "test_prompt" %}} +``` + +### LM Studio + +Restart LM Studio and start a new chat. Open the integrations menu and look for +an entry named `mcp/mcp-docker`. Use the toggle to enable the server: + +![LM Studio](images/lm-studio.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param "test_prompt" %}} +``` + +### OpenCode + +The OpenCode configuration file (at `~/.config/opencode/opencode.json` by +default) contains the setup for MCP Toolkit: + +```json +{ + "mcp": { + "MCP_DOCKER": { + "type": "local", + "command": ["docker", "mcp", "gateway", "run"], + "enabled": true + } + }, + "$schema": "https://opencode.ai/config.json" +} +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ opencode "{{% param "test_prompt" %}}" +``` + +### Sema4.ai Studio {#sema4} + +In Sema4.ai Studio, select **Actions** in the sidebar, then select the **MCP +Servers** tab. You should see Docker MCP Toolkit in the list: + +![Docker MCP Toolkit in Sema4.ai Studio](./images/sema4-mcp-list.avif) + +To use MCP Toolkit with Sema4.ai, add it as an agent action. Find the agent you +want to connect to the MCP Toolkit and open the agent editor. Select **Add +Action**, enable Docker MCP Toolkit in the list, then save your agent: + +![Editing an agent in Sema4.ai Studio](images/sema4-edit-agent.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param test_prompt %}} +``` + +### Visual Studio Code {#vscode} + +Open Visual Studio Code. If you configured the MCP Toolkit for a specific +project, open the relevant project directory. Then open the **Extensions** +pane. You should see the `MCP_DOCKER` server listed under installed MCP +servers. + +![MCP_DOCKER installed in Visual Studio Code](images/vscode-extensions.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param test_prompt %}} +``` + +### Zed + +Launch Zed and open agent settings: + +![Opening Zed agent settings from command palette](images/zed-cmd-palette.avif) + +Ensure that `MCP_DOCKER` is listed and enabled in the MCP Servers section: + +![MCP_DOCKER in Zed's agent settings](images/zed-agent-settings.avif) + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```plaintext +{{% param test_prompt %}} +``` + +### Mistral Vibe + +Mistral Vibe uses a TOML configuration file at `~/.vibe/config.toml`. Add the +MCP Toolkit as a stdio MCP server in the `[[mcp_servers]]` section: + +{{< tabs >}} +{{< tab name="Linux" >}} + +```toml +[[mcp_servers]] +name = "MCP_DOCKER" +transport = "stdio" +command = ["docker"] +args = ["mcp", "gateway", "run", "--profile", "my_profile"] +startup_timeout_sec = 60 +disabled = false +``` + +{{< /tab >}} +{{< tab name="macOS" >}} + +```toml +[[mcp_servers]] +name = "MCP_DOCKER" +transport = "stdio" +command = ["docker"] +args = ["mcp", "gateway", "run", "--profile", "my_profile"] +startup_timeout_sec = 60 +disabled = false +``` + +{{< /tab >}} +{{< tab name="Windows" >}} + +On Windows, the Docker installation path (`C:\Program Files\Docker\...`) +contains a space. Use a list for `command` with the full path to `docker.exe`, +and add `PROGRAMFILES` and `PROGRAMDATA` environment variables that the MCP +Python SDK doesn't inherit by default: + +```toml +[[mcp_servers]] +name = "MCP_DOCKER" +transport = "stdio" +command = ["C:/Program Files/Docker/Docker/resources/bin/docker.exe"] +args = ["mcp", "gateway", "run", "--profile", "my_profile"] +env = { PROGRAMFILES = "C:\\Program Files", PROGRAMDATA = "C:\\ProgramData" } +startup_timeout_sec = 60 +disabled = false +``` + +{{< /tab >}} +{{< /tabs >}} + +The `startup_timeout_sec = 60` is recommended because the Docker MCP Gateway +takes approximately 15-25 seconds to start. The default timeout is 10 seconds, +which isn't enough for the gateway to initialize. + +Restart Vibe. In a Vibe CLI session, run `/mcp` to view active MCP servers. +The `MCP_DOCKER` server should appear in the list: + +```console +$ vibe +> /mcp +``` + +Test the connection by submitting a prompt that invokes one of your installed +MCP servers: + +```console +$ vibe "{{% param test_prompt %}}" +``` + +## Further reading + +- [MCP Profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md) +- [MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) +- [MCP Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) +- [MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md) diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/ask-gordon.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/ask-gordon.avif new file mode 100644 index 000000000000..9bd35d4f3f72 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/ask-gordon.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/claude-desktop.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/claude-desktop.avif new file mode 100644 index 000000000000..e574f4874094 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/claude-desktop.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/copilot-mode.png b/content/manuals/ai/mcp-catalog-and-toolkit/images/copilot-mode.png new file mode 100644 index 000000000000..9ce6e961c5c6 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/copilot-mode.png differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/cursor.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/cursor.avif new file mode 100644 index 000000000000..f092705f87b3 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/cursor.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/goose.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/goose.avif new file mode 100644 index 000000000000..3753df012199 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/goose.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/lm-studio.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/lm-studio.avif new file mode 100644 index 000000000000..b317ee569dac Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/lm-studio.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/mcp_toolkit.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/mcp_toolkit.avif new file mode 100644 index 000000000000..2b33fe673146 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/mcp_toolkit.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-edit-agent.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-edit-agent.avif new file mode 100644 index 000000000000..b143bee1267f Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-edit-agent.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-mcp-list.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-mcp-list.avif new file mode 100644 index 000000000000..92f7a0617e5c Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/sema4-mcp-list.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/tools.png b/content/manuals/ai/mcp-catalog-and-toolkit/images/tools.png new file mode 100644 index 000000000000..4439dc4b5e1f Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/tools.png differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/vscode-extensions.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/vscode-extensions.avif new file mode 100644 index 000000000000..9cd229474f21 Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/vscode-extensions.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-agent-settings.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-agent-settings.avif new file mode 100644 index 000000000000..6df7e69785ed Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-agent-settings.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-cmd-palette.avif b/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-cmd-palette.avif new file mode 100644 index 000000000000..540dc673106f Binary files /dev/null and b/content/manuals/ai/mcp-catalog-and-toolkit/images/zed-cmd-palette.avif differ diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md b/content/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md new file mode 100644 index 000000000000..f430b1ea55ca --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md @@ -0,0 +1,95 @@ +--- +title: MCP Gateway +linkTitle: Gateway +description: "Docker's MCP Gateway provides secure, centralized, and scalable orchestration of AI tools through containerized MCP servers, empowering developers, operators, and security teams." +keywords: MCP Gateway +weight: 40 +aliases: + - /ai/mcp-gateway/ +--- + +> [!NOTE] +> MCP Gateway as part of Docker AI Governance is an invite-only feature. [Contact Docker Sales](https://www.docker.com/pricing/contact-sales/) to learn more. + +The MCP Gateway is Docker's open source solution for orchestrating Model +Context Protocol (MCP) servers. It acts as a centralized proxy between clients +and servers, managing configuration, credentials, and access control. + +When using MCP servers without the MCP Gateway, you need to configure +applications individually for each AI application. With the MCP Gateway, you +configure applications to connect to the Gateway. The Gateway then handles +server lifecycle, routing, and authentication across all servers in your +[profiles](/manuals/ai/mcp-catalog-and-toolkit/profiles.md). + +If you use Docker Desktop with MCP Toolkit enabled, the Gateway runs +automatically in the background. You don't need to start or configure it +manually. This documentation is for users who want to understand how the Gateway works or run it directly for advanced use cases. + +> [!TIP] +> E2B sandboxes now include direct access to the Docker MCP Catalog, giving developers +> access to over 200 tools and services to seamlessly build and run AI agents. For +> more information, see [E2B Sandboxes](e2b-sandboxes.md). + +## How it works + +MCP Gateway runs MCP servers in isolated Docker containers with restricted +privileges, network access, and resource usage. It includes built-in logging +and call-tracing capabilities to ensure full visibility and governance of AI +tool activity. + +The MCP Gateway manages the server's entire lifecycle. When an AI application +needs to use a tool, it sends a request to the Gateway. The Gateway identifies +which server handles that tool and, if the server isn't already running, starts +it as a Docker container. The Gateway then injects any required credentials, +applies security restrictions, and forwards the request to the server. The +server processes the request and returns the result through the Gateway back to +the AI application. + +The MCP Gateway solves a fundamental problem: MCP servers are just programs +that need to run somewhere. Running them directly on your machine means dealing +with installation, dependencies, updates, and security risks. By running them +as containers managed by the Gateway, you get isolation, consistent +environments, and centralized control. + +The Gateway works with profiles to determine which servers are available. When +you run the Gateway, you specify which profile to use with the `--profile` flag +to determine which servers are made available to clients. + +## Usage + +To use the MCP Gateway, you'll need Docker Desktop with MCP Toolkit enabled. +Follow the [MCP Toolkit guide](toolkit.md) to enable and configure servers +through the Docker Desktop interface, or see +[Use MCP Toolkit from the CLI](cli.md) for terminal-based workflows. + +### Install the MCP Gateway manually + +For Docker Engine without Docker Desktop, you'll need to download and install +the MCP Gateway separately before you can run it. + +1. Download the latest binary from the [GitHub releases page](https://github.com/docker/mcp-gateway/releases/latest). + +2. Move or symlink the binary to the destination matching your OS: + + | OS | Binary destination | + | ------- | ----------------------------------- | + | Linux | `~/.docker/cli-plugins/docker-mcp` | + | macOS | `~/.docker/cli-plugins/docker-mcp` | + | Windows | `%USERPROFILE%\.docker\cli-plugins` | + +3. Make the binaries executable: + + ```bash + $ chmod +x ~/.docker/cli-plugins/docker-mcp + ``` + +You can now use the `docker mcp` command: + +```bash +docker mcp --help +``` + +## Additional information + +For more details on how the MCP Gateway works and available customization +options, see the complete documentation [on GitHub](https://github.com/docker/mcp-gateway). diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/profiles.md b/content/manuals/ai/mcp-catalog-and-toolkit/profiles.md new file mode 100644 index 000000000000..8529872e4275 --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/profiles.md @@ -0,0 +1,268 @@ +--- +title: MCP Profiles +linkTitle: Profiles +description: Organize MCP servers into profiles for different projects and environments +keywords: Docker MCP, profiles, MCP servers, configuration, sharing +weight: 25 +--- + +{{< summary-bar feature_name="MCP Profiles" >}} + +Profiles organize your MCP servers into named collections. Without profiles, +you'd configure servers separately for every AI application you use. Each time +you want to change which servers are available, you'd update Claude Desktop, VS +Code, Cursor, and other tools individually. Profiles solve this by centralizing +your server configurations. + +## What profiles do + +A profile is a named collection of MCP servers with their configurations and +settings. You select servers from the [MCP +Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) (the source of +available servers) and add them to your profiles (your configured server +collections for specific work). Think of the catalog as a library of tools, and +profiles as your toolboxes organized for different jobs. + +Your "web-dev" profile might include GitHub, Playwright, and database servers. +Your "data-analysis" profile might include spreadsheet, API, and visualization +servers. Connect different AI clients to different profiles, or switch between +profiles as you change tasks. + +When you run the MCP Gateway or connect a client without specifying a profile, +Docker MCP uses your default profile. If you're upgrading from a previous +version of MCP Toolkit, your existing server configurations are already in the +default profile. + +## Profile capabilities + +Each profile maintains its own isolated collection of servers and +configurations. Your "web-dev" profile might include GitHub, Playwright, and +database servers, while your "data-analysis" profile includes spreadsheet, API, +and visualization servers. Create as many profiles as you need, each containing +only the servers relevant to that context. + +> [!NOTE] +> +> OAuth credentials are an exception to profile isolation — they are shared +> across all profiles. If you need to use different accounts for different +> projects, revoke and re-authorize when switching profiles. + +You can connect different AI applications to different profiles. When you +connect a client, you specify which profile it should use. This means Claude +Desktop and VS Code can have access to different server collections if needed. + +Profiles can be shared with your team. Push a profile to your registry, and +team members can pull it to get the exact same server collection and +configuration you use. + +## Creating and managing profiles + +### Create a profile + +1. In Docker Desktop, select **MCP Toolkit** and select the **Profiles** tab. +2. Select **Create profile**. +3. Enter a name for your profile (e.g., "web-dev"). +4. Optionally, search and add servers to your profile now, or add them later. +5. Optionally, search and add clients to connect to your profile. +6. Select **Create**. + +Your new profile appears in the profiles list. + +### View profile details + +Select a profile in the **Profiles** tab to view its details. The profile view +has two tabs: + +- **Overview**: Shows the servers in your profile, secrets configuration, and + connected clients. Use the **+** buttons to add more servers or clients. +- **Tools**: Lists all available tools from your profile's servers. You can + enable or disable individual tools. + +### Remove a profile + +1. In the **Profiles** tab, find the profile you want to remove. +2. Select ⋮ next to the profile name, and then **Delete**. +3. Confirm the removal. + +> [!CAUTION] +> Removing a profile deletes all its server configurations and settings, and +> updates the client configuration (removes MCP Toolkit). This action can't be +> undone. + +### Default profile + +When you run the MCP Gateway or use MCP Toolkit without specifying a profile, +Docker MCP uses a profile named `default`, or an empty configuration if a +`default` profile does not exist. + +If you're upgrading from a previous version of MCP Toolkit, your existing +server configurations automatically migrate to the `default` profile. You don't +need to manually recreate your setup - everything continues to work as before. + +You can always specify a different profile using the `--profile` flag with the +gateway command: + +```console +$ docker mcp gateway run --profile web-dev +``` + +## Adding servers to profiles + +Profiles contain the MCP servers you select from the catalog. Add servers to +organize your tools for specific workflows. + +### Add a server + +You can add servers to a profile in two ways. + +From the Catalog tab: + +1. Select the **Catalog** tab. +2. Select the checkbox next to servers you want to add to see which profile to + add them to. +3. Choose your profile from the drop-down. + +From within a profile: + +1. Select the **Profiles** tab and select your profile. +2. In the **Servers** section, select the **+** button. +3. Search for and select servers to add. + +If a server requires OAuth authentication, you're prompted to authorize it. See +[OAuth authentication](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md#oauth-authentication) +for details. + +### List servers in a profile + +Select a profile in the **Profiles** tab to see all servers it contains. + +### Remove a server + +1. Select the **Profiles** tab and select your profile. +2. In the **Servers** section, find the server you want to remove. +3. Select the delete icon next to the server. + +## Configuring profiles + +### Server configuration + +Some servers require configuration beyond authentication. Configure server +settings within your profile. + +1. Select the **Profiles** tab and select your profile. +2. In the **Servers** section, select the configure icon next to the server. +3. Adjust the server's configuration settings as needed. + +### OAuth credentials + +OAuth credentials are shared across all profiles. When you authorize access to +a service like GitHub or Notion, that authorization is available to any server +in any profile that needs it. + +This means all profiles use the same OAuth credentials for a given service. If +you need to use different accounts for different projects, you'll need to +revoke and re-authorize between switching profiles. + +See [OAuth authentication](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md#oauth-authentication) +for details on authorizing servers. + +### Configuration persistence + +Profile configurations persist in your Docker installation. When you restart +Docker Desktop or your system, your profiles, servers, and configurations +remain intact. + +## Sharing profiles + +Profiles can be shared with your team by pushing them to OCI-compliant +registries as artifacts. This is useful for distributing standardized MCP +setups across your organization. Credentials are not included in shared +profiles for security reasons. Team members configure OAuth separately after +pulling. + +### Push a profile + +1. Select the profile you want to share in the **Profiles** tab. +2. Select **Push to Registry**. +3. Enter the registry destination (e.g., `registry.example.com/profiles/web-dev:v1`). +4. Complete authentication if required. + +### Pull a profile + +1. Select **Pull from Registry** in the **Profiles** tab. +2. Enter the registry reference (e.g., `registry.example.com/profiles/team-standard:latest`). +3. Complete authentication if required. + +The profile is downloaded and added to your profiles list. Configure any +required OAuth credentials separately. + +### Team collaboration workflow + +A typical workflow for sharing profiles across a team: + +1. Create and configure a profile with the servers your team needs. +2. Test the profile to ensure it works as expected. +3. Push the profile to your team's registry with a version tag (e.g., + `registry.example.com/profiles/team-dev:v1`). +4. Share the registry reference with your team. +5. Team members pull the profile and configure any required OAuth credentials. + +This ensures everyone uses the same server collection and configuration, +reducing setup time and inconsistencies. + +## Using profiles with clients + +When you connect an AI client to the MCP Gateway, you specify which profile's +servers the client can access. + +### Run the gateway with a profile + +Connect clients to your profile through the **Clients** section in the MCP +Toolkit. You can add clients when creating a profile or add them to existing +profiles later. + +### Configure clients for specific profiles + +When setting up a client manually, you can specify which profile the client +uses. This lets different clients connect to different profiles. + +For example, your Claude Desktop configuration might use: + +```json +{ + "mcpServers": { + "MCP_DOCKER": { + "command": "docker", + "args": ["mcp", "gateway", "run", "--profile", "claude-work"] + } + } +} +``` + +While your VS Code configuration uses a different profile: + +```json +{ + "mcp": { + "servers": { + "MCP_DOCKER": { + "command": "docker", + "args": ["mcp", "gateway", "run", "--profile", "vscode-dev"], + "type": "stdio" + } + } + } +} +``` + +### Switching between profiles + +To switch the profile your clients use, update the client configuration to +specify a different `--profile` value in the gateway command arguments. + +## Further reading + +- [Get started with MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/get-started.md) +- [Use MCP Toolkit from the CLI](/manuals/ai/mcp-catalog-and-toolkit/cli.md) +- [MCP Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) +- [MCP Toolkit](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) diff --git a/content/manuals/ai/mcp-catalog-and-toolkit/toolkit.md b/content/manuals/ai/mcp-catalog-and-toolkit/toolkit.md new file mode 100644 index 000000000000..7a851c17effe --- /dev/null +++ b/content/manuals/ai/mcp-catalog-and-toolkit/toolkit.md @@ -0,0 +1,199 @@ +--- +title: Docker MCP Toolkit +linkTitle: Toolkit UI +description: Use the MCP Toolkit to set up MCP servers and MCP clients. +keywords: Docker MCP Toolkit, MCP server, MCP client, AI agents +weight: 30 +aliases: + - /desktop/features/gordon/mcp/gordon-mcp-server/ + - /ai/gordon/mcp/gordon-mcp-server/ +--- + +{{< summary-bar feature_name="Docker MCP Toolkit" >}} + +> [!NOTE] +> This page describes the MCP Toolkit interface in Docker Desktop 4.62 and +> later. Earlier versions have a different UI. Upgrade to follow these +> instructions exactly. + +The Docker MCP Toolkit is a management interface integrated into Docker Desktop +that lets you set up, manage, and run containerized MCP servers in profiles and +connect them to AI agents. It removes friction from tool usage by offering +secure defaults, easy setup, and support for a growing ecosystem of LLM-based +clients. It is the fastest way from MCP tool discovery to local execution. + +## Key features + +- Cross-LLM compatibility: Works with Claude, Cursor, and other MCP clients. +- Integrated tool discovery: Browse and launch MCP servers from the Docker MCP Catalog directly in Docker Desktop. +- Zero manual setup: No dependency management, runtime configuration, or setup required. +- Profile-based organization: Create separate server collections for different projects or environments. +- Organizes MCP servers into profiles, acting as a gateway for clients to access the servers in each profile. + +> [!TIP] +> The MCP Toolkit includes [Dynamic MCP](/manuals/ai/mcp-catalog-and-toolkit/dynamic-mcp.md), +> which enables AI agents to discover, add, and compose MCP servers on-demand during +> conversations, without manual configuration. Your agent can search the catalog and +> add tools as needed when you connect to the gateway. + +## How the MCP Toolkit works + +MCP introduces two core concepts: MCP clients and MCP servers. + +- MCP clients are typically embedded in LLM-based applications, such as the + Claude Desktop app. They request resources or actions. +- MCP servers are launched by the client to perform the requested tasks, using + any necessary tools, languages, or processes. + +Docker standardizes the development, packaging, and distribution of +applications, including MCP servers. By packaging MCP servers as containers, +Docker eliminates issues related to isolation and environment differences. You +can run a container directly, without managing dependencies or configuring +runtimes. + +Depending on the MCP server, the tools it provides might run within the same +container as the server or in dedicated containers for better isolation. + +The MCP Toolkit organizes servers into profiles: named collections of servers +with their configurations. This lets you maintain different server setups for +different projects or environments. When you connect a client, you specify +which profile it should use. + +## Security + +The Docker MCP Toolkit combines passive and active measures to reduce attack +surfaces and ensure safe runtime behavior. + +### Passive security + +Passive security refers to measures implemented at build-time, when the MCP +server code is packaged into a Docker image. + +- Image signing and attestation: All MCP server images under `mcp/` in the [MCP + Catalog](catalog.md) are built by Docker and digitally signed to verify their + source and integrity. Each image includes a Software Bill of Materials (SBOM) + for full transparency. + +### Active security + +Active security refers to security measures at runtime, before and after tools +are invoked, enforced through resource and access limitations. + +- CPU allocation: MCP tools are run in their own container. They are + restricted to 1 CPU, limiting the impact of potential misuse of computing + resources. + +- Memory allocation: Containers for MCP tools are limited to 2 GB. + +- Filesystem access: By default, MCP Servers have no access to the host filesystem. + The user explicitly selects the servers that will be granted file mounts. + +- Interception of tool requests: Requests to and from tools that contain sensitive + information such as secrets are blocked. + +### OAuth authentication + +Some MCP servers require authentication to access external services like +GitHub, Notion, and Linear. The MCP Toolkit handles OAuth authentication +automatically. You authorize access through your browser, and the Toolkit +manages credentials securely. You don't need to manually create API tokens or +configure authentication for each service. + +#### Authorize a server with OAuth + +1. In Docker Desktop, go to **MCP Toolkit** and select the **Catalog** tab. +2. Find and add an MCP server that requires OAuth. +3. In the server's **Configuration** tab, select the **OAuth** authentication + method. Follow the link to begin the OAuth authorization. +4. Your browser opens the authorization page for the service. Follow the + on-screen instructions to complete authentication. +5. Return to Docker Desktop when authentication is complete. + +View all authorized services in the **OAuth** tab. To revoke access, select +**Revoke** next to the service you want to disconnect. + +## Usage examples + +### Example: Use Claude Desktop as a client + +Imagine you have Claude Desktop installed, and you want to use the GitHub MCP +server and the Puppeteer MCP server. You do not have to install the servers in +Claude Desktop. You can add these 2 MCP servers to your profile in the MCP +Toolkit and connect Claude Desktop as a client: + +1. From the **MCP Toolkit** menu, select the **Catalog** tab and find the **Puppeteer** server and add it to your profile. +1. Repeat for the **GitHub Official** server. +1. From the **Clients** tab, select **Connect** next to **Claude Desktop**. Restart + Claude Desktop if it's running, and it can now access all the servers in the MCP Toolkit. +1. Within Claude Desktop, run a test by submitting the following prompt using the Sonnet 3.5 model: + + ```text + Take a screenshot of docs.docker.com and then invert the colors + ``` + +### Example: Use Visual Studio Code as a client + +You can interact with all your installed MCP servers in Visual Studio Code: + +1. To enable the MCP Toolkit: + + {{< tabs group="" >}} + {{< tab name="Enable globally">}} + 1. Insert the following in your Visual Studio Code's User `mcp.json`: + + ```json + "mcp": { + "servers": { + "MCP_DOCKER": { + "command": "docker", + "args": [ + "mcp", + "gateway", + "run", + "--profile", + "my_profile" + ], + "type": "stdio" + } + } + } + ``` + + {{< /tab >}} + {{< tab name="Enable for a given project">}} + 1. In your terminal, navigate to your project's folder. + 1. Run: + + ```bash + docker mcp client connect vscode --profile my_profile + ``` + + > [!NOTE] + > This command creates a `.vscode/mcp.json` file in the current directory + > that connects VSCode to your profile. As this is a user-specific file, + > add it to your `.gitignore` file to prevent it from being committed to + > the repository. + > + > ```console + > echo ".vscode/mcp.json" >> .gitignore + > ``` + +{{< /tab >}} +{{}} + +1. In Visual Studio Code, open a new Chat and select the **Agent** mode: + + ![Copilot mode switching](./images/copilot-mode.png) + +1. You can also check the available MCP tools: + + ![Displaying tools in VSCode](./images/tools.png) + +For more information about the Agent mode, see the +[Visual Studio Code documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_use-mcp-tools-in-agent-mode). + +## Further reading + +- [Use MCP Toolkit from the CLI](/manuals/ai/mcp-catalog-and-toolkit/cli.md) +- [MCP Catalog](/manuals/ai/mcp-catalog-and-toolkit/catalog.md) +- [MCP Gateway](/manuals/ai/mcp-catalog-and-toolkit/mcp-gateway.md) diff --git a/content/manuals/ai/model-runner.md b/content/manuals/ai/model-runner.md deleted file mode 100644 index 1f8aab071af9..000000000000 --- a/content/manuals/ai/model-runner.md +++ /dev/null @@ -1,373 +0,0 @@ ---- -title: Docker Model Runner -params: - sidebar: - badge: - color: blue - text: Beta - group: AI -weight: 20 -description: Learn how to use Docker Model Runner to manage and run AI models. -keywords: Docker, ai, model runner, docker deskotp, llm -aliases: - - /desktop/features/model-runner/ ---- - -{{< summary-bar feature_name="Docker Model Runner" >}} - -The Docker Model Runner plugin lets you: - -- [Pull models from Docker Hub](https://hub.docker.com/u/ai) -- Run AI models directly from the command line -- Manage local models (add, list, remove) -- Interact with models using a submitted prompt or in chat mode in the CLI or Docker Desktop Dashboard -- Push models to Docker Hub - -Models are pulled from Docker Hub the first time they're used and stored locally. They're loaded into memory only at runtime when a request is made, and unloaded when not in use to optimize resources. Since models can be large, the initial pull may take some time — but after that, they're cached locally for faster access. You can interact with the model using [OpenAI-compatible APIs](#what-api-endpoints-are-available). - -> [!TIP] -> -> Using Testcontainers or Docker Compose? [Testcontainers for Java](https://java.testcontainers.org/modules/docker_model_runner/) and [Go](https://golang.testcontainers.org/modules/dockermodelrunner/), and [Docker Compose](/manuals/compose/how-tos/model-runner.md) now support Docker Model Runner. - -## Enable Docker Model Runner - -1. Navigate to the **Features in development** tab in settings. -2. Under the **Experimental features** tab, select **Access experimental features**. -3. Select **Apply and restart**. -4. Quit and reopen Docker Desktop to ensure the changes take effect. -5. Open the **Settings** view in Docker Desktop. -6. Navigate to **Features in development**. -7. From the **Beta** tab, check the **Enable Docker Model Runner** setting. - -You can now use the `docker model` command in the CLI and view and interact with your local models in the **Models** tab in the Docker Desktop Dashboard. - -## Available commands - -### Model runner status - -Check whether the Docker Model Runner is active: - -```console -$ docker model status -``` - -### View all commands - -Displays help information and a list of available subcommands. - -```console -$ docker model help -``` - -Output: - -```text -Usage: docker model COMMAND - -Commands: - list List models available locally - pull Download a model from Docker Hub - rm Remove a downloaded model - run Run a model interactively or with a prompt - status Check if the model runner is running - version Show the current version -``` - -### Pull a model - -Pulls a model from Docker Hub to your local environment. - -```console -$ docker model pull -``` - -Example: - -```console -$ docker model pull ai/smollm2 -``` - -Output: - -```text -Downloaded: 257.71 MB -Model ai/smollm2 pulled successfully -``` - -The models also display in the Docker Desktop Dashboard. - -### List available models - -Lists all models currently pulled to your local environment. - -```console -$ docker model list -``` - -You will see something similar to: - -```text -+MODEL PARAMETERS QUANTIZATION ARCHITECTURE MODEL ID CREATED SIZE -+ai/smollm2 361.82 M IQ2_XXS/Q4_K_M llama 354bf30d0aa3 3 days ago 256.35 MiB -``` - -### Run a model - -Run a model and interact with it using a submitted prompt or in chat mode. - -#### One-time prompt - -```console -$ docker model run ai/smollm2 "Hi" -``` - -Output: - -```text -Hello! How can I assist you today? -``` - -#### Interactive chat - -```console -$ docker model run ai/smollm2 -``` - -Output: - -```text -Interactive chat mode started. Type '/bye' to exit. -> Hi -Hi there! It's SmolLM, AI assistant. How can I help you today? -> /bye -Chat session ended. -``` - -> [!TIP] -> -> You can also use chat mode in the Docker Desktop Dashboard when you select the model in the **Models** tab. - -### Push a model to Docker Hub - -Use the following command to push your model to Docker Hub: - -```console -$ docker model push / -``` - -### Tag a model - -You can specify a particular version or variant of the model: - -```console -$ docker model tag -``` - -If no tag is provided, Docker defaults to `latest`. - -### View the logs - -Fetch logs from Docker Model Runner to monitor activity or debug issues. - -```console -$ docker model logs -``` - -The following flags are accepted: - -- `-f`/`--follow`: View logs with real-time streaming -- `--no-engines`: Exclude inference engine logs from the output - -### Remove a model - -Removes a downloaded model from your system. - -```console -$ docker model rm -``` - -Output: - -```text -Model removed successfully -``` - -## Integrate the Docker Model Runner into your software development lifecycle - -You can now start building your Generative AI application powered by the Docker Model Runner. - -If you want to try an existing GenAI application, follow these instructions. - -1. Set up the sample app. Clone and run the following repository: - - ```console - $ git clone https://github.com/docker/hello-genai.git - ``` - -2. In your terminal, navigate to the `hello-genai` directory. - -3. Run `run.sh` for pulling the chosen model and run the app(s): - -4. Open you app in the browser at the addresses specified in the repository [README](https://github.com/docker/hello-genai). - -You'll see the GenAI app's interface where you can start typing your prompts. - -You can now interact with your own GenAI app, powered by a local model. Try a few prompts and notice how fast the responses are — all running on your machine with Docker. - -## FAQs - -### What models are available? - -All the available models are hosted in the [public Docker Hub namespace of `ai`](https://hub.docker.com/u/ai). - -### What API endpoints are available? - -Once the feature is enabled, the following new APIs are available: - -```text -#### Inside containers #### - -http://model-runner.docker.internal/ - - # Docker Model management - POST /models/create - GET /models - GET /models/{namespace}/{name} - DELETE /models/{namespace}/{name} - - # OpenAI endpoints - GET /engines/llama.cpp/v1/models - GET /engines/llama.cpp/v1/models/{namespace}/{name} - POST /engines/llama.cpp/v1/chat/completions - POST /engines/llama.cpp/v1/completions - POST /engines/llama.cpp/v1/embeddings - Note: You can also omit llama.cpp. - E.g., POST /engines/v1/chat/completions. - -#### Inside or outside containers (host) #### - -Same endpoints on /var/run/docker.sock - - # While still in Beta - Prefixed with /exp/vDD4.40 -``` - -### How do I interact through the OpenAI API? - -#### From within a container - -Examples of calling an OpenAI endpoint (`chat/completions`) from within another container using `curl`: - -```bash -#!/bin/sh - -curl http://model-runner.docker.internal/engines/llama.cpp/v1/chat/completions \ - -H "Content-Type: application/json" \ - -d '{ - "model": "ai/smollm2", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Please write 500 words about the fall of Rome." - } - ] - }' - -``` - -#### From the host using a Unix socket - -Examples of calling an OpenAI endpoint (`chat/completions`) through the Docker socket from the host using `curl`: - -```bash -#!/bin/sh - -curl --unix-socket $HOME/.docker/run/docker.sock \ - localhost/exp/vDD4.40/engines/llama.cpp/v1/chat/completions \ - -H "Content-Type: application/json" \ - -d '{ - "model": "ai/smollm2", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Please write 500 words about the fall of Rome." - } - ] - }' - -``` - -#### From the host using TCP - -In case you want to interact with the API from the host, but use TCP instead of a Docker socket, you can enable the host-side TCP support from the Docker Desktop GUI, or via the [Docker Desktop CLI](/manuals/desktop/features/desktop-cli.md). For example, using `docker desktop enable model-runner --tcp `. - -Afterwards, interact with it as previously documented using `localhost` and the chosen, or the default port. - -```bash -#!/bin/sh - - curl http://localhost:12434/engines/llama.cpp/v1/chat/completions \ - -H "Content-Type: application/json" \ - -d '{ - "model": "ai/smollm2", - "messages": [ - { - "role": "system", - "content": "You are a helpful assistant." - }, - { - "role": "user", - "content": "Please write 500 words about the fall of Rome." - } - ] - }' -``` - -## Known issues - -### `docker model` is not recognised - -If you run a Docker Model Runner command and see: - -```text -docker: 'model' is not a docker command -``` - -It means Docker can't find the plugin because it's not in the expected CLI plugins directory. - -To fix this, create a symlink so Docker can detect it: - -```console -$ ln -s /Applications/Docker.app/Contents/Resources/cli-plugins/docker-model ~/.docker/cli-plugins/docker-model -``` - -Once linked, re-run the command. - -### No safeguard for running oversized models - -Currently, Docker Model Runner doesn't include safeguards to prevent you from launching models that exceed their system’s available resources. Attempting to run a model that is too large for the host machine may result in severe slowdowns or render the system temporarily unusable. This issue is particularly common when running LLMs models without sufficient GPU memory or system RAM. - -### No consistent digest support in Model CLI - -The Docker Model CLI currently lacks consistent support for specifying models by image digest. As a temporary workaround, you should refer to models by name instead of digest. - -## Share feedback - -Thanks for trying out Docker Model Runner. Give feedback or report any bugs you may find through the **Give feedback** link next to the **Enable Docker Model Runner** setting. - -## Disable the feature - -To disable Docker Model Runner: - -1. Open the **Settings** view in Docker Desktop. -2. Navigate to the **Beta** tab in **Features in development**. -3. Clear the **Enable Docker Model Runner** checkbox. -4. Select **Apply & restart**. \ No newline at end of file diff --git a/content/manuals/ai/model-runner/_index.md b/content/manuals/ai/model-runner/_index.md new file mode 100644 index 000000000000..d54acb3b32d8 --- /dev/null +++ b/content/manuals/ai/model-runner/_index.md @@ -0,0 +1,185 @@ +--- +title: Docker Model Runner +linkTitle: Model Runner +params: + sidebar: + group: AI and agents +weight: 30 +description: Learn how to use Docker Model Runner to manage and run AI models. +keywords: Docker, ai, model runner, docker desktop, docker engine, llm, openai, ollama, llama.cpp, vllm, diffusers, cpu, nvidia, cuda, amd, rocm, vulkan, cline, continue, cursor, image generation, stable diffusion +aliases: + - /desktop/features/model-runner/ + - /model-runner/ +--- + +{{< summary-bar feature_name="Docker Model Runner" >}} + +Docker Model Runner (DMR) makes it easy to manage, run, and +deploy AI models using Docker. Designed for developers, +Docker Model Runner streamlines the process of pulling, running, and serving +large language models (LLMs) and other AI models directly from Docker Hub, +any OCI-compliant registry, or [Hugging Face](https://huggingface.co/). + +With seamless integration into Docker Desktop and Docker +Engine, you can serve models via OpenAI and Ollama-compatible APIs, package GGUF files as +OCI Artifacts, and interact with models from both the command line and graphical +interface. + +Whether you're building generative AI applications, experimenting with machine +learning workflows, or integrating AI into your software development lifecycle, +Docker Model Runner provides a consistent, secure, and efficient way to work +with AI models locally. + +## Key features + +- [Pull and push models to and from Docker Hub or any OCI-compliant registry](https://hub.docker.com/u/ai) +- [Pull models from Hugging Face](https://huggingface.co/) +- Serve models on [OpenAI and Ollama-compatible APIs](api-reference.md) for easy integration with existing apps +- Support for [llama.cpp, vLLM, and Diffusers inference engines](inference-engines.md) (vLLM and Diffusers on Linux with NVIDIA GPUs) +- [Generate images from text prompts](inference-engines.md#diffusers) using Stable Diffusion models with the Diffusers backend +- Package GGUF and Safetensors files as OCI Artifacts and publish them to any Container Registry +- Run and interact with AI models directly from the command line or from the Docker Desktop GUI +- [Connect to AI coding tools](ide-integrations.md) like Cline, Continue, Cursor, and Aider +- [Configure context size and model parameters](configuration.md) to tune performance +- [Set up Open WebUI](openwebui-integration.md) for a ChatGPT-like web interface +- Manage local models and display logs +- Display prompt and response details +- Conversational context support for multi-turn interactions + +## Requirements + +Docker Model Runner is supported on the following platforms: + +{{< tabs >}} +{{< tab name="Windows">}} + +Windows(amd64): +- NVIDIA GPUs +- NVIDIA drivers 576.57+ + +Windows(arm64): +- OpenCL for Adreno +- Qualcomm Adreno GPU (6xx series and later) + + > [!NOTE] + > Some llama.cpp features might not be fully supported on the 6xx series. + +{{< /tab >}} +{{< tab name="MacOS">}} + +- Apple Silicon + +{{< /tab >}} +{{< tab name="Linux">}} + +Docker Engine only: + +- Supports CPU, NVIDIA (CUDA), AMD (ROCm), and Vulkan backends +- Requires NVIDIA driver 575.57.08+ when using NVIDIA GPUs + +{{< /tab >}} +{{}} + +## How Docker Model Runner works + +Models are pulled from Docker Hub, an OCI-compliant registry, or +[Hugging Face](https://huggingface.co/) the first time you use them and are +stored locally. They load into memory only at runtime when a request is made, +and unload when not in use to optimize resources. Because models can be large, +the initial pull may take some time. After that, they're cached locally for +faster access. You can interact with the model using +[OpenAI and Ollama-compatible APIs](api-reference.md). + +### Inference engines + +Docker Model Runner supports three inference engines: + +| Engine | Best for | Model format | +|--------|----------|--------------| +| [llama.cpp](inference-engines.md#llamacpp) | Local development, resource efficiency | GGUF (quantized) | +| [vLLM](inference-engines.md#vllm) | Production, high throughput | Safetensors | +| [Diffusers](inference-engines.md#diffusers) | Image generation (Stable Diffusion) | Safetensors | + +llama.cpp is the default engine and works on all platforms. vLLM requires NVIDIA GPUs and is supported on Linux x86_64 and Windows with WSL2. Diffusers enables image generation and requires NVIDIA GPUs on Linux (x86_64 or ARM64). See [Inference engines](inference-engines.md) for detailed comparison and setup. + +### Context size + +Models have a configurable context size (context length) that determines how many tokens they can process. The default varies by model but is typically 2,048-8,192 tokens. You can adjust this per-model: + +```console +$ docker model configure --context-size 8192 ai/qwen2.5-coder +``` + +See [Configuration options](configuration.md) for details on context size and other parameters. + +> [!TIP] +> +> Using Testcontainers or Docker Compose? +> [Testcontainers for Java](https://java.testcontainers.org/modules/docker_model_runner/) +> and [Go](https://golang.testcontainers.org/modules/dockermodelrunner/), and +> [Docker Compose](/manuals/ai/compose/models-and-compose.md) support Docker +> Model Runner. + +## Security and isolation + +### Execution environment + +Docker Model Runner isolates inference engines from your host: + +- On Linux, Docker Model Runner and its inference engines, such as Diffusers, + run inside a container, which provides the isolation boundary. +- On macOS and Windows, the engines don't run inside a container, so Docker + Model Runner runs them in a sandboxed environment (seatbelt/sandbox-exec and Job Objects respectively) + +### Networking + +The Model Runner API is not authenticated. Any client that can reach it, +including other containers on the same Docker network, can pull, load, and +run models, and send inference requests. + +## Known issues + +### `docker model` is not recognised + +If you run a Docker Model Runner command and see: + +```text +docker: 'model' is not a docker command +``` + +It means Docker can't find the plugin because it's not in the expected CLI plugins directory. + +To fix this, create a symlink so Docker can detect it: + +```console +$ ln -s /Applications/Docker.app/Contents/Resources/cli-plugins/docker-model ~/.docker/cli-plugins/docker-model +``` + +Once linked, rerun the command. + +## Privacy and data collection + +Docker Model Runner respects your privacy settings in Docker Desktop. Data collection is controlled by the **Send usage statistics** setting: + +- **Disabled**: No usage data is collected +- **Enabled**: Only minimal, non-personal data is collected: + - [Model names](https://github.com/docker/model-runner/blob/eb76b5defb1a598396f99001a500a30bbbb48f01/pkg/metrics/metrics.go#L96) (via HEAD requests to Docker Hub) + - User agent information + - Whether requests originate from the host or containers + +When using Docker Model Runner with Docker Engine, HEAD requests to Docker Hub are made to track model names, regardless of any settings. + +No prompt content, responses, or personally identifiable information is ever collected. + +## Share feedback + +Thanks for trying out Docker Model Runner. To report bugs or request features, [open an issue on GitHub](https://github.com/docker/model-runner/issues). You can also give feedback through the **Give feedback** link next to the **Enable Docker Model Runner** setting. + +## Next steps + +- [Get started with DMR](get-started.md) - Enable DMR and run your first model +- [API reference](api-reference.md) - OpenAI and Ollama-compatible API documentation +- [Configuration options](configuration.md) - Context size and runtime parameters +- [Inference engines](inference-engines.md) - llama.cpp, vLLM, and Diffusers details +- [IDE integrations](ide-integrations.md) - Connect Cline, Continue, Cursor, and more +- [Open WebUI integration](openwebui-integration.md) - Set up a web chat interface diff --git a/content/manuals/ai/model-runner/api-reference.md b/content/manuals/ai/model-runner/api-reference.md new file mode 100644 index 000000000000..edc36eec9aa4 --- /dev/null +++ b/content/manuals/ai/model-runner/api-reference.md @@ -0,0 +1,439 @@ +--- +title: DMR REST API +description: Reference documentation for the Docker Model Runner REST API endpoints, including OpenAI, Anthropic, and Ollama compatibility. +weight: 30 +keywords: Docker, ai, model runner, rest api, openai, anthropic, ollama, endpoints, documentation, cline, continue, cursor +--- + +Once Model Runner is enabled, new API endpoints are available. You can use +these endpoints to interact with a model programmatically. Docker Model Runner +provides compatibility with OpenAI, Anthropic, and Ollama API formats. + +## Determine the base URL + +The base URL to interact with the endpoints depends on how you run Docker and +which API format you're using. + +{{< tabs >}} +{{< tab name="Docker Desktop">}} + +| Access from | Base URL | +|-------------|----------| +| Containers | `http://model-runner.docker.internal` | +| Host processes (TCP) | `http://localhost:12434` | + +> [!NOTE] +> TCP host access must be enabled. See [Enable Docker Model Runner](get-started.md#enable-docker-model-runner-in-docker-desktop). + +{{< /tab >}} +{{< tab name="Docker Engine">}} + +| Access from | Base URL | +|-------------|----------| +| Containers | `http://172.17.0.1:12434` | +| Host processes | `http://localhost:12434` | + +> [!NOTE] +> The `172.17.0.1` interface may not be available by default to containers + within a Compose project. +> In this case, add an `extra_hosts` directive to your Compose service YAML: +> +> ```yaml +> extra_hosts: +> - "model-runner.docker.internal:host-gateway" +> ``` +> Then you can access the Docker Model Runner APIs at `http://model-runner.docker.internal:12434/` + +{{< /tab >}} +{{}} + +### Base URLs for third-party tools + +When configuring third-party tools that expect OpenAI-compatible APIs, use these base URLs: + +| Tool type | Base URL format | +|-----------|-----------------| +| OpenAI SDK / clients | `http://localhost:12434/engines/v1` | +| Anthropic SDK / clients | `http://localhost:12434` | +| Ollama-compatible clients | `http://localhost:12434` | + +See [IDE and tool integrations](ide-integrations.md) for specific configuration examples. + +## Supported APIs + +Docker Model Runner supports multiple API formats: + +| API | Description | Use case | +|-----|-------------|----------| +| [OpenAI API](#openai-compatible-api) | OpenAI-compatible chat completions, embeddings | Most AI frameworks and tools | +| [Anthropic API](#anthropic-compatible-api) | Anthropic-compatible messages endpoint | Tools built for Claude | +| [Ollama API](#ollama-compatible-api) | Ollama-compatible endpoints | Tools built for Ollama | +| [Image Generation API](#image-generation-api-diffusers) | Diffusers-based image generation | Generating images from text prompts | +| [DMR API](#dmr-native-endpoints) | Native Docker Model Runner endpoints | Model management | + +## OpenAI-compatible API + +DMR implements the OpenAI API specification for maximum compatibility with existing tools and frameworks. + +### Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/engines/v1/models` | GET | [List models](https://platform.openai.com/docs/api-reference/models/list) | +| `/engines/v1/models/{namespace}/{name}` | GET | [Retrieve model](https://platform.openai.com/docs/api-reference/models/retrieve) | +| `/engines/v1/chat/completions` | POST | [Create chat completion](https://platform.openai.com/docs/api-reference/chat/create) | +| `/engines/v1/completions` | POST | [Create completion](https://platform.openai.com/docs/api-reference/completions/create) | +| `/engines/v1/embeddings` | POST | [Create embeddings](https://platform.openai.com/docs/api-reference/embeddings/create) | + +> [!NOTE] +> You can optionally include the engine name in the path: `/engines/llama.cpp/v1/chat/completions`. +> This is useful when running multiple inference engines. + +### Model name format + +When specifying a model in API requests, use the full model identifier including the namespace: + +```json +{ + "model": "ai/smollm2", + "messages": [...] +} +``` + +Common model name formats: +- Docker Hub models: `ai/smollm2`, `ai/llama3.2`, `ai/qwen2.5-coder` +- Tagged versions: `ai/smollm2:360M-Q4_K_M` +- Custom models: `myorg/mymodel` + +### Supported parameters + +The following OpenAI API parameters are supported: + +| Parameter | Type | Description | +|-----------|------|-------------| +| `model` | string | Required. The model identifier. | +| `messages` | array | Required for chat completions. The conversation history. | +| `prompt` | string | Required for completions. The prompt text. | +| `max_tokens` | integer | Maximum tokens to generate. | +| `temperature` | float | Sampling temperature (0.0-2.0). | +| `top_p` | float | Nucleus sampling parameter (0.0-1.0). | +| `stream` | Boolean | Enable streaming responses. | +| `stop` | string/array | Stop sequences. | +| `presence_penalty` | float | Presence penalty (-2.0 to 2.0). | +| `frequency_penalty` | float | Frequency penalty (-2.0 to 2.0). | + +### Limitations and differences from OpenAI + +Be aware of these differences when using DMR's OpenAI-compatible API: + +| Feature | DMR behavior | +|---------|--------------| +| API key | Not required. DMR ignores the `Authorization` header. | +| Function calling | Supported with llama.cpp for compatible models. | +| Vision | Supported for multi-modal models (e.g., LLaVA). | +| JSON mode | Supported via `response_format: {"type": "json_object"}`. | +| Logprobs | Supported. | +| Token counting | Uses the model's native token encoder, which may differ from OpenAI's. | + +## Anthropic-compatible API + +DMR provides [Anthropic Messages API](https://platform.claude.com/docs/en/api/messages) compatibility for tools and frameworks built for Claude. + +### Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/anthropic/v1/messages` | POST | [Create a message](https://platform.claude.com/docs/en/api/messages/create) | +| `/anthropic/v1/messages/count_tokens` | POST | [Count tokens](https://docs.anthropic.com/en/api/messages-count-tokens) | + +### Supported parameters + +The following Anthropic API parameters are supported: + +| Parameter | Type | Description | +|-----------|------|-------------| +| `model` | string | Required. The model identifier. | +| `messages` | array | Required. The conversation messages. | +| `max_tokens` | integer | Maximum tokens to generate. | +| `temperature` | float | Sampling temperature (0.0-1.0). | +| `top_p` | float | Nucleus sampling parameter. | +| `top_k` | integer | Top-k sampling parameter. | +| `stream` | Boolean | Enable streaming responses. | +| `stop_sequences` | array | Custom stop sequences. | +| `system` | string | System prompt. | + +### Example: Chat with Anthropic API + +```bash +curl http://localhost:12434/v1/messages \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "max_tokens": 1024, + "messages": [ + {"role": "user", "content": "Hello!"} + ] + }' +``` + +### Example: Streaming response + +```bash +curl http://localhost:12434/v1/messages \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "max_tokens": 1024, + "stream": true, + "messages": [ + {"role": "user", "content": "Count from 1 to 10"} + ] + }' +``` + +## Ollama-compatible API + +DMR also provides Ollama-compatible endpoints for tools and frameworks built for Ollama. + +### Endpoints + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/api/tags` | GET | List available models | +| `/api/show` | POST | Show model information | +| `/api/chat` | POST | Generate chat completion | +| `/api/generate` | POST | Generate completion | +| `/api/embeddings` | POST | Generate embeddings | + +### Example: Chat with Ollama API + +```bash +curl http://localhost:12434/api/chat \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "messages": [ + {"role": "user", "content": "Hello!"} + ] + }' +``` + +### Example: List models + +```bash +curl http://localhost:12434/api/tags +``` + +## Image generation API (Diffusers) + +DMR supports image generation through the Diffusers backend, enabling you to generate +images from text prompts using models like Stable Diffusion. + +> [!NOTE] +> The Diffusers backend requires an NVIDIA GPU with CUDA support and is only +> available on Linux (x86_64 and ARM64). See [Inference engines](inference-engines.md#diffusers) +> for setup instructions. + +### Endpoint + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/engines/diffusers/v1/images/generations` | POST | Generate an image from a text prompt | + +### Supported parameters + +| Parameter | Type | Description | +|-----------|------|-------------| +| `model` | string | Required. The model identifier (e.g., `stable-diffusion:Q4`). | +| `prompt` | string | Required. The text description of the image to generate. | +| `size` | string | Image dimensions in `WIDTHxHEIGHT` format (e.g., `512x512`). | + +### Response format + +The API returns a JSON response with the generated image encoded in base64: + +```json +{ + "data": [ + { + "b64_json": "" + } + ] +} +``` + +### Example: Generate an image + +```bash +curl -s -X POST http://localhost:12434/engines/diffusers/v1/images/generations \ + -H "Content-Type: application/json" \ + -d '{ + "model": "stable-diffusion:Q4", + "prompt": "A picture of a nice cat", + "size": "512x512" + }' | jq -r '.data[0].b64_json' | base64 -d > image.png +``` + +This command: +1. Sends a POST request to the Diffusers image generation endpoint +2. Specifies the model, prompt, and output image size +3. Extracts the base64-encoded image from the response using `jq` +4. Decodes the base64 data and saves it as `image.png` + + +## DMR native endpoints + +These endpoints are specific to Docker Model Runner for model management: + +| Endpoint | Method | Description | +|----------|--------|-------------| +| `/models/create` | POST | Pull/create a model | +| `/models` | GET | List local models | +| `/models/{namespace}/{name}` | GET | Get model details | +| `/models/{namespace}/{name}` | DELETE | Delete a local model | + +## REST API examples + +### Request from within a container + +To call the `chat/completions` OpenAI endpoint from within another container using `curl`: + +```bash +#!/bin/sh + +curl http://model-runner.docker.internal/engines/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Please write 500 words about the fall of Rome." + } + ] + }' + +``` + +### Request from the host using TCP + +To call the `chat/completions` OpenAI endpoint from the host via TCP: + +1. Enable the host-side TCP support from the Docker Desktop GUI, or via the [Docker Desktop CLI](/manuals/desktop/features/desktop-cli.md). + For example: `docker desktop enable model-runner --tcp `. + + If you are running on Windows, also enable GPU-backed inference. + See [Enable Docker Model Runner](get-started.md#enable-docker-model-runner-in-docker-desktop). + +1. Interact with it as documented in the previous section using `localhost` and the correct port. + +```bash +#!/bin/sh + +curl http://localhost:12434/engines/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Please write 500 words about the fall of Rome." + } + ] + }' +``` + +### Request from the host using a Unix socket + +To call the `chat/completions` OpenAI endpoint through the Docker socket from the host using `curl`: + +```bash +#!/bin/sh + +curl --unix-socket $HOME/.docker/run/docker.sock \ + localhost/exp/vDD4.40/engines/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "messages": [ + { + "role": "system", + "content": "You are a helpful assistant." + }, + { + "role": "user", + "content": "Please write 500 words about the fall of Rome." + } + ] + }' +``` + +### Streaming responses + +To receive streaming responses, set `stream: true`: + +```bash +curl http://localhost:12434/engines/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d '{ + "model": "ai/smollm2", + "stream": true, + "messages": [ + {"role": "user", "content": "Count from 1 to 10"} + ] + }' +``` + +## Using with OpenAI SDKs + +### Python + +```python +from openai import OpenAI + +client = OpenAI( + base_url="http://localhost:12434/engines/v1", + api_key="not-needed" # DMR doesn't require an API key +) + +response = client.chat.completions.create( + model="ai/smollm2", + messages=[ + {"role": "user", "content": "Hello!"} + ] +) + +print(response.choices[0].message.content) +``` + +### Node.js + +```javascript +import OpenAI from 'openai'; + +const client = new OpenAI({ + baseURL: 'http://localhost:12434/engines/v1', + apiKey: 'not-needed', +}); + +const response = await client.chat.completions.create({ + model: 'ai/smollm2', + messages: [{ role: 'user', content: 'Hello!' }], +}); + +console.log(response.choices[0].message.content); +``` + +## What's next + +- [IDE and tool integrations](ide-integrations.md) - Configure Cline, Continue, Cursor, and other tools +- [Configuration options](configuration.md) - Adjust context size and runtime parameters +- [Inference engines](inference-engines.md) - Learn about llama.cpp, vLLM, and Diffusers options diff --git a/content/manuals/ai/model-runner/configuration.md b/content/manuals/ai/model-runner/configuration.md new file mode 100644 index 000000000000..89934e97a7ca --- /dev/null +++ b/content/manuals/ai/model-runner/configuration.md @@ -0,0 +1,305 @@ +--- +title: Configuration options +description: Configure context size, runtime parameters, and model behavior in Docker Model Runner. +weight: 35 +keywords: Docker, ai, model runner, configuration, context size, context length, tokens, llama.cpp, parameters +--- + +Docker Model Runner provides several configuration options to tune model behavior, +memory usage, and inference performance. This guide covers the key settings and +how to apply them. + +## Context size (context length) + +The context size determines the maximum number of tokens a model can process in +a single request, including both the input prompt and generated output. This is +one of the most important settings affecting memory usage and model capabilities. + +### Default context size + +By default, Docker Model Runner uses a context size that balances capability with +resource efficiency: + +| Engine | Default behavior | +|--------|------------------| +| llama.cpp | 4096 tokens | +| vLLM | Uses the model's maximum trained context size | + +> [!NOTE] +> The actual default varies by model. Most models support between 2,048 and 8,192 +> tokens by default. Some newer models support 32K, 128K, or even larger contexts. + +### Configure context size + +You can adjust context size per model using the `docker model configure` command: + +```console +$ docker model configure --context-size 8192 ai/qwen2.5-coder +``` + +Or in a Compose file: + +```yaml +models: + llm: + model: ai/qwen2.5-coder + context_size: 8192 +``` + +### Context size guidelines + +| Context size | Typical use case | Memory impact | +|--------------|------------------|---------------| +| 2,048 | Simple queries, short code snippets | Low | +| 4,096 | Standard conversations, medium code files | Moderate | +| 8,192 | Long conversations, larger code files | Higher | +| 16,384+ | Extended documents, multi-file context | High | + +> [!IMPORTANT] +> Larger context sizes require more memory (RAM/VRAM). If you experience out-of-memory +> errors, reduce the context size. As a rough guide, each additional 1,000 tokens +> requires approximately 100-500 MB of additional memory, depending on the model size. + +### Check a model's maximum context + +To see a model's configuration including context size: + +```console +$ docker model inspect ai/qwen2.5-coder +``` + +> [!NOTE] +> The `docker model inspect` command shows the model's maximum supported context length +> (e.g., `gemma3.context_length`), not the configured context size. The configured context +> size is what you set with `docker model configure --context-size` and represents the +> actual limit used during inference, which should be less than or equal to the model's +> maximum supported context length. + +## Runtime flags + +Runtime flags let you pass parameters directly to the underlying inference engine. +This provides fine-grained control over model behavior. + +### Using runtime flags + +Runtime flags can be provided through multiple mechanisms: + +#### Using Docker Compose + +In a Compose file: + +```yaml +models: + llm: + model: ai/qwen2.5-coder + context_size: 4096 + runtime_flags: + - "--temp" + - "0.7" + - "--top-p" + - "0.9" +``` + +#### Using Command Line + +With the `docker model configure` command: + +```console +$ docker model configure ai/qwen2.5-coder -- --temp 0.7 --top-p 0.9 +``` + +### Common llama.cpp parameters + +These are the most commonly used llama.cpp parameters. You don't need to look up +the llama.cpp documentation for typical use cases. + +#### Sampling parameters + +| Flag | Description | Default | Range | +|------|-------------|---------|-------| +| `--temp` | Temperature for sampling. Lower = more deterministic, higher = more creative | 0.8 | 0.0-2.0 | +| `--top-k` | Limit sampling to top K tokens. Lower = more focused | 40 | 1-100 | +| `--top-p` | Nucleus sampling threshold. Lower = more focused | 0.9 | 0.0-1.0 | +| `--min-p` | Minimum probability threshold | 0.05 | 0.0-1.0 | +| `--repeat-penalty` | Penalty for repeating tokens | 1.1 | 1.0-2.0 | + +**Example: Deterministic output (for code generation)** + +```yaml +runtime_flags: + - "--temp" + - "0" + - "--top-k" + - "1" +``` + +**Example: Creative output (for storytelling)** + +```yaml +runtime_flags: + - "--temp" + - "1.2" + - "--top-p" + - "0.95" +``` + +#### Performance parameters + +| Flag | Description | Default | Notes | +|------|-------------|---------|-------| +| `--threads` | CPU threads for generation | Auto | Set to number of performance cores | +| `--threads-batch` | CPU threads for batch processing | Auto | Usually same as `--threads` | +| `--batch-size` | Batch size for prompt processing | 512 | Higher = faster prompt processing | +| `--mlock` | Lock model in memory | Off | Prevents swapping, requires sufficient RAM | +| `--no-mmap` | Disable memory mapping | Off | May improve performance on some systems | + +**Example: Optimized for multi-core CPU** + +```yaml +runtime_flags: + - "--threads" + - "8" + - "--batch-size" + - "1024" +``` + +#### GPU parameters + +| Flag | Description | Default | Notes | +|------|-------------|---------|-------| +| `--n-gpu-layers` | Layers to offload to GPU | All (if GPU available) | Reduce if running out of VRAM | +| `--main-gpu` | GPU to use for computation | 0 | For multi-GPU systems | +| `--split-mode` | How to split across GPUs | layer | Options: `none`, `layer`, `row` | + +**Example: Partial GPU offload (limited VRAM)** + +```yaml +runtime_flags: + - "--n-gpu-layers" + - "20" +``` + +#### Advanced parameters + +| Flag | Description | Default | +|------|-------------|---------| +| `--rope-scaling` | RoPE scaling method | Auto | +| `--rope-freq-base` | RoPE base frequency | Model default | +| `--rope-freq-scale` | RoPE frequency scale | Model default | +| `--no-prefill-assistant` | Disable assistant pre-fill | Off | +| `--reasoning-budget` | Token budget for reasoning models | 0 (disabled) | + +### vLLM parameters + +When using the vLLM backend, different parameters are available. + +Use `--hf_overrides` to pass HuggingFace model config overrides as JSON: + +```console +$ docker model configure --hf_overrides '{"rope_scaling": {"type": "dynamic", "factor": 2.0}}' ai/model-vllm +``` + +## Configuration presets + +Here are complete configuration examples for common use cases. + +### Code completion (fast, deterministic) + +```yaml +models: + coder: + model: ai/qwen2.5-coder + context_size: 4096 + runtime_flags: + - "--temp" + - "0.1" + - "--top-k" + - "1" + - "--batch-size" + - "1024" +``` + +### Chat assistant (balanced) + +```yaml +models: + assistant: + model: ai/llama3.2 + context_size: 8192 + runtime_flags: + - "--temp" + - "0.7" + - "--top-p" + - "0.9" + - "--repeat-penalty" + - "1.1" +``` + +### Creative writing (high temperature) + +```yaml +models: + writer: + model: ai/llama3.2 + context_size: 8192 + runtime_flags: + - "--temp" + - "1.2" + - "--top-p" + - "0.95" + - "--repeat-penalty" + - "1.0" +``` + +### Long document analysis (large context) + +```yaml +models: + analyzer: + model: ai/qwen2.5-coder:14B + context_size: 32768 + runtime_flags: + - "--mlock" + - "--batch-size" + - "2048" +``` + +### Low memory system + +```yaml +models: + efficient: + model: ai/smollm2:360M-Q4_K_M + context_size: 2048 + runtime_flags: + - "--threads" + - "4" +``` + +## Environment-based configuration + +You can also configure models via environment variables in containers: + +| Variable | Description | +|----------|-------------| +| `LLM_URL` | Auto-injected URL of the model endpoint | +| `LLM_MODEL` | Auto-injected model identifier | + +See [Models and Compose](/manuals/ai/compose/models-and-compose.md) for details on how these are populated. + +## Reset configuration + +Configuration set via `docker model configure` persists until the model is removed. +To reset configuration: + +```console +$ docker model configure --context-size -1 ai/qwen2.5-coder +``` + +Using `-1` resets to the default value. + +## What's next + +- [Inference engines](inference-engines.md) - Learn about llama.cpp and vLLM +- [API reference](api-reference.md) - API parameters for per-request configuration +- [Models and Compose](/manuals/ai/compose/models-and-compose.md) - Configure models in Compose applications diff --git a/content/manuals/ai/model-runner/examples.md b/content/manuals/ai/model-runner/examples.md new file mode 100644 index 000000000000..1570b07285f0 --- /dev/null +++ b/content/manuals/ai/model-runner/examples.md @@ -0,0 +1,192 @@ +--- +title: DMR examples +description: Example projects and CI/CD workflows for Docker Model Runner. +weight: 40 +keywords: Docker, ai, model runner, examples, github actions, genai, sample project +--- + +See some examples of complete workflows using Docker Model Runner. + +## Sample project + +You can now start building your generative AI application powered by Docker +Model Runner. + +If you want to try an existing GenAI application, follow these steps: + +1. Set up the sample app. Clone and run the following repository: + + ```console + $ git clone https://github.com/docker/hello-genai.git + ``` + +1. In your terminal, go to the `hello-genai` directory. + +1. Run `run.sh` to pull the chosen model and run the app. + +1. Open your app in the browser at the addresses specified in the repository + [README](https://github.com/docker/hello-genai). + +You see the GenAI app's interface where you can start typing your prompts. + +You can now interact with your own GenAI app, powered by a local model. Try a +few prompts and notice how fast the responses are — all running on your machine +with Docker. + +## Use Model Runner in GitHub Actions + +Here is an example of how to use Model Runner as part of a GitHub workflow. +The example installs Model Runner, tests the installation, pulls and runs a +model, interacts with the model via the API, and deletes the model. + +```yaml {title="dmr-run.yml", collapse=true} +name: Docker Model Runner Example Workflow + +permissions: + contents: read + +on: + workflow_dispatch: + inputs: + test_model: + description: 'Model to test with (default: ai/smollm2:360M-Q4_K_M)' + required: false + type: string + default: 'ai/smollm2:360M-Q4_K_M' + +jobs: + dmr-test: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Set up Docker + uses: docker/setup-docker-action@{{% param "setup_docker_action_version" %}} + + - name: Install docker-model-plugin + run: | + echo "Installing docker-model-plugin..." + # 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 https://download.docker.com/linux/ubuntu/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] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ + sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + sudo apt-get install -y docker-model-plugin + + echo "Installation completed successfully" + + - name: Test docker model version + run: | + echo "Testing docker model version command..." + sudo docker model version + + # Verify the command returns successfully + if [ $? -eq 0 ]; then + echo "✅ docker model version command works correctly" + else + echo "❌ docker model version command failed" + exit 1 + fi + + - name: Pull the provided model and run it + run: | + MODEL="${{ github.event.inputs.test_model || 'ai/smollm2:360M-Q4_K_M' }}" + echo "Testing with model: $MODEL" + + # Test model pull + echo "Pulling model..." + sudo docker model pull "$MODEL" + + if [ $? -eq 0 ]; then + echo "✅ Model pull successful" + else + echo "❌ Model pull failed" + exit 1 + fi + + # Test basic model run (with timeout to avoid hanging) + echo "Testing docker model run..." + timeout 60s sudo docker model run "$MODEL" "Give me a fact about whales." || { + exit_code=$? + if [ $exit_code -eq 124 ]; then + echo "✅ Model run test completed (timed out as expected for non-interactive test)" + else + echo "❌ Model run failed with exit code: $exit_code" + exit 1 + fi + } + + - name: Test API endpoint + run: | + MODEL="${{ github.event.inputs.test_model || 'ai/smollm2:360M-Q4_K_M' }}" + echo "Testing API endpoint with model: $MODEL" + + # Test API call with curl + echo "Testing API call..." + RESPONSE=$(curl -s http://localhost:12434/engines/llama.cpp/v1/chat/completions \ + -H "Content-Type: application/json" \ + -d "{ + \"model\": \"$MODEL\", + \"messages\": [ + { + \"role\": \"user\", + \"content\": \"Say hello\" + } + ], + \"top_k\": 1, + \"temperature\": 0 + }") + + if [ $? -eq 0 ]; then + echo "✅ API call successful" + echo "Response received: $RESPONSE" + + # Check if response contains "hello" (case-insensitive) + if echo "$RESPONSE" | grep -qi "hello"; then + echo "✅ Response contains 'hello' (case-insensitive)" + else + echo "❌ Response does not contain 'hello'" + echo "Full response: $RESPONSE" + exit 1 + fi + else + echo "❌ API call failed" + exit 1 + fi + + - name: Test model cleanup + run: | + MODEL="${{ github.event.inputs.test_model || 'ai/smollm2:360M-Q4_K_M' }}" + + echo "Cleaning up test model..." + sudo docker model rm "$MODEL" || echo "Model removal failed or model not found" + + # Verify model was removed + echo "Verifying model cleanup..." + sudo docker model ls + + echo "✅ Model cleanup completed" + + - name: Report success + if: success() + run: | + echo "🎉 Docker Model Runner daily health check completed successfully!" + echo "All tests passed:" + echo " ✅ docker-model-plugin installation successful" + echo " ✅ docker model version command working" + echo " ✅ Model pull and run operations successful" + echo " ✅ API endpoint operations successful" + echo " ✅ Cleanup operations successful" +``` + +## Related pages + +- [Models and Compose](../compose/models-and-compose.md) diff --git a/content/manuals/ai/model-runner/get-started.md b/content/manuals/ai/model-runner/get-started.md new file mode 100644 index 000000000000..02ba0e71f69b --- /dev/null +++ b/content/manuals/ai/model-runner/get-started.md @@ -0,0 +1,223 @@ +--- +title: Get started with DMR +description: How to install, enable, and use Docker Model Runner to manage and run AI models. +weight: 10 +keywords: Docker, ai, model runner, setup, installation, getting started +--- + +Docker Model Runner (DMR) lets you run and manage AI models locally using Docker. This page shows you how to enable DMR, pull and run a model, configure model settings, and publish custom models. + +## Enable Docker Model Runner + +You can enable DMR using Docker Desktop or Docker Engine. Follow the instructions below based on your setup. + +### Docker Desktop + +1. In the settings view, go to the **AI** tab. +1. Select the **Enable Docker Model Runner** setting. +1. If you use Windows with a supported NVIDIA GPU, you also see and can select + **Enable GPU-backed inference**. +1. Optional: To enable TCP support, select **Enable host-side TCP support**. + 1. In the **Port** field, type the port you want to use. + 1. If you interact with Model Runner from a local frontend web app, in + **CORS Allows Origins**, select the origins that Model Runner should + accept requests from. An origin is the URL where your web app runs, for + example `http://localhost:3131`. + +You can now use the `docker model` command in the CLI and view and interact +with your local models in the **Models** tab in the Docker Desktop Dashboard. + +### Docker Engine + +1. Ensure you have installed [Docker Engine](/engine/install/). +1. Docker Model Runner is available as a package. To install it, run: + + {{< tabs >}} + {{< tab name="Ubuntu/Debian">}} + + ```bash + $ sudo apt-get update + $ sudo apt-get install docker-model-plugin + ``` + + {{< /tab >}} + {{< tab name="RPM-base distributions">}} + + ```bash + $ sudo dnf update + $ sudo dnf install docker-model-plugin + ``` + + {{< /tab >}} + {{< /tabs >}} + +1. Test the installation: + + ```bash + $ docker model version + $ docker model run ai/smollm2 + ``` + +> [!NOTE] +> TCP support is enabled by default for Docker Engine on port `12434`. + +### Update DMR in Docker Engine + +To update Docker Model Runner in Docker Engine, uninstall it with +[`docker model uninstall-runner`](/reference/cli/docker/model/uninstall-runner/) +then reinstall it: + +```bash +docker model uninstall-runner --images && docker model install-runner +``` +> [!NOTE] +> With the above command, local models are preserved and only the Docker Model Runner images are removed. +> To also delete the local models during the upgrade, add the `--models` option to the `uninstall-runner` command. + +## Pull a model + +Models are cached locally. + +> [!NOTE] +> +> When you use the Docker CLI, you can also pull models directly from +> [HuggingFace](https://huggingface.co/). + +{{< tabs group="release" >}} +{{< tab name="From Docker Desktop">}} + +1. Select **Models** and select the **Docker Hub** tab. +1. Find the model you want and select **Pull**. + +![Screenshot showing the Docker Hub view.](./images/dmr-catalog.png) + +{{< /tab >}} +{{< tab name="From the Docker CLI">}} + +Use the [`docker model pull` command](/reference/cli/docker/model/pull/). +For example: + +```bash {title="Pulling from Docker Hub"} +docker model pull ai/smollm2:360M-Q4_K_M +``` + +```bash {title="Pulling from HuggingFace"} +docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF +``` + +{{< /tab >}} +{{< /tabs >}} + +## Run a model + +{{< tabs group="release" >}} +{{< tab name="From Docker Desktop">}} + +1. Select **Models** and select the **Local** tab. +1. Select the play button. The interactive chat screen opens. + +![Screenshot showing the Local view.](./images/dmr-run.png) + +{{< /tab >}} +{{< tab name="From the Docker CLI" >}} + +Use the [`docker model run` command](/reference/cli/docker/model/run/). + +{{< /tab >}} +{{< /tabs >}} + +## Configure a model + +You can configure a model, such as its maximum token limit and more, +use Docker Compose. +See [Models and Compose - Model configuration options](../compose/models-and-compose.md#model-configuration-options). + +## Publish a model + +> [!NOTE] +> +> This works for any Container Registry supporting OCI Artifacts, not only +> Docker Hub. + +You can tag existing models with a new name and publish them under a different +namespace and repository: + +```bash +# Tag a pulled model under a new name +$ docker model tag ai/smollm2 myorg/smollm2 + +# Push it to Docker Hub +$ docker model push myorg/smollm2 +``` + +For more details, see the [`docker model tag`](/reference/cli/docker/model/tag) +and [`docker model push`](/reference/cli/docker/model/push) command +documentation. + +You can also package a model file in GGUF format as an OCI Artifact and publish +it to Docker Hub. + +```bash +# Download a model file in GGUF format, for example from HuggingFace +$ curl -L -o model.gguf https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q4_K_M.gguf + +# Package it as OCI Artifact and push it to Docker Hub +$ docker model package --gguf "$(pwd)/model.gguf" --push myorg/mistral-7b-v0.1:Q4_K_M +``` + +For more details, see the +[`docker model package`](/reference/cli/docker/model/package/) command +documentation. + +## Troubleshooting + +### Display the logs + +To troubleshoot issues, display the logs: + +{{< tabs group="release" >}} +{{< tab name="From Docker Desktop">}} + +Select **Models** and select the **Logs** tab. + +![Screenshot showing the Models view.](./images/dmr-logs.png) + +{{< /tab >}} +{{< tab name="From the Docker CLI">}} + +Use the [`docker model logs` command](/reference/cli/docker/model/logs/). + +{{< /tab >}} +{{< /tabs >}} + +### Inspect requests and responses + +Inspecting requests and responses helps you diagnose model-related issues. +For example, you can evaluate context usage to verify you stay within the model's context +window or display the full body of a request to control the parameters you are passing to your models +when developing with a framework. + +In Docker Desktop, to inspect the requests and responses for each model: + +1. Select **Models** and select the **Requests** tab. This view displays all the requests to all models: + - The time the request was sent. + - The model name and version + - The prompt/request + - The context usage + - The time it took for the response to be generated. +1. Select one of the requests to display further details: + - In the **Overview** tab, view the token usage, response metadata and generation speed, and the actual prompt and response. + - In the **Request** and **Response** tabs, view the full JSON payload of the request and the response. + +> [!NOTE] +> You can also display the requests for a specific model when you select a model and then select the **Requests** tab. + +## Related pages + +- [API reference](./api-reference.md) - OpenAI and Ollama-compatible API documentation +- [Configuration options](./configuration.md) - Context size and runtime parameters +- [Inference engines](./inference-engines.md) - llama.cpp and vLLM details +- [IDE integrations](./ide-integrations.md) - Connect Cline, Continue, Cursor, and more +- [Open WebUI integration](./openwebui-integration.md) - Set up a web chat interface +- [Models and Compose](../compose/models-and-compose.md) - Use models in Compose applications +- [Docker Model Runner CLI reference](/reference/cli/docker/model) - Complete CLI documentation \ No newline at end of file diff --git a/content/manuals/ai/model-runner/ide-integrations.md b/content/manuals/ai/model-runner/ide-integrations.md new file mode 100644 index 000000000000..2d6e477c59b9 --- /dev/null +++ b/content/manuals/ai/model-runner/ide-integrations.md @@ -0,0 +1,373 @@ +--- +title: IDE and tool integrations +description: Configure popular AI coding assistants and tools to use Docker Model Runner as their backend. +weight: 40 +keywords: Docker, ai, model runner, cline, continue, cursor, vscode, ide, integration, openai, ollama, claude, anthropic, claude-code +--- + +Docker Model Runner can serve as a local backend for popular AI coding assistants +and development tools. This guide shows how to configure common tools to use +models running in DMR. + +## Prerequisites + +Before configuring any tool: + +1. [Enable Docker Model Runner](get-started.md#enable-docker-model-runner) in Docker Desktop or Docker Engine. +2. Enable TCP host access: + - Docker Desktop: Enable **host-side TCP support** in Settings > AI, or run: + ```console + $ docker desktop enable model-runner --tcp 12434 + ``` + - Docker Engine: TCP is enabled by default on port 12434. +3. Pull a model: + ```console + $ docker model pull ai/qwen2.5-coder + ``` + +> [!TIP] +> +> The default context size for many models (such as `gpt-oss`) is 4,096 tokens, which is limiting for coding tasks. +> You can repackage it with a larger context window: +> +> ```console +> $ docker model pull gpt-oss +> $ docker model package --from ai/gpt-oss --context-size 32000 gpt-oss:32k +> ``` +> Alternatively, models like ai/glm-4.7-flash, ai/qwen2.5-coder, and ai/devstral-small-2 +> come with 128K context by default and work without repackaging. + +## Cline (VS Code) + +[Cline](https://github.com/cline/cline) is an AI coding assistant for VS Code. + +### Configuration + +1. Open VS Code and go to the Cline extension settings. +2. Select **OpenAI Compatible** as the API provider. +3. Configure the following settings: + +| Setting | Value | +|---------|-------| +| Base URL | `http://localhost:12434/engines/v1` | +| API Key | `not-needed` (or any placeholder value) | +| Model ID | `ai/qwen2.5-coder` (or your preferred model) | + +> [!IMPORTANT] +> The base URL must include `/engines/v1` at the end. Do not include a trailing slash. + +### Troubleshooting Cline + +If Cline fails to connect: + +1. Verify DMR is running: + ```console + $ docker model status + ``` + +2. Test the endpoint directly: + ```console + $ curl http://localhost:12434/engines/v1/models + ``` + +3. Check that CORS is configured if running a web-based version: + - In Docker Desktop Settings > AI, add your origin to **CORS Allowed Origins** + +## Continue (VS Code / JetBrains) + +[Continue](https://continue.dev) is an open-source AI code assistant that works with VS Code and JetBrains IDEs. + +### Configuration + +Edit your Continue configuration file (`~/.continue/config.json`): + +```json +{ + "models": [ + { + "title": "Docker Model Runner", + "provider": "openai", + "model": "ai/qwen2.5-coder", + "apiBase": "http://localhost:12434/engines/v1", + "apiKey": "not-needed" + } + ] +} +``` + +### Using Ollama provider + +Continue also supports the Ollama provider, which works with DMR: + +```json +{ + "models": [ + { + "title": "Docker Model Runner (Ollama)", + "provider": "ollama", + "model": "ai/qwen2.5-coder", + "apiBase": "http://localhost:12434" + } + ] +} +``` + +## Cursor + +[Cursor](https://cursor.sh) is an AI-powered code editor. + +### Configuration + +1. Open Cursor Settings (Cmd/Ctrl + ,). +2. Navigate to **Models** > **OpenAI API Key**. +3. Configure: + + | Setting | Value | + |---------|-------| + | OpenAI API Key | `not-needed` | + | Override OpenAI Base URL | `http://localhost:12434/engines/v1` | + +4. In the model drop-down, enter your model name: `ai/qwen2.5-coder` + +> [!NOTE] +> Some Cursor features may require models with specific capabilities (e.g., function calling). +> Use capable models like `ai/qwen2.5-coder` or `ai/llama3.2` for best results. + +## Zed + +[Zed](https://zed.dev) is a high-performance code editor with AI features. + +### Configuration + +Edit your Zed settings (`~/.config/zed/settings.json`): + +```json +{ + "language_models": { + "openai": { + "api_url": "http://localhost:12434/engines/v1", + "available_models": [ + { + "name": "ai/qwen2.5-coder", + "display_name": "Qwen 2.5 Coder (DMR)", + "max_tokens": 8192 + } + ] + } + } +} +``` + +## Open WebUI + +[Open WebUI](https://github.com/open-webui/open-webui) provides a ChatGPT-like interface for local models. + +See [Open WebUI integration](openwebui-integration.md) for detailed setup instructions. + +## Aider + +[Aider](https://aider.chat) is an AI pair programming tool for the terminal. + +### Configuration + +Set environment variables or use command-line flags: + +```bash +export OPENAI_API_BASE=http://localhost:12434/engines/v1 +export OPENAI_API_KEY=not-needed + +aider --model openai/ai/qwen2.5-coder +``` + +Or in a single command: + +```console +$ aider --openai-api-base http://localhost:12434/engines/v1 \ + --openai-api-key not-needed \ + --model openai/ai/qwen2.5-coder +``` + +## LangChain + +### Python + +```python +from langchain_openai import ChatOpenAI + +llm = ChatOpenAI( + base_url="http://localhost:12434/engines/v1", + api_key="not-needed", + model="ai/qwen2.5-coder" +) + +response = llm.invoke("Write a hello world function in Python") +print(response.content) +``` + +### JavaScript/TypeScript + +```typescript +import { ChatOpenAI } from "@langchain/openai"; + +const model = new ChatOpenAI({ + configuration: { + baseURL: "http://localhost:12434/engines/v1", + }, + apiKey: "not-needed", + modelName: "ai/qwen2.5-coder", +}); + +const response = await model.invoke("Write a hello world function"); +console.log(response.content); +``` + +## LlamaIndex + +```python +from llama_index.llms.openai_like import OpenAILike + +llm = OpenAILike( + api_base="http://localhost:12434/engines/v1", + api_key="not-needed", + model="ai/qwen2.5-coder" +) + +response = llm.complete("Write a hello world function") +print(response.text) +``` + +## OpenCode + +[OpenCode](https://opencode.ai/) is an open-source coding assistant designed to integrate directly into developer workflows. It supports multiple model providers and exposes a flexible configuration system that makes it easy to switch between them. + +See [Use OpenCode with Docker Model Runner](../../../guides/opencode-model-runner.md) +for a task-focused guide that walks through model setup, configuration, and +troubleshooting. + +### Configuration + +1. Install OpenCode (see [docs](https://opencode.ai/docs/#install)) +2. Reference DMR in your OpenCode configuration, either globally at `~/.config/opencode/opencode.json` or project specific with a `opencode.json` file in the root of your project + ```json + { + "$schema": "https://opencode.ai/config.json", + "provider": { + "dmr": { + "npm": "@ai-sdk/openai-compatible", + "name": "Docker Model Runner", + "options": { + "baseURL": "http://localhost:12434/v1" + }, + "models": { + "ai/qwen2.5-coder": { + "name": "ai/qwen2.5-coder" + }, + "ai/llama3.2": { + "name": "ai/llama3.2" + } + } + } + } + } + ``` +3. Select the model you want in OpenCode + +You can find more details in [this Docker Blog post](https://www.docker.com/blog/opencode-docker-model-runner-private-ai-coding/) + +## Claude Code + +[Claude Code](https://claude.com/product/claude-code) is [Anthropic's](https://www.anthropic.com/) command-line tool for agentic coding. It lives in your terminal, understands your codebase, and executes routine tasks, explains complex code, and handles Git workflows through natural language commands. + +See [Use Claude Code with Docker Model Runner](../../../guides/claude-code-model-runner.md) +for a task-focused guide that walks through model setup, configuration, and +inspecting requests. To run Claude Code in an isolated Docker Sandbox against +a local model, see +[Run Claude Code in a Docker Sandbox with Docker Model Runner](../../../guides/claude-code-sandbox-model-runner.md). + +### Configuration + +1. Install Claude Code (see [docs](https://code.claude.com/docs/en/quickstart#step-1-install-claude-code)) +2. Use the `ANTHROPIC_BASE_URL` environment variable to point Claude Code at DMR. On Mac or Linux, you can do this, for example if you want to use the `gpt-oss:32k` model: + ```bash + ANTHROPIC_BASE_URL=http://localhost:12434 claude --model qwen2.5-coder + ``` + On Windows (PowerShell) you can do it like this: + ```powershell + $env:ANTHROPIC_BASE_URL="http://localhost:12434" + claude --model gpt-oss:32k + ``` + +> [!TIP] +> +> To avoid setting the variable each time, add it to your shell profile (`~/.bashrc`, `~/.zshrc`, or equivalent): +> +> ```shell +> export ANTHROPIC_BASE_URL=http://localhost:12434 +> ``` + +You can find more details in [this Docker Blog post](https://www.docker.com/blog/run-claude-code-locally-docker-model-runner/) + +> [!NOTE] +> +> While the other integrations on this page use the [OpenAI-compatible API](/ai/model-runner/api-reference/#openai-compatible-api), DMR also exposes a [Anthropic-compatible API](/ai/model-runner/api-reference/#anthropic-compatible-api) used here. + +## Common issues + +### "Connection refused" errors + +1. Ensure Docker Model Runner is enabled and running: + ```console + $ docker model status + ``` + +2. Verify TCP access is enabled: + ```console + $ curl http://localhost:12434/engines/v1/models + ``` + +3. Check if another service is using port 12434. + +4. If you run your tool in WSL and want to connect to DMR on the host via `localhost`, this might not directly work. Configuring WSL to use [mirrored networking](https://learn.microsoft.com/en-us/windows/wsl/networking#mirrored-mode-networking) can solve this. + +### "Model not found" errors + +1. Verify the model is pulled: + ```console + $ docker model list + ``` + +2. Use the full model name including namespace (e.g., `ai/qwen2.5-coder`, not just `qwen2.5-coder`). + +### Slow responses or timeouts + +1. For first requests, models need to load into memory. Subsequent requests are faster. + +2. Consider using a smaller model or adjusting the context size: + ```console + $ docker model configure --context-size 4096 ai/qwen2.5-coder + ``` + +3. Check available system resources (RAM, GPU memory). + +### CORS errors (web-based tools) + +If using browser-based tools, add the origin to CORS allowed origins: + +1. Docker Desktop: Settings > AI > CORS Allowed Origins +2. Add your tool's URL (e.g., `http://localhost:3000`) + +## Recommended models by use case + +| Use case | Recommended model | Notes | +|----------|-------------------|-------| +| Code completion | `ai/qwen3-coder` | Optimized for coding tasks with a large context window | +| Agentic coding | `ai/devstral-small-2` | Good fit for tools such as Claude Code and OpenCode | +| General assistant | `ai/llama3.2` | Good balance of capabilities | +| Small/fast | `ai/smollm2` | Low resource usage | +| Embeddings | `ai/all-minilm` | For RAG and semantic search | + +## What's next + +- [API reference](api-reference.md) - Full API documentation +- [Configuration options](configuration.md) - Tune model behavior +- [Open WebUI integration](openwebui-integration.md) - Set up a web interface diff --git a/content/manuals/ai/model-runner/images/dmr-catalog.png b/content/manuals/ai/model-runner/images/dmr-catalog.png new file mode 100644 index 000000000000..15d8bd04df11 Binary files /dev/null and b/content/manuals/ai/model-runner/images/dmr-catalog.png differ diff --git a/content/manuals/ai/model-runner/images/dmr-logs.png b/content/manuals/ai/model-runner/images/dmr-logs.png new file mode 100644 index 000000000000..e2b2289e9886 Binary files /dev/null and b/content/manuals/ai/model-runner/images/dmr-logs.png differ diff --git a/content/manuals/ai/model-runner/images/dmr-run.png b/content/manuals/ai/model-runner/images/dmr-run.png new file mode 100644 index 000000000000..c12b3bd5fdd4 Binary files /dev/null and b/content/manuals/ai/model-runner/images/dmr-run.png differ diff --git a/content/manuals/ai/model-runner/inference-engines.md b/content/manuals/ai/model-runner/inference-engines.md new file mode 100644 index 000000000000..952e29489337 --- /dev/null +++ b/content/manuals/ai/model-runner/inference-engines.md @@ -0,0 +1,410 @@ +--- +title: Inference engines +description: Learn about the llama.cpp, vLLM, and Diffusers inference engines in Docker Model Runner. +weight: 50 +keywords: Docker, ai, model runner, llama.cpp, vllm, diffusers, inference, gguf, safetensors, cuda, gpu, image generation, stable diffusion +--- + +Docker Model Runner supports three inference engines: **llama.cpp**, **vLLM**, and **Diffusers**. +Each engine has different strengths, supported platforms, and model format +requirements. This guide helps you choose the right engine and configure it for +your use case. + +## Engine comparison + +| Feature | llama.cpp | vLLM | Diffusers | +|---------|-----------|------|-------------------------------------| +| **Model formats** | GGUF | Safetensors, HuggingFace | DDUF | +| **Platforms** | All (macOS, Windows, Linux) | Linux x86_64 only | Linux (x86_64, ARM64) | +| **GPU support** | NVIDIA, AMD, Apple Silicon, Vulkan | NVIDIA CUDA only | NVIDIA CUDA only | +| **CPU inference** | Yes | No | No | +| **Quantization** | Built-in (Q4, Q5, Q8, etc.) | Limited | Limited | +| **Memory efficiency** | High (with quantization) | Moderate | Moderate | +| **Throughput** | Good | High (with batching) | Good | +| **Best for** | Local development, resource-constrained environments | Production, high throughput | Image generation | +| **Use case** | Text generation (LLMs) | Text generation (LLMs) | Image generation (Stable Diffusion) | + +## llama.cpp + +[llama.cpp](https://github.com/ggerganov/llama.cpp) is the default inference +engine in Docker Model Runner. It's designed for efficient local inference and +supports a wide range of hardware configurations. + +### Platform support + +| Platform | GPU support | Notes | +|----------|-------------|-------| +| macOS (Apple Silicon) | Metal | Automatic GPU acceleration | +| Windows (x64) | NVIDIA CUDA | Requires NVIDIA drivers 576.57+ | +| Windows (ARM64) | Adreno OpenCL | Qualcomm 6xx series and later | +| Linux (x64) | NVIDIA, AMD, Vulkan | Multiple backend options | +| Linux | CPU only | Works on any x64/ARM64 system | + +### Model format: GGUF + +llama.cpp uses the GGUF format, which supports efficient quantization for reduced +memory usage without significant quality loss. + +#### Quantization levels + +| Quantization | Bits per weight | Memory usage | Quality | +|--------------|-----------------|--------------|---------| +| Q2_K | ~2.5 | Lowest | Reduced | +| Q3_K_M | ~3.5 | Minimal | Acceptable | +| Q4_K_M | ~4.5 | Low | Good | +| Q5_K_M | ~5.5 | Moderate | Excellent | +| Q6_K | ~6.5 | Higher | Excellent | +| Q8_0 | 8 | High | Near-original | +| F16 | 16 | Highest | Original | + +**Recommended**: Q4_K_M offers the best balance of quality and memory usage for +most use cases. + +#### Pulling quantized models + +Models on Docker Hub often include quantization in the tag: + +```console +$ docker model pull ai/llama3.2:3B-Q4_K_M +``` + +### Using llama.cpp + +llama.cpp is the default engine. No special configuration is required: + +```console +$ docker model run ai/smollm2 +``` + +To explicitly specify llama.cpp when running models: + +```console +$ docker model run ai/smollm2 --backend llama.cpp +``` + +### llama.cpp API endpoints + +When using llama.cpp, API calls use the llama.cpp engine path: + +```text +POST /engines/llama.cpp/v1/chat/completions +``` + +Or without the engine prefix: + +```text +POST /engines/v1/chat/completions +``` + +## vLLM + +[vLLM](https://github.com/vllm-project/vllm) is a high-performance inference +engine optimized for production workloads with high throughput requirements. + +### Platform support + +| Platform | GPU | Support status | +|----------|-----|----------------| +| Linux x86_64 | NVIDIA CUDA | Supported | +| Windows with WSL2 | NVIDIA CUDA | Supported (Docker Desktop 4.54+) | +| macOS | - | Not supported | +| Linux ARM64 | - | Not supported | +| AMD GPUs | - | Not supported | + +> [!IMPORTANT] +> vLLM requires an NVIDIA GPU with CUDA support. It does not support CPU-only +> inference. + +### Model format: Safetensors + +vLLM works with models in Safetensors format, which is the standard format for +HuggingFace models. These models typically use more memory than quantized GGUF +models but may offer better quality and faster inference on powerful hardware. + +### Setting up vLLM + +#### Docker Engine (Linux) + +Install the Model Runner with vLLM backend: + +```console +$ docker model install-runner --backend vllm --gpu cuda +``` + +Verify the installation: + +```console +$ docker model status +Docker Model Runner is running + +Status: +llama.cpp: running llama.cpp version: c22473b +vllm: running vllm version: 0.11.0 +``` + +#### Docker Desktop (Windows with WSL2) + +1. Ensure you have: + - Docker Desktop 4.54 or later (minimum version for vLLM support) + - NVIDIA GPU with updated drivers + - WSL2 enabled + +2. Install vLLM backend: + ```console + $ docker model install-runner --backend vllm --gpu cuda + ``` + +### Running models with vLLM + +vLLM models are typically tagged with `-vllm` suffix: + +```console +$ docker model run ai/smollm2-vllm +``` + +To specify the vLLM backend explicitly: + +```console +$ docker model run ai/model --backend vllm +``` + +### vLLM API endpoints + +When using vLLM, specify the engine in the API path: + +```text +POST /engines/vllm/v1/chat/completions +``` + +### vLLM configuration + +#### HuggingFace overrides + +Use `--hf_overrides` to pass model configuration overrides: + +```console +$ docker model configure --hf_overrides '{"max_model_len": 8192}' ai/model-vllm +``` + +#### Common vLLM settings + +| Setting | Description | Example | +|---------|-------------|---------| +| `max_model_len` | Maximum context length | 8192 | +| `gpu_memory_utilization` | Fraction of GPU memory to use | 0.9 | +| `tensor_parallel_size` | GPUs for tensor parallelism | 2 | + +### vLLM and llama.cpp performance comparison + +| Scenario | Recommended engine | +|----------|-------------------| +| Single user, local development | llama.cpp | +| Multiple concurrent requests | vLLM | +| Limited GPU memory | llama.cpp (with quantization) | +| Maximum throughput | vLLM | +| CPU-only system | llama.cpp | +| Apple Silicon Mac | llama.cpp | +| Production deployment | vLLM (if hardware supports it) | + +## Diffusers + +[Diffusers](https://github.com/huggingface/diffusers) is an inference engine +for image generation models, including Stable Diffusion. Unlike llama.cpp and +vLLM which focus on text generation with LLMs, Diffusers enables you to generate +images from text prompts. + +### Platform support + +| Platform | GPU | Support status | +|----------|-----|----------------| +| Linux x86_64 | NVIDIA CUDA | Supported | +| Linux ARM64 | NVIDIA CUDA | Supported | +| Windows | - | Not supported | +| macOS | - | Not supported | + +> [!IMPORTANT] +> Diffusers requires an NVIDIA GPU with CUDA support. It does not support +> CPU-only inference. + +### Setting up Diffusers + +Install the Model Runner with Diffusers backend: + +```console +$ docker model reinstall-runner --backend diffusers --gpu cuda +``` + +Verify the installation: + +```console +$ docker model status +Docker Model Runner is running + +Status: +llama.cpp: running llama.cpp version: 34ce48d +mlx: not installed +sglang: sglang package not installed +vllm: vLLM binary not found +diffusers: running diffusers version: 0.36.0 +``` + +### Pulling Diffusers models + +Pull a Stable Diffusion model: + +```console +$ docker model pull stable-diffusion:Q4 +``` + +### Generating images with Diffusers + +Diffusers uses an image generation API endpoint. To generate an image: + +```console +$ curl -s -X POST http://localhost:12434/engines/diffusers/v1/images/generations \ + -H "Content-Type: application/json" \ + -d '{ + "model": "stable-diffusion:Q4", + "prompt": "A picture of a nice cat", + "size": "512x512" + }' | jq -r '.data[0].b64_json' | base64 -d > image.png +``` + +This command: +1. Sends a POST request to the Diffusers image generation endpoint +2. Specifies the model, prompt, and output image size +3. Extracts the base64-encoded image from the response +4. Decodes it and saves it as `image.png` + +### Diffusers API endpoint + +When using Diffusers, specify the engine in the API path: + +```text +POST /engines/diffusers/v1/images/generations +``` + +### Supported parameters + +| Parameter | Type | Description | +|-----------|------|-------------| +| `model` | string | Required. The model identifier (e.g., `stable-diffusion:Q4`). | +| `prompt` | string | Required. The text description of the image to generate. | +| `size` | string | Image dimensions in `WIDTHxHEIGHT` format (e.g., `512x512`). | + +## Running multiple engines + +You can run llama.cpp, vLLM, and Diffusers simultaneously. Docker Model Runner routes +requests to the appropriate engine based on the model or explicit engine selection. + +Check which engines are running: + +```console +$ docker model status +Docker Model Runner is running + +Status: +llama.cpp: running llama.cpp version: 34ce48d +mlx: not installed +sglang: sglang package not installed +vllm: running vllm version: 0.11.0 +diffusers: running diffusers version: 0.36.0 +``` + +### Engine-specific API paths + +| Engine | API path | Use case | +|--------|----------|----------| +| llama.cpp | `/engines/llama.cpp/v1/chat/completions` | Text generation | +| vLLM | `/engines/vllm/v1/chat/completions` | Text generation | +| Diffusers | `/engines/diffusers/v1/images/generations` | Image generation | +| Auto-select | `/engines/v1/chat/completions` | Text generation (auto-selects engine) | + +## Managing inference engines + +### Install an engine + +```console +$ docker model install-runner --backend [--gpu ] +``` + +Options: +- `--backend`: `llama.cpp`, `vllm`, or `diffusers` +- `--gpu`: `cuda`, `rocm`, `vulkan`, or `metal` (depends on platform) + +### Reinstall an engine + +```console +$ docker model reinstall-runner --backend +``` + +### Check engine status + +```console +$ docker model status +``` + +### View engine logs + +```console +$ docker model logs +``` + +## Packaging models for each engine + +### Package a GGUF model (llama.cpp) + +```console +$ docker model package --gguf ./model.gguf --push myorg/mymodel:Q4_K_M +``` + +### Package a Safetensors model (vLLM) + +```console +$ docker model package --safetensors ./model/ --push myorg/mymodel-vllm +``` + +## Troubleshooting + +### vLLM won't start + +1. Verify NVIDIA GPU is available: + ```console + $ nvidia-smi + ``` + +2. Check Docker has GPU access: + ```console + $ docker run --rm --gpus all nvidia/cuda:12.0-base nvidia-smi + ``` + +3. Verify you're on a supported platform (Linux x86_64 or Windows WSL2). + +### llama.cpp is slow + +1. Ensure GPU acceleration is working (check logs for Metal/CUDA messages). + +2. Try a more aggressive quantization: + ```console + $ docker model pull ai/model:Q4_K_M + ``` + +3. Reduce context size: + ```console + $ docker model configure --context-size 2048 ai/model + ``` + +### Out of memory errors + +1. Use a smaller quantization (Q4 instead of Q8). +2. Reduce context size. +3. For vLLM, adjust `gpu_memory_utilization`: + ```console + $ docker model configure --hf_overrides '{"gpu_memory_utilization": 0.8}' ai/model + ``` + +## What's next + +- [Configuration options](configuration.md) - Detailed parameter reference +- [API reference](api-reference.md) - API documentation +- [GPU support](/manuals/desktop/features/gpu.md) - GPU configuration for Docker Desktop diff --git a/content/manuals/ai/model-runner/openwebui-integration.md b/content/manuals/ai/model-runner/openwebui-integration.md new file mode 100644 index 000000000000..1e8cdd5805ad --- /dev/null +++ b/content/manuals/ai/model-runner/openwebui-integration.md @@ -0,0 +1,293 @@ +--- +title: Open WebUI integration +description: Set up Open WebUI as a ChatGPT-like interface for Docker Model Runner. +weight: 45 +keywords: Docker, ai, model runner, open webui, openwebui, chat interface, ollama, ui +--- + +[Open WebUI](https://github.com/open-webui/open-webui) is an open-source, +self-hosted web interface that provides a ChatGPT-like experience for local +AI models. You can connect it to Docker Model Runner to get a polished chat +interface for your models. + +## Prerequisites + +- Docker Model Runner enabled with TCP access +- A model pulled (e.g., `docker model pull ai/llama3.2`) + +## Quick start with Docker Compose + +The easiest way to run Open WebUI with Docker Model Runner is using Docker Compose. + +Create a `compose.yaml` file: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "3000:8080" + environment: + - OLLAMA_BASE_URL=http://host.docker.internal:12434 + - WEBUI_AUTH=false + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - open-webui:/app/backend/data + +volumes: + open-webui: +``` + +Start the services: + +```console +$ docker compose up -d +``` + +Open your browser to [http://localhost:3000](http://localhost:3000). + +## Configuration options + +### Environment variables + +| Variable | Description | Default | +|----------|-------------|---------| +| `OLLAMA_BASE_URL` | URL of Docker Model Runner | Required | +| `WEBUI_AUTH` | Enable authentication | `true` | +| `OPENAI_API_BASE_URL` | Use OpenAI-compatible API instead | - | +| `OPENAI_API_KEY` | API key (use any value for DMR) | - | + +### Using OpenAI-compatible API + +If you prefer to use the OpenAI-compatible API instead of the Ollama API: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "3000:8080" + environment: + - OPENAI_API_BASE_URL=http://host.docker.internal:12434/engines/v1 + - OPENAI_API_KEY=not-needed + - WEBUI_AUTH=false + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - open-webui:/app/backend/data + +volumes: + open-webui: +``` + +## Network configuration + +### Docker Desktop + +On Docker Desktop, `host.docker.internal` automatically resolves to the host machine. +The previous example works without modification. + +### Docker Engine (Linux) + +On Docker Engine, you may need to configure the network differently: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + network_mode: host + environment: + - OLLAMA_BASE_URL=http://localhost:12434 + - WEBUI_AUTH=false + volumes: + - open-webui:/app/backend/data + +volumes: + open-webui: +``` + +Or use the host gateway: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "3000:8080" + environment: + - OLLAMA_BASE_URL=http://172.17.0.1:12434 + - WEBUI_AUTH=false + volumes: + - open-webui:/app/backend/data + +volumes: + open-webui: +``` + +## Using Open WebUI + +### Select a model + +1. Open [http://localhost:3000](http://localhost:3000) +2. Select the model drop-down in the top-left +3. Select from your pulled models (they appear with `ai/` prefix) + +### Pull models through the UI + +Open WebUI can pull models directly: + +1. Select the model drop-down +2. Enter a model name: `ai/llama3.2` +3. Select the download icon + +### Chat features + +Open WebUI provides: + +- Multi-turn conversations with context +- Message editing and regeneration +- Code syntax highlighting +- Markdown rendering +- Conversation history and search +- Export conversations + +## Complete example with multiple models + +This example sets up Open WebUI with Docker Model Runner and pre-pulls several models: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "3000:8080" + environment: + - OLLAMA_BASE_URL=http://host.docker.internal:12434 + - WEBUI_AUTH=false + - DEFAULT_MODELS=ai/llama3.2 + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - open-webui:/app/backend/data + depends_on: + model-setup: + condition: service_completed_successfully + + model-setup: + image: docker:cli + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: > + sh -c " + docker model pull ai/llama3.2 && + docker model pull ai/qwen2.5-coder && + docker model pull ai/smollm2 + " + +volumes: + open-webui: +``` + +## Enabling authentication + +For multi-user setups or security, enable authentication: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "3000:8080" + environment: + - OLLAMA_BASE_URL=http://host.docker.internal:12434 + - WEBUI_AUTH=true + extra_hosts: + - "host.docker.internal:host-gateway" + volumes: + - open-webui:/app/backend/data + +volumes: + open-webui: +``` + +On first visit, you'll create an admin account. + +## Troubleshooting + +### Models don't appear in the drop-down + +1. Verify Docker Model Runner is accessible: + ```console + $ curl http://localhost:12434/api/tags + ``` + +2. Check that models are pulled: + ```console + $ docker model list + ``` + +3. Verify the `OLLAMA_BASE_URL` is correct and accessible from the container. + +### "Connection refused" errors + +1. Ensure TCP access is enabled for Docker Model Runner. + +2. On Docker Desktop, verify `host.docker.internal` resolves: + ```console + $ docker run --rm alpine ping -c 1 host.docker.internal + ``` + +3. On Docker Engine, try using `network_mode: host` or the explicit host IP. + +### Slow response times + +1. First requests load the model into memory, which takes time. + +2. Subsequent requests are much faster. + +3. If consistently slow, consider: + - Using a smaller model + - Reducing context size + - Checking GPU acceleration is working + +### CORS errors + +If running Open WebUI on a different host: + +1. In Docker Desktop, go to Settings > AI +2. Add the Open WebUI URL to **CORS Allowed Origins** + +## Customization + +### Custom system prompts + +Open WebUI supports setting system prompts per model. Configure these in the UI under Settings > Models. + +### Model parameters + +Adjust model parameters in the chat interface: + +1. Select the settings icon next to the model name +2. Adjust temperature, top-p, max tokens, etc. + +These settings are passed through to Docker Model Runner. + +## Running on a different port + +To run Open WebUI on a different port: + +```yaml +services: + open-webui: + image: ghcr.io/open-webui/open-webui:main + ports: + - "8080:8080" # Change first port number + # ... rest of config +``` + +## What's next + +- [API reference](api-reference.md) - Learn about the APIs Open WebUI uses +- [Configuration options](configuration.md) - Tune model behavior +- [IDE integrations](ide-integrations.md) - Connect other tools to DMR diff --git a/content/manuals/ai/sandboxes/_index.md b/content/manuals/ai/sandboxes/_index.md new file mode 100644 index 000000000000..a6ec29d0d2c6 --- /dev/null +++ b/content/manuals/ai/sandboxes/_index.md @@ -0,0 +1,65 @@ +--- +title: Docker Sandboxes +description: Run AI coding agents in isolated environments +keywords: docker sandboxes, sbx, ai agents, sandboxed agents, microVM +weight: 10 +params: + sidebar: + group: AI and agents +--- + +Docker Sandboxes run AI coding agents in isolated microVM sandboxes. Each +sandbox gets its own Docker daemon, filesystem, and network — the agent can +build containers, install packages, and modify files without touching your host +system. + +> [!NOTE] +> The `sbx` CLI is free to use, including for commercial work. Only +> [organization governance](governance/) requires a separate paid subscription. + +Organization admins can +[centrally manage sandbox network, filesystem, and MCP policies](governance/access-controls/organization.md), +so the same controls apply uniformly across every developer's machine. +Available on a separate paid subscription. + +## Get started + +Follow the [installation guide](install.md) to check the system requirements, +install the `sbx` CLI, and sign in. + +Then launch an agent in a sandbox: + +```console +$ cd ~/my-project +$ sbx run claude +``` + +See the [get started guide](get-started.md) for a first-session walkthrough, or +jump to the [usage guide](usage.md) for basic commands. + +## Learn more + +- [Agents](agents/) — supported agents and per-agent configuration +- [Workflows](workflows/) — patterns for Git, local development, + authentication, agent skills, and automation +- [Configuration](configuration/) — manage credentials, declare project + environments, turn on GPU passthrough, and configure an upstream proxy +- [Integrations](integrations/) — connect editors and apps like VS Code and + Cursor to a sandbox over SSH +- [MCP gateway](mcp-gateway.md) — register MCP servers and connect them to + sandboxed agents +- [Customize](customize/) — reusable templates and declarative kits for + extending or tailoring sandboxes +- [Architecture](architecture.md) — microVM isolation, workspace mounting, + networking +- [Security](security/) — isolation model, credential handling, and + network policies +- [CLI reference](/reference/cli/sbx/) — full list of `sbx` commands and options +- [Troubleshooting](troubleshooting.md) — common issues and fixes +- [FAQ](faq.md) — login requirements, telemetry, etc + +## Feedback + +Your feedback shapes what gets built next. If you run into a bug, hit a +missing feature, or have a suggestion, open an issue at +[github.com/docker/sbx-releases/issues](https://github.com/docker/sbx-releases/issues). diff --git a/content/manuals/ai/sandboxes/agents/_index.md b/content/manuals/ai/sandboxes/agents/_index.md new file mode 100644 index 000000000000..d50303b3f5e3 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/_index.md @@ -0,0 +1,23 @@ +--- +title: Supported agents +linkTitle: Agents +weight: 40 +description: AI coding agents supported by Docker Sandboxes. +keywords: docker sandboxes, ai agents, claude code, codex, cursor, gemini +--- + +Docker Sandboxes runs the following agents out of the box: + +- [Claude Code](claude-code/) +- [Codex](codex/) +- [Copilot](copilot/) +- [Cursor](cursor/) +- [Docker Agent](docker-agent/) +- [Droid](droid/) +- [Gemini](gemini/) +- [Kiro](kiro/) +- [OpenCode](opencode/) +- [Shell](shell/) — agent-less sandbox for manual setup or testing + +Want to pre-install tools or customize an agent's environment? +See [Customize](../customize/). diff --git a/content/manuals/ai/sandboxes/agents/claude-code.md b/content/manuals/ai/sandboxes/agents/claude-code.md new file mode 100644 index 000000000000..89cfc814da6e --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/claude-code.md @@ -0,0 +1,168 @@ +--- +title: Claude Code +weight: 10 +description: | + Use Claude Code in Docker Sandboxes with authentication, local models, + configuration, and YOLO mode for AI-assisted development. +keywords: docker sandboxes, claude code, anthropic, ai agent, sbx, local models, llmman, ollama +--- + +Official documentation: [Claude Code](https://code.claude.com/docs) + +## Quick start + +Launch Claude Code in a sandbox by pointing it at a project directory: + +```console +$ sbx run claude ~/my-project +``` + +The workspace parameter defaults to the current directory, so `sbx run claude` +from inside your project works too. To start Claude with a specific prompt: + +```console +$ sbx run claude --name my-sandbox -- "Add error handling to the login function" +``` + +Everything after `--` is passed directly to Claude Code. You can also pipe in a +prompt from a file with `-- "$(cat prompt.txt)"`. + +## Authentication + +Claude Code requires either an Anthropic API key or a Claude subscription. + +**API key**: Store your key using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set anthropic +``` + +**Claude subscription**: If no API key is set, use the `/login` command inside +Claude Code to authenticate via OAuth. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host, such as +`~/.claude`. Only project-level configuration in the working directory is +available inside the sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +### Remote control + +To use Claude Code's `/remote-control` command inside a sandbox, turn on remote +control: + +```console +$ sbx settings set claude.remoteControl true +``` + +### Default startup command + +Without extra args, the sandbox runs: + +```text +claude --dangerously-skip-permissions +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`), so `--dangerously-skip-permissions` is +preserved: + +```console +$ sbx run claude -- -c # runs claude --dangerously-skip-permissions -c +``` + +When the first argument is a bare word, such as the `agents` subcommand, it +replaces the defaults instead. + +See the [Claude Code CLI reference](https://code.claude.com/docs/en/cli-reference) +for available options. + +## Agents view + +Claude Code's [agents view](https://code.claude.com/docs/en/agent-view) +starts background sessions that run tasks in parallel. Pair it with +[clone mode](../workflows/git.md#clone-mode) to keep their changes inside the +sandbox: + +```console +$ sbx run --clone claude -- agents +``` + +This invocation replaces the +[default startup command](#default-startup-command), so it doesn't +include `--dangerously-skip-permissions` and you can't switch to +bypass-permissions mode inside the sandbox. To work around this, either +use Claude Code's auto mode or pass the flag explicitly: + +```console +$ sbx run --clone claude -- --dangerously-skip-permissions agents +``` + +Claude Code may use branches or worktrees to keep changes from its background +sessions separate. This depends on the task, Claude Code configuration, and +project instructions. The `--clone` flag doesn't control this behavior. Claude +Code creates any branches and worktrees inside the sandbox, not in your host +checkout. + +To review a branch created by a session, fetch the +`sandbox-` remote from the host: + +```console +$ git fetch sandbox- +$ git diff main..sandbox-/ +``` + +See [Git workflows](../workflows/git.md) for clone-mode details. + +## Base image + +The sandbox uses `docker/sandbox-templates:claude-code`. See +[Templates](../customize/templates.md) to build your own image on top of +this base. + +## Use a local model + +The `--model` flag routes Claude Code's Anthropic API requests to a model +served on your host. This feature is experimental and isn't supported on +Windows. + +Enable the feature: + +```console +$ sbx settings set platform.allowExperimentalFeatures true +$ sbx settings set feature.model true +``` + +To use the bundled `llmman` model server, pass a GGUF model reference or short +name: + +```console +$ sbx run --model gemma4 claude +``` + +On first use, `sbx` starts `llmman`, pulls the model, and leaves the server +running on your host. Later sandboxes reuse the server and its model store. + +To use an existing Ollama installation instead, set the provider to `ollama`: + +```console +$ sbx run --model gemma4 --provider ollama claude +``` + +Ollama must already be installed and running. `sbx` connects to it but doesn't +start or manage the Ollama process. + +You can also change the model for an existing sandbox: + +```console +$ sbx run --name --model +``` + +Changing the model recreates the sandbox container. The workspace and +kit-owned volumes persist. + +To use Docker Model Runner instead, see +[Run Claude Code in a Docker Sandbox with Docker Model Runner](/guides/claude-code-sandbox-model-runner/). diff --git a/content/manuals/ai/sandboxes/agents/codex.md b/content/manuals/ai/sandboxes/agents/codex.md new file mode 100644 index 000000000000..fa72cf19fdcf --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/codex.md @@ -0,0 +1,86 @@ +--- +title: Codex +weight: 20 +description: | + Use OpenAI Codex in Docker Sandboxes with API key authentication and YOLO + mode configuration. +keywords: docker sandboxes, codex, openai, ai agent, sbx +--- + +This guide covers authentication, configuration, and usage of Codex in a +sandboxed environment. + +Official documentation: [Codex CLI](https://developers.openai.com/codex/cli) + +## Quick start + +Create a sandbox and run Codex for a project directory: + +```console +$ sbx run codex ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run codex +``` + +## Authentication + +If you haven't stored an OpenAI credential, `sbx run codex` prompts you to +authenticate on your host before launching the sandbox. The flow runs on the +host, so credentials are never exposed inside the sandbox. + +To set up authentication ahead of time, choose one of the following methods. + +**OAuth**: Start the OAuth flow on your host with: + +```console +$ sbx secret set openai --oauth +``` + +This opens a browser window for authentication and stores the resulting tokens +in your OS keychain. The OAuth flow runs on the host, not inside the sandbox, +so browser-based authentication works without any extra setup. + +**API key**: Store your OpenAI API key using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set openai +``` + +See [Credentials](../configuration/credentials.md) for more details. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host, such as +`~/.codex`. Only project-level configuration in the working directory is +available inside the sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +### Default startup command + +Without extra args, the sandbox runs: + +```text +codex --dangerously-bypass-approvals-and-sandbox +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`). A bare word — such as a prompt — replaces the +defaults instead, so lead with the flag to keep bypass mode: + +```console +$ sbx run codex -- --dangerously-bypass-approvals-and-sandbox "fix the build" +``` + +## Base image + +Template: `docker/sandbox-templates:codex` + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/copilot.md b/content/manuals/ai/sandboxes/agents/copilot.md new file mode 100644 index 000000000000..feb5b68b92b9 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/copilot.md @@ -0,0 +1,75 @@ +--- +title: Copilot +weight: 30 +description: | + Use GitHub Copilot in Docker Sandboxes with GitHub token authentication and + trusted folder configuration. +keywords: docker sandboxes, github copilot, ai agent, github token, sbx +--- + +This guide covers authentication, configuration, and usage of GitHub Copilot +in a sandboxed environment. + +Official documentation: [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli) + +## Quick start + +Create a sandbox and run Copilot for a project directory: + +```console +$ sbx run copilot ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run copilot +``` + +## Authentication + +Copilot requires a GitHub token with Copilot access. Store your token using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set github --command 'gh auth token' +``` + +## Configuration + +Sandboxes don't pick up user-level configuration from your host. Only +project-level configuration in the working directory is available inside the +sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +Copilot is configured to trust the workspace directory by default, so it +operates without repeated confirmations for workspace files. + +### Default startup command + +Without extra args, the sandbox runs: + +```text +copilot --yolo +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`), so `--yolo` is preserved: + +```console +$ sbx run copilot -- -p "review this PR" # runs copilot --yolo -p "review this PR" +``` + +When the first argument is a bare word — a subcommand or prompt — it replaces +the defaults instead. + +## Base image + +Template: `docker/sandbox-templates:copilot` + +Preconfigured to trust the workspace directory. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/cursor.md b/content/manuals/ai/sandboxes/agents/cursor.md new file mode 100644 index 000000000000..0f4c3378c1f3 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/cursor.md @@ -0,0 +1,83 @@ +--- +title: Cursor +weight: 40 +description: | + Use Cursor in Docker Sandboxes with API key or proxy-managed OAuth + authentication. +keywords: docker sandboxes, cursor, cursor agent, ai agent, sbx +--- + +This guide covers authentication, configuration, and usage of Cursor in a +sandboxed environment. + +Official documentation: [Cursor CLI](https://cursor.com/cli) + +## Quick start + +Create a sandbox and run Cursor for a project directory: + +```console +$ sbx run cursor ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run cursor +``` + +## Authentication + +Cursor supports two authentication methods: an API key or OAuth. + +**API key**: Store your Cursor API key using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set cursor +``` + +**OAuth**: If no API key is set, Cursor prompts you to sign in interactively +on first run. The proxy intercepts the token exchange with +`api2.cursor.sh/auth/poll`, so credentials are managed by the host and aren't +stored inside the sandbox. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host, such as +`~/.cursor`. Only project-level configuration in the working directory is +available inside the sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +Cursor reads `AGENTS.md` from the workspace for agent-specific instructions. + +### Default startup command + +Without extra args, the sandbox runs: + +```text +cursor-agent --yolo +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`), so `--yolo` is preserved: + +```console +$ sbx run cursor -- -p "refactor this" # runs cursor-agent --yolo -p "refactor this" +``` + +When the first argument is a bare word — a subcommand or prompt — it replaces +the defaults instead. + +## Base image + +Template: `docker/sandbox-templates:cursor-agent-docker` + +Preconfigured with HTTP/1.1 and server-sent events for agent traffic so +requests flow through the host proxy. Authentication state is persisted across +sandbox restarts. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/docker-agent.md b/content/manuals/ai/sandboxes/agents/docker-agent.md new file mode 100644 index 000000000000..0839f7cb1477 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/docker-agent.md @@ -0,0 +1,70 @@ +--- +title: Docker Agent +weight: 50 +description: | + Use Docker Agent in Docker Sandboxes with multi-provider authentication + supporting OpenAI, Anthropic, and more. +keywords: docker sandboxes, docker agent, openai, anthropic, sbx +--- + +Official documentation: [Docker Agent](/manuals/ai/docker-agent/_index.md) + +## Quick start + +Create a sandbox and run Docker Agent for a project directory: + +```console +$ sbx run docker-agent ~/my-project +``` + +The workspace parameter defaults to the current directory, so +`sbx run docker-agent` from inside your project works too. + +## Authentication + +Docker Agent supports multiple providers. Store keys for the providers you want +to use with [stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set openai +$ sbx secret set anthropic +$ sbx secret set google +$ sbx secret set xai +$ sbx secret set nebius +$ sbx secret set mistral +$ sbx secret set openrouter +``` + +You only need to configure the providers you want to use. Docker Agent detects +available credentials and routes requests to the appropriate provider. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host. Only +project-level configuration in the working directory is available inside the +sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +### Default startup command + +Without extra args, the sandbox runs: + +```text +docker-agent run --yolo +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`). When the first argument is a bare word — such +as the `run` subcommand or a config file — it replaces the defaults, so include +`run --yolo` yourself: + +```console +$ sbx run docker-agent -- run --yolo agent.yml +``` + +## Base image + +The sandbox uses `docker/sandbox-templates:docker-agent`. See +[Templates](../customize/templates.md) to build your own image on top of +this base. diff --git a/content/manuals/ai/sandboxes/agents/droid.md b/content/manuals/ai/sandboxes/agents/droid.md new file mode 100644 index 000000000000..40bfaddb74c9 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/droid.md @@ -0,0 +1,72 @@ +--- +title: Droid +weight: 60 +description: | + Use Droid in Docker Sandboxes with API key or OAuth authentication. +keywords: docker sandboxes, droid, factory, ai agent, sbx +--- + +This guide covers authentication, configuration, and usage of Droid, an AI +coding agent by Factory, in a sandboxed environment. + +Official documentation: [Droid](https://docs.factory.ai/) + +## Quick start + +Create a sandbox and run Droid for a project directory: + +```console +$ sbx run droid ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run droid +``` + +## Authentication + +Droid requires a [Factory account](https://factory.ai). Both authentication +methods authenticate you to Factory's service directly — unlike other agents +where you supply a model provider key, Factory manages model access through +your Factory account. + +**API key**: Store your Factory API key using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set droid +``` + +**OAuth**: If no API key is set, Droid prompts you to authenticate +interactively on first run. The proxy handles the OAuth flow, so credentials +aren't stored inside the sandbox. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host. Only +project-level configuration in the working directory is available inside the +sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +### Default startup command + +The sandbox runs `droid` with no implicit flags. Args after `--` are passed +straight through: + +```console +$ sbx run droid -- exec "fix the build" +``` + +## Base image + +Template: `docker/sandbox-templates:droid-docker` + +Preconfigured to run without approval prompts. Authentication state is +persisted across sandbox restarts. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/gemini.md b/content/manuals/ai/sandboxes/agents/gemini.md new file mode 100644 index 000000000000..156fd75de2c9 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/gemini.md @@ -0,0 +1,82 @@ +--- +title: Gemini +weight: 70 +description: | + Use Google Gemini in Docker Sandboxes with proxy-managed authentication and + API key configuration. +keywords: docker sandboxes, gemini, google, ai agent, sbx +--- + +This guide covers authentication, configuration, and usage of Google Gemini in +a sandboxed environment. + +Official documentation: [Gemini CLI](https://geminicli.com/docs/) + +## Quick start + +Create a sandbox and run Gemini for a project directory: + +```console +$ sbx run gemini ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run gemini +``` + +## Authentication + +Gemini requires either a Google API key or a Google account with Gemini access. + +**API key**: Store your key using +[stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set google +``` + +**Google account**: If no API key is set, Gemini prompts you to sign in +interactively when it starts. Interactive authentication is scoped to the +sandbox and doesn't persist if you remove and recreate it. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host, such as +`~/.gemini`. Only project-level configuration in the working directory is +available inside the sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +The sandbox disables Gemini's built-in sandbox tool (since the sandbox itself +provides isolation). + +### Default startup command + +Without extra args, the sandbox runs: + +```text +gemini --yolo +``` + +Arguments after `--` are added after the default flags when the first one is +itself a flag (begins with `-`), so `--yolo` is preserved: + +```console +$ sbx run gemini -- -p "explain this" # runs gemini --yolo -p "explain this" +``` + +When the first argument is a bare word — a subcommand or prompt — it replaces +the defaults instead. + +## Base image + +Template: `docker/sandbox-templates:gemini` + +Gemini is configured to disable its built-in OAuth flow. Authentication is +managed through the proxy with API keys. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/kiro.md b/content/manuals/ai/sandboxes/agents/kiro.md new file mode 100644 index 000000000000..b9d7bc6940ab --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/kiro.md @@ -0,0 +1,106 @@ +--- +title: Kiro +weight: 80 +description: | + Use Kiro in Docker Sandboxes with device flow authentication for interactive + AI-assisted development. +keywords: docker sandboxes, kiro, ai agent, authentication, sbx +--- + +This guide covers authentication, configuration, and usage of Kiro in a +sandboxed environment. + +Official documentation: [Kiro CLI](https://kiro.dev/docs/cli/) + +## Quick start + +Create a sandbox and run Kiro for a project directory: + +```console +$ sbx run kiro ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run kiro +``` + +On first run, Kiro prompts you to authenticate using device flow. + +## Authentication + +Kiro uses device flow authentication, which requires interactive login through +a web browser. This method provides secure authentication without storing API +keys directly. + +### Device flow login + +When you first run Kiro, it prompts you to authenticate: + +1. Kiro displays a URL and a verification code +2. Open the URL in your web browser +3. Enter the verification code +4. Complete the authentication flow in your browser +5. Return to the terminal - Kiro proceeds automatically + +The authentication session is persisted in the sandbox and doesn't require +repeated login unless you destroy and recreate the sandbox. + +### Manual login + +You can trigger the login flow manually: + +```console +$ sbx run kiro --name -- login --use-device-flow +``` + +This command initiates device flow authentication without starting a coding +session. + +### Authentication persistence + +Kiro stores authentication state in `~/.local/share/kiro-cli/data.sqlite3` +inside the sandbox. This database persists as long as the sandbox exists. If +you destroy the sandbox, you'll need to authenticate again when you recreate +it. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host. Only +project-level configuration in the working directory is available inside the +sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +Kiro requires minimal configuration. The agent runs with trust-all-tools mode +by default, which lets it execute commands without repeated approval prompts. + +### Default startup command + +Without extra args, the sandbox runs: + +```text +kiro chat --trust-all-tools +``` + +When the first argument after `--` is a flag (begins with `-`), it's added +after the defaults — for example, `sbx run kiro -- --resume` runs +`kiro chat --trust-all-tools --resume`. When the first argument is a bare word, +it replaces the defaults, which is why `sbx run kiro -- login --use-device-flow` +runs the login subcommand on its own. To run `chat` with extra arguments of +your own, include the subcommand: + +```console +$ sbx run kiro -- chat --trust-all-tools --resume +``` + +## Base image + +Template: `docker/sandbox-templates:kiro` + +Authentication state is persisted across sandbox restarts. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/opencode.md b/content/manuals/ai/sandboxes/agents/opencode.md new file mode 100644 index 000000000000..fa192b3ca82e --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/opencode.md @@ -0,0 +1,119 @@ +--- +title: OpenCode +weight: 90 +description: | + Use OpenCode in Docker Sandboxes with multi-provider authentication and TUI + interface for AI development. +keywords: docker sandboxes, opencode, ai agent, authentication, sbx +--- + +This guide covers authentication, configuration, and usage of OpenCode in a +sandboxed environment. + +Official documentation: [OpenCode](https://opencode.ai/docs) + +## Quick start + +Create a sandbox and run OpenCode for a project directory: + +```console +$ sbx run opencode ~/my-project +``` + +The workspace parameter is optional and defaults to the current directory: + +```console +$ cd ~/my-project +$ sbx run opencode +``` + +OpenCode launches a TUI (text user interface) where you can select your +preferred LLM provider and interact with the agent. + +## Authentication + +OpenCode supports multiple providers. Store keys for the providers you want to +use with [stored secrets](../configuration/credentials.md#stored-secrets): + +```console +$ sbx secret set openai +$ sbx secret set anthropic +$ sbx secret set google +$ sbx secret set xai +$ sbx secret set groq +$ sbx secret set aws +$ sbx secret set openrouter +``` + +You only need to configure the providers you want to use. OpenCode detects +available credentials and offers those providers in the TUI. + +### OpenCode Zen API keys + +OpenCode Zen API keys aren't part of the built-in OpenCode credentials that +`sbx secret set` supports. To use an OpenCode Zen API key, store it as a +[custom secret](../configuration/credentials.md#custom-secrets): + +Set the `OPENCODE_API_KEY` environment variable on the host, then store it: + +```console +$ sbx secret set-custom \ + --host opencode.ai \ + --env OPENCODE_API_KEY \ + --value "$OPENCODE_API_KEY" +``` + +Custom secrets keep the real key in the host secret store. The sandbox receives +`OPENCODE_API_KEY` as a placeholder, and the host-side proxy replaces that +placeholder with the real key on requests to `opencode.ai`. + +OpenCode Zen also requires network access to `opencode.ai`: + +```console +$ sbx policy allow network opencode.ai:443 +``` + +If you add a global custom secret, recreate existing OpenCode sandboxes so the +new environment variable is available inside the sandbox. + +## Configuration + +Sandboxes don't pick up user-level configuration from your host. Only +project-level configuration in the working directory is available inside the +sandbox. See +[Why doesn't the sandbox use my user-level agent configuration?](../faq.md#why-doesnt-the-sandbox-use-my-user-level-agent-configuration) +for workarounds. + +OpenCode uses a TUI interface and doesn't require extensive configuration +files. The agent prompts you to select a provider when it starts, and you can +switch providers during a session. + +### Default startup command + +The sandbox runs `opencode` with no implicit flags. Args after `--` are passed +straight through. For example, to resume an existing session: + +```console +$ sbx run opencode -- -s +``` + +### TUI mode + +OpenCode launches in TUI mode by default. The interface shows: + +- Available LLM providers (based on configured credentials) +- Current conversation history +- File operations and tool usage +- Real-time agent responses + +Use keyboard shortcuts to navigate the interface and interact with the agent. + +## Base image + +Template: `docker/sandbox-templates:opencode` + +OpenCode supports multiple LLM providers with automatic credential injection +through the sandbox proxy. + +See [Customize](../customize/) to pre-install tools or customize this +environment. diff --git a/content/manuals/ai/sandboxes/agents/shell.md b/content/manuals/ai/sandboxes/agents/shell.md new file mode 100644 index 000000000000..70c0ac8b63c0 --- /dev/null +++ b/content/manuals/ai/sandboxes/agents/shell.md @@ -0,0 +1,53 @@ +--- +title: Shell +weight: 100 +description: Run an agent-less sandbox with a Bash login shell for manual setup, testing custom agent implementations, or inspecting a running environment. +keywords: sandboxes, sbx, shell, agent, manual setup, testing +--- + +`sbx run shell` drops you into a Bash login shell inside a sandbox with no +pre-installed agent binary. It's useful for installing and configuring +agents manually, testing custom implementations, or inspecting a running +environment. + +```console +$ sbx run shell ~/my-project +``` + +The workspace path defaults to the current directory. To run a one-off +command instead of an interactive shell, pass it after `--`: + +```console +$ sbx run shell -- -c "echo 'Hello from sandbox'" +``` + +## Default startup command + +Without extra args, the sandbox runs `bash -l`. When the first argument after +`--` is a flag (begins with `-`), it's added after `-l`, so login-shell +behavior is preserved: + +```console +$ sbx run shell -- -c "echo hi" # runs bash -l -c "echo hi" +``` + +When the first argument is a bare word, it replaces `-l` instead. + +Store credentials using [stored secrets](../configuration/credentials.md#stored-secrets) +before running the sandbox. The proxy injects them into outbound API requests; +credentials are never stored inside the VM: + +```console +$ sbx secret set anthropic +$ sbx secret set openai +``` + +Once inside the shell, you can install agents using their standard methods, +for example `npm install -g @continuedev/cli`. For complex setups, build a +[custom template](../customize/templates.md) instead of installing +interactively each time. + +## Base image + +The shell sandbox uses the `shell` base image — the common base environment +without a pre-installed agent. diff --git a/content/manuals/ai/sandboxes/architecture.md b/content/manuals/ai/sandboxes/architecture.md new file mode 100644 index 000000000000..88c8da4bdebe --- /dev/null +++ b/content/manuals/ai/sandboxes/architecture.md @@ -0,0 +1,123 @@ +--- +title: Architecture +weight: 100 +description: Technical architecture of Docker Sandboxes; workspace mounting, storage, networking, and sandbox lifecycle. +keywords: docker sandboxes, architecture, microVM, workspace mounting, sandbox lifecycle +--- + +This page explains how Docker Sandboxes work under the hood. For the security +properties of the architecture, see [Sandbox isolation](security/isolation.md). + +## Workspace mounting + +Your workspace is mounted directly into the sandbox through a filesystem +passthrough. The sandbox sees your actual host files, so changes in either +direction are instant with no sync process involved. + +Your workspace is mounted at the same absolute path as on your host. Preserving +absolute paths means error messages, configuration files, and build outputs all +reference paths you can find on your host. The agent sees exactly the directory +structure you see, which reduces confusion when debugging or reviewing changes. + +> [!WARNING] +> Avoid mounting network-attached or remote storage (network drives, SMB/NFS +> shares, or cloud-synced folders) as a workspace. The sandbox accesses +> workspaces through a filesystem passthrough, so every file read and write +> goes over the network. This adds latency and slows agent performance. + +## Storage and persistence + +When you create a sandbox, everything inside it persists until you remove it: +Docker images and containers built or pulled by the agent, installed packages, +agent state and history, and workspace changes. + +Each sandbox maintains its own Docker daemon state, image cache, and package +installations. Multiple sandboxes don't share images or layers. The +[shared agent skills store](workflows/agent-skills.md) is an exception: +supported agents mount the same host-side store read-write unless you opt out +when creating the sandbox. + +Each sandbox consumes disk space for its VM image, Docker images, container +layers, and volumes, and this grows as you build images and install packages. + +Virtiofs caching is enabled by default on all operating systems. File reads +from the sandbox VM are cached on the host side, reducing round-trips through +the filesystem passthrough and improving performance for read-heavy workloads +such as `git status` or directory scans. To opt out, set +`DOCKER_SANDBOXES_ENABLE_VIRTIOFS_CACHE=0` when creating the sandbox: + +```console +$ DOCKER_SANDBOXES_ENABLE_VIRTIOFS_CACHE=0 sbx run