{{ define "main" }} {{ $data := "" }} {{ if .Params.datafolder }} {{ $data = index (index site.Data .Params.datafolder) .Params.datafile }} {{ else }} {{ $data = index site.Data .Params.datafile }} {{ end }} {{ .Store.Set "headings" slice }} {{ .Store.Set "subheadings" slice }}
{{ partial "breadcrumbs.html" . }}

{{ .Title }}

{{ with $data.short }} {{ end }} {{ with $data.usage }} {{ end }} {{ with $data.aliases }} {{ $aliases := strings.Replace . (fmt.Printf "%s, " page.Title) "" }} {{ end }}
Description {{ . }}
Usage {{ . }}
Aliases {{ partialCached "tooltip.html" "An alias is a short or memorable alternative for a longer command." "cli-alias" }}
{{ range (strings.Split $aliases ", ") }} {{ . }} {{ end }}
{{ .Content }} {{ if $data.deprecated }} {{ markdownify ` > [!WARNING] > This command is deprecated > > It may be removed in a future Docker version. For more information, see the > [Docker roadmap](https://github.com/docker/roadmap/issues/209)` }} {{ end }} {{ if or $data.experimental $data.experimentalcli }} {{ markdownify ` {{% experimental %}} **This command is experimental.** Experimental features are intended for testing and feedback as their functionality or design may change between releases without warning or can be removed entirely in a future release. {{% /experimental %}}` }} {{ end }} {{ with $data.kubernetes }}

{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Kubernetes") "k8s" }} This command works with the Kubernetes orchestrator.

{{ end }} {{ with $data.swarm }}

{{ partialCached "components/badge.html" (dict "color" "blue" "content" "Swarm") "swarm" }} This command works with the Swarm orchestrator.

{{ end }} {{ with $data.long }} {{ $heading := dict "level" 2 "text" "Description" }} {{ partialCached "heading.html" $heading "cli-description" }} {{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }} {{ $.Store.Add "headings" $heading }} {{ range $subHeadings }} {{ $lvl := strings.Count "#" . }} {{ $txt := strings.TrimLeft "# " . }} {{ $.Store.Add "headings" (dict "level" $lvl "text" $txt) }} {{ end }} {{ . | $.RenderString (dict "display" "block") }} {{ end }} {{ with $data.options }} {{ $opts := where . "hidden" false }} {{ with $opts }} {{ $heading := dict "level" 2 "text" "Options" }} {{ partialCached "heading.html" $heading "cli-options" }} {{ $.Store.Add "headings" $heading }}
{{ range . }} {{ $short := .shorthand }} {{ $long := .option }} {{ $skipDefault := `[],map[],false,0,0s,default,'',""` }} {{ end }}
Option Default Description
{{ with .details_url }} {{ with $short }}-{{ . }}, {{end}}--{{ $long }} {{ else }} {{ with $short }}-{{ . }}, {{end}}--{{ $long }} {{ end }} {{ with .default_value }} {{ cond (in $skipDefault .) "" (printf "%s" . | safeHTML) }} {{ end }} {{ with .min_api_version }} {{ partialCached "components/badge.html" (dict "color" "blue" "content" (printf "API %s+" .)) "api" . }} {{ end }} {{ with .deprecated }} {{ partialCached "components/badge.html" (dict "color" "red" "content" "Deprecated") "deprecated" }} {{ end }} {{ with .experimental }} {{ partialCached "components/badge.html" (dict "color" "amber" "content" "experimental (daemon)") "exp" }} {{ end }} {{ with .experimentalcli }} {{ partialCached "components/badge.html" (dict "color" "amber" "content" "experimental (CLI)") "exp-cli" }} {{ end }} {{ with .kubernetes }} {{ partialCached "components/badge.html" (dict "color" "blue" "content" "Kubernetes") "k8s" }} {{ end }} {{ with .swarm }} {{ partialCached "components/badge.html" (dict "color" "blue" "content" "Swarm") "swarm" }} {{ end }} {{ if .description }} {{/* replace newlines in long desc with break tags */}} {{ markdownify (strings.Replace .description "\n" "
") }} {{ end }}
{{ end }} {{ end }} {{ with $data.examples }} {{ $heading := dict "level" 2 "text" "Examples" }} {{ partialCached "heading.html" $heading "cli-examples" }} {{ $subHeadings := (strings.FindRE `(?m:#{3,4} .*)` .) }} {{ $.Store.Add "headings" $heading }} {{ range $subHeadings }} {{ $lvl := strings.Count "#" . }} {{ $txt := strings.TrimLeft "# " . }} {{ $.Store.Add "headings" (dict "level" $lvl "text" $txt) }} {{ end }} {{ $.RenderString (dict "display" "block") . }} {{ end }} {{ if eq .Kind "section" }} {{ $heading := dict "level" 2 "text" "Subcommands" }} {{ partialCached "heading.html" $heading "cli-subcommands" }} {{ $.Store.Add "headings" $heading }} {{ range .Pages }} {{- if and .Params.datafolder .Params.datafile }} {{- end }} {{ end }}
Command Description
{{ .Title }} {{ $data := index (index site.Data .Params.datafolder) .Params.datafile }} {{ $data.short }}
{{ end }}
{{ end }}