{{ define "head-extra" }} {{ $style := resources.Get "api-reference/reference.css" | fingerprint }} {{ $script := resources.Get "api-reference/reference.js" | fingerprint }} {{ end }} {{ define "left" }} {{ partial "sidebar/mainnav.html" . }} {{ if eq .Params.view "catalog" }} {{ partial "sidebar/sections.html" . }} {{ else }} {{ partial "api-reference/navigation.html" . }} {{ end }} {{ end }} {{ define "main" }}
{{ $data := index hugo.Data "api-reference" }} {{ $api := dict }}{{ range $data.apis }} {{ if eq .id $.Params.apiID }}{{ $api = . }}{{ end }} {{ end }} {{ if eq .Params.view "catalog" }}

Developer reference

Docker APIs

Build with Docker, from your local daemon to hosted services.

Choose an API to find connection guidance, operations, and data models.

{{ range $data.apis }} {{ if eq .connection "unix" }} Your daemon {{ else }} Hosted service {{ end }}

{{ .title }}{{ if .experimental }}· Experimental{{ end }}

API {{ .version }} · {{ len .operations }} operations

Explore reference →
{{ end }} {{ range $data.legacyAPIs }} {{ if eq .connection "unix" }} Your daemon {{ else }} Hosted service {{ end }}

{{ .title }}{{ if .experimental }}· Experimental{{ end }}

{{ .description }}

Explore reference →
{{ end }}
{{ else }} {{ if $api.experimental }}

Experimental

{{ if eq .Params.view "overview" }}

This API is experimental. Features, interfaces, and behavior may change.

{{ end }} {{ end }}
Product manualDownload OpenAPI specificationMarkdown
{{ if eq .Params.view "overview" }}

{{ if eq $api.connection "unix" }} User-operated API {{ else }} Hosted API {{ end }}

{{ $api.title }} API

API {{ $api.version }} · {{ len $api.operations }} operations · {{ len $api.schemas }} named schemas

Overview

{{ partial "api-reference/description.html" (dict "text" $api.description "api" $api) | markdownify }}

{{ if eq $api.connection "unix" }} Connecting to {{ $api.title }} {{ else }} Connecting to the {{ $api.title }} API {{ end }}

{{ range $name, $scheme := $api.securitySchemes }} {{ with $scheme.description }}

{{ index $scheme "x-displayName" | default $name }}

{{ . | markdownify }}
{{ end }} {{ end }} {{ if eq $api.connection "unix" }}
curl --unix-socket /var/run/docker.sock http://localhost/v{{ $api.version }}/version
{{ else }} {{ range $api.servers }}{{ .url }}{{ end }} {{ end }}{{ range $api.guides }} {{ $guide := site.GetPage (index (split . "#") 0) }}

{{ $guide.Title }}

{{ end }}
{{ $overviewTags := partial "api-reference/overview-tags.html" $api }} {{ range $api.tags }} {{ if not (in $overviewTags .) }} {{ end }} {{ end }} {{ range $overviewTags }}

{{ .summary }}

{{ partial "api-reference/description.html" (dict "text" .description "api" $api) | markdownify }}
{{ end }}

Operations

{{ range $api.operations }} {{ .method }}{{ partial "api-reference/path.html" .path }}{{ .summary }} {{ end }}

Schemas

{{ else if eq .Params.view "operation" }} {{ range $api.operations }} {{ if eq .id $.Params.operationID }}

{{ .summary }}

{{ .method }}{{ partial "api-reference/path.html" .path }}{{ if .deprecated }} Deprecated {{ end }}
{{ partial "api-reference/description.html" (dict "text" .description "api" $api) | markdownify }}

Connection and access

API connection and authentication guidance

{{ if and (eq $api.product "engine") (where .parameters "name" "X-Registry-Auth") }}

X-Registry-Auth delegates registry credentials and does not authenticate the daemon caller.

{{ end }} {{ range .servers }}

{{ .url }}{{ with .description }} — {{ . }} {{ end }}

{{ end }} {{ range .servers }} {{ range $name, $variable := .variables }}

{{ $name }}: {{ $variable.description }}

{{ end }} {{ end }} {{ if not .security }}

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

{{ else }}

Use one of these alternatives. Requirements within an alternative apply together.

    {{ range .security }}
  • {{ $first := true }}{{ range $name, $scopes := . }} {{ if not $first }} AND {{ end }}{{ $first = false }}{{ $name }}{{ with $scopes }} ({{ delimit . ", " }}) {{ end }} {{ end }}{{ if $first }}Anonymous access{{ end }}
  • {{ end }}
{{ end }} {{ with index .raw "x-websocket" }} {{ partial "api-reference/websocket.html" (dict "socket" . "api" $api) }} {{ end }}

Parameters

{{ if not .parameters }}

No parameters are declared.

{{ end }} {{ range .parameters }}

{{ .name }} {{ .in }} {{ if .required }} Required {{ end }}

{{ partial "api-reference/description.html" (dict "text" .description "api" $api) | markdownify }}
{{ if isset . "schema" }} {{ partial "api-reference/schema.html" (dict "schema" .schema "api" $api "depth" 0) }} {{ end }}{{ with .content }}
{{ . | jsonify (dict "indent" "  ") }}
{{ end }}{{ with .style }}

Serialization: {{ . }}

{{ end }}
{{ end }}

Request and responses

{{ range $i, $v := .variants }}

{{ $v.direction | humanize }} {{ with $v.status }} {{ . }} {{ end }}

{{ partial "api-reference/description.html" (dict "text" $v.description "api" $api) | markdownify }}
{{ if $v.media }}

{{ $v.media }}

{{ else }}

No response content is declared.

{{ end }} {{ with $v.headers }}

Headers

{{ range $name,$header := . }}
{{ $name }}

{{ $header.description }}

{{ $header | jsonify (dict "indent" "  ") }}
{{ end }} {{ end }} {{ if isset $v "schema" }} {{ partial "api-reference/schema.html" (dict "schema" $v.schema "api" $api "depth" 0) }} {{ end }} {{ if isset $v "itemSchema" }}

Stream item

{{ partial "api-reference/schema.html" (dict "schema" $v.itemSchema "api" $api "depth" 0) }} {{ end }} {{ range $key := slice "encoding" "itemEncoding" "prefixEncoding" }} {{ with index $v $key }}
{{ $key }}: content types and part headers
{{ . | jsonify (dict "indent" "  ") }}
{{ end }} {{ end }} {{ if $v.examples }}
{{ if gt (len $v.examples) 1 }} {{ end }}{{ range $j,$ex := $v.examples }}

{{ $ex.name }}

{{ $ex.text }}
{{ end }}
{{ end }}
{{ end }}

Referenced schemas

{{ range .references }} {{ if .url }}

{{ .ref }}

{{ end }} {{ end }}
Complete operation contract
{{ .raw | jsonify (dict "indent" "  ") }}
{{ end }} {{ end }} {{ else if eq .Params.view "schema" }} {{ range $api.schemas }} {{ if eq .name $.Params.schemaName }}

Schema

{{ .name }}

{{ partial "api-reference/schema.html" (dict "schema" .schema "api" $api "depth" 0) }} {{ end }} {{ end }} {{ end }} {{ end }}
{{ end }}