diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..256a368 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,19 @@ +.dockerignore +.DS_Store +.git +.github +.gitignore +.gitmodules +.idea +.jekyll-metadata +.sass-cache +tests +_site +CONTRIBUTING.md +Dockerfile +Dockerfile.archive +docker-compose.yml +Gemfile +Gemfile.lock +_website*.json + diff --git a/.env b/.env new file mode 100644 index 0000000..eb27326 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +COMPOSE_DOCKER_CLI_BUILD=1 +DOCKER_BUILDKIT=1 diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..be34269 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +webpack.config.js +server/index.js +server/env.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..010dcf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +**/.DS_Store +**/desktop.ini +.bundle/** +.jekyll-metadata +_site/** +.sass-cache/** +CNAME +Gemfile.lock +_kbase/** diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2f5e5ca --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "tests/src/github.com/gdevillele/frontparser"] + path = tests/src/github.com/gdevillele/frontparser + url = https://github.com/gdevillele/frontparser.git + branch = f28e87c7b9dae139855b574e96f22822986249a8 +[submodule "tests/src/golang.org/x/net"] + path = tests/src/golang.org/x/net + url = https://github.com/golang/net + branch = 45e771701b814666a7eb299e6c7a57d0b1799e91 +[submodule "tests/src/gopkg.in/yaml.v2"] + path = tests/src/gopkg.in/yaml.v2 + url = https://github.com/go-yaml/yaml.git + branch = a5b47d31c556af34a302ce5d659e6fea44d90de0 diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..3111481 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "default": true, + "MD013": { "line_length": -1 }, + "MD030": { "ol_multi": 2 } +} \ No newline at end of file diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..e75da3e --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.3.6 diff --git a/404.html b/404.html new file mode 100644 index 0000000..410cdd8 --- /dev/null +++ b/404.html @@ -0,0 +1,15 @@ + + + + + + Docker Documentation + + +

We have moved away from the docker.github.io domain. If you're not automatically redirected, please visit us at docs.docker.com.

+ + + + \ No newline at end of file diff --git a/404.md b/404.md new file mode 100644 index 0000000..a668cc2 --- /dev/null +++ b/404.md @@ -0,0 +1,33 @@ +--- +title: "Sorry, we can't find that page" +permalink: /404.html +noratings: true +notoc: true +sitemap: false +skip_read_time: true +--- + +There might be a mistake in the URL or you might've clicked a link to content +that no longer exists. If you think it's the latter, please file an issue in +our [issue tracker on GitHub](https://github.com/docker/docker.github.io/issues/new) +and let us know what happened. Please also include a link to where the error +occurred, if applicable. + +[**Click here to create a new ticket**](https://github.com/docker/docker.github.io/issues/new){:.newissue.button.primary-btn} + + +[![404 page not found](/images/404-docs.png)](https://docs.docker.com/ "Go to the homepage") + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b42f3ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,94 @@ +# This Dockerfile builds the docs for https://docs.docker.com/ +# from the master branch of https://github.com/docker/docker.github.io +# +# Here is the sequence: +# 1. Set up base stages for building and deploying +# 2. Collect and build the reference documentation (from upstream resources) +# 3. Build static HTML from the current branch +# 4. Build the final image, combining the reference docs and current version +# of the documentation +# +# When the image is run, it starts Nginx and serves the docs at port 4000 + +# Jekyll environment (development/production) +ARG JEKYLL_ENV=development + +# Engine +ARG ENGINE_BRANCH="19.03" + +# Distribution +ARG DISTRIBUTION_BRANCH="release/2.7" + +### +# Set up base stages for building and deploying +### +FROM starefossen/github-pages:198 AS builderbase +ENV TARGET=/usr/share/nginx/html +WORKDIR /usr/src/app/md_source/ + +# Set vars used by fetch-upstream-resources.sh script as an environment variable, +# so that they are persisted in the image for use in later stages. +ARG ENGINE_BRANCH +ENV ENGINE_BRANCH=${ENGINE_BRANCH} + +ARG DISTRIBUTION_BRANCH +ENV DISTRIBUTION_BRANCH=${DISTRIBUTION_BRANCH} + +# Fetch upstream resources (reference documentation) +# Only add the files that are needed to build these reference docs, so that these +# docs are only rebuilt if changes were made to ENGINE_BRANCH or DISTRIBUTION_BRANCH. +# Disable caching (docker build --no-cache) to force updating these docs. +FROM alpine AS upstream-resources +RUN apk add --no-cache subversion wget +WORKDIR /usr/src/app/md_source/ +COPY ./_scripts/fetch-upstream-resources.sh ./_scripts/ +ARG ENGINE_BRANCH +ARG DISTRIBUTION_BRANCH +RUN ./_scripts/fetch-upstream-resources.sh . + + +# Build the static HTML for the current docs. +# After building with jekyll, fix up some links +FROM builderbase AS current +COPY . . +COPY --from=upstream-resources /usr/src/app/md_source/. ./ +# substitute the "{site.latest_engine_api_version}" in the title for the latest +# API docs, based on the latest_engine_api_version parameter in _config.yml +RUN ./_scripts/update-api-toc.sh +ARG JEKYLL_ENV +RUN echo "Building docs for ${JEKYLL_ENV} environment" +RUN set -eu; \ + if [ "${JEKYLL_ENV}" = "production" ]; then \ + jekyll build --profile -d ${TARGET} --config _config.yml,_config_production.yml; \ + sed -i 's#/#https://docs.docker.com/#' "${TARGET}/sitemap.xml"; \ + else \ + jekyll build --profile -d ${TARGET}; \ + echo '[]' > ${TARGET}/js/metadata.json; \ + fi; \ + find ${TARGET} -type f -name '*.html' | while read i; do sed -i 's#\(]* href="\)https://docs.docker.com/#\1/#g' "$i"; done; + + +# This stage only contains the generated files. It can be used to host the +# documentation on a non-containerised service (e.g. to deploy to an s3 bucket). +# When using BuildKit, use the '--output' option to build the files and to copy +# them to your local filesystem. +# +# DOCKER_BUILDKIT=1 docker build --target=deploy-source --output=./_site . +FROM scratch AS deploy-source +COPY --from=current /usr/share/nginx/html / + +# Final stage, which includes nginx, and the current docs. +# +# To build current docs: +# DOCKER_BUILDKIT=1 docker build -t docs . +FROM nginx:alpine AS deploy +ENV TARGET=/usr/share/nginx/html +WORKDIR $TARGET + +COPY --from=current /usr/share/nginx/html . + +# Configure NGINX +COPY _deploy/nginx/default.conf /etc/nginx/conf.d/default.conf +ARG JEKYLL_ENV +ENV JEKYLL_ENV=${JEKYLL_ENV} +CMD echo -e "Docker docs are viewable at:\nhttp://0.0.0.0:4000 (build target: ${JEKYLL_ENV})"; exec nginx -g 'daemon off;' diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..f5ffef6 --- /dev/null +++ b/Gemfile @@ -0,0 +1,43 @@ +source "https://rubygems.org" + +# Update me once in a while: https://github.com/github/pages-gem/releases +# Please ensure, before upgrading, that this version exists as a tag in starefossen/github-pages here: +# https://hub.docker.com/r/starefossen/github-pages/tags/ +# +# Fresh install? +# +# Windows: +# Install Ruby 2.3.3 x64 and download the Development Kit for 64-bit: +# https://rubyinstaller.org/downloads/ +# +# Run this to install devkit after extracting: +# ruby /dk.rb init +# ruby /dk.rb install +# +# then: +# gem install bundler +# bundle install +# +# Mac/Linux: +# Install Ruby 2.3.x and then: +# gem install bundler +# bundle install +# +# --------------------- +# Upgrading? Probably best to reset your environment: +# +# Remove all gems: +# gem uninstall -aIx +# +# (If Windows, do the dk.rb bits above, then go to the next step below) + +# Install anew: +# gem install bundler +# bundle install + +# This only affects interactive builds (local build, Netlify) and not the +# live site deploy, which uses the Dockerfiles found in the publish-tools +# branch. + +gem "github-pages", "198" +gem 'wdm' if Gem.win_platform? diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..0562741 --- /dev/null +++ b/_config.yml @@ -0,0 +1,72 @@ +## +# Default configuration file +# +# This file overrides options set in _config.yml for production / deploy +## +name: Docker Documentation +markdown: kramdown +kramdown: + input: GFM + gfm_quirks: [paragraph_end, no_auto_typographic] + html_to_native: true + hard_wrap: false + syntax_highlighter: rouge + toc_levels: 2..3 +incremental: true +permalink: pretty +safe: false +lsi: false +exclude: ["_samples", "_scripts", "404.html", "datacenter", "ee", "index.html", "js/metadata.json"] + +# Component versions -- address like site.docker_ce_version +# You can't have - characters in these for non-YAML reasons +latest_engine_api_version: "1.40" +docker_ce_version: "19.03" +compose_version: "1.27.4" +compose_file_v3: "3.8" +compose_file_v2: "2.4" +machine_version: "0.16.0" +distribution_version: "2.7" + +# List of plugins to enable for local development builds. Mostly the same as +# for production, but without the "jekyll-sitemap" plugin, which is not needed +# for previewing, and excluding saves some time to build +plugins: + - jekyll-redirect-from + - jekyll-relative-links + +# Assets +# +# We specify the directory for Jekyll so we can use @imports. +# +# For local development, we build css with the "expanded" format to produce +# human-readable output for easier debugging. +sass: + sass_dir: _scss + style: expanded + +# Set default options / metadata for some paths. +# +# Setting options here prevents having to repeat the same option in front-matter +# on every page. Avoid using wildcards, such as "path: engine/api/v1.*", as +# limitations in Jekyll cause those to introduce a _severe_ impact on build-time, +# affecting generation of (e.g.) sitemap.xml and metadata.json, resulting in the +# total build to take 60 seconds longer to build (!). +# +# The list below is for "development" (local builds, and PR previews) builds only, +# and should be kept minimal to allow for fast builds. Other options should go +# into _config_production.yml, which is used for production deploys. +defaults: + - scope: + path: "" + type: "pages" + values: + layout: docs + sitemap: false + toc_min: 2 + toc_max: 3 + + - scope: + path: engine/reference/commandline + values: + skip_read_time: true diff --git a/_config_production.yml b/_config_production.yml new file mode 100644 index 0000000..31a1963 --- /dev/null +++ b/_config_production.yml @@ -0,0 +1,115 @@ +## +# This file overrides options set in _config.yml for production / deploy +## + +# Override the exclusion list to include files that are excluded in "development", +# such as the "enterprise" stubs, which are in place to facilitate redirects +# to Mirantis. +exclude: ["_scripts", "404.html", "index.html"] + +# Google Analytics, etc. +google_analytics: GTM-WL2QLG5 +polldaddy_id: 8453675 + +# Enable search autocompletion (requires metadata.json to be generated) +local_search: true + +plugins: + - jekyll-redirect-from + - jekyll-relative-links + - jekyll-sitemap + +# Assets +# +# For production/deploy, we build css with the "compressed" format, to produce +# smaller files. +sass: + style: compressed + +collections: + samples: + output: true + +# Set default options / metadata for some paths. +# +# Setting options here prevents having to repeat the same option in front-matter +# on every page. Avoid using wildcards, such as "path: engine/api/v1.*", as +# limitations in Jekyll cause those to introduce a _severe_ impact on build-time, +# affecting generation of (e.g.) sitemap.xml and metadata.json, resulting in the +# total build to take 60 seconds longer to build (!). +# +# The list below is used for *production* deploys, and overrides the one defined +# in "_config.yml", which is used for local builds and pull-request previews. +defaults: + - scope: + path: "" + type: "pages" + values: + layout: docs + toc_min: 2 + toc_max: 3 + + # Set the correct edit-URL for upstream resources. We usually don't create a direct + # edit link for these, and instead point to the directory that contains the file. + - scope: + path: engine/deprecated.md + values: + edit_url: "https://github.com/docker/cli/tree/master/docs/" + - scope: + path: engine/extend.md + values: + edit_url: "https://github.com/docker/cli/tree/master/docs/extend" + - scope: + path: engine/reference + values: + edit_url: "https://github.com/docker/cli/tree/master/docs/reference" + - scope: + path: engine/reference/commandline + values: + edit_url: "https://github.com/docker/cli/tree/master/docs/reference/commandline" + skip_read_time: true + - scope: + path: glossary.md + values: + edit_url: "https://github.com/docker/docker.github.io/blob/master/_data/glossary.yaml" + - scope: + path: notary/reference + values: + edit_url: "https://github.com/theupdateframework/notary/tree/master/docs/reference" + - scope: + path: registry/configuration + values: + edit_url: "https://github.com/docker/distribution/tree/master/docs" + - scope: + path: registry/spec + values: + edit_url: "https://github.com/docker/distribution/tree/master/docs/spec" + - scope: + path: compliance + values: + edit_url: "https://github.com/mirantis/compliance/tree/master/docs/compliance" + + # Hide Enterprise content from sitemap. These directories still contains stubs + # that are needed to redirect old URLs + - scope: + path: "datacenter" + values: + sitemap: false + title: Docker Enterprise moved to Mirantis + - scope: + path: "desktop/enterprise" + values: + sitemap: false + - scope: + path: "ee" + values: + sitemap: false + title: Docker Enterprise moved to Mirantis + - scope: + path: "machine" + values: + sitemap: false + - scope: + path: "samples/library" + values: + sitemap: false diff --git a/_data/advisories.yaml b/_data/advisories.yaml new file mode 100644 index 0000000..93547a6 --- /dev/null +++ b/_data/advisories.yaml @@ -0,0 +1,20 @@ + +#TODO: work out how to add a data dir to any repo that has documentation +# atm, repo's have a docs dir that is akin to the hugo content dir. + + +# Define Advisory texts +# can be used in page frontmatter, e.g.: +# advisory: experimental + +texts: + experimental: "The functionality described on this page is marked as Experimental, and as such, may change before it becomes generally available." + kitematic: "**Legacy desktop solution.** Kitematic is a legacy solution, bundled with [Docker Toolbox](/toolbox/overview/). We recommend updating to [Docker Desktop for Mac](/docker-for-mac/) or [Docker Desktop for Windows](/docker-for-windows/) if your system meets the requirements for one of those applications." + + +# URL based advisories +# any URL that begins with "/engine/" will get the "engine" advisory +# will be over-ridden by the `advisory` frontmatter in the topic +# [paths] +# "/engine/" = "engine" +# "/swarm/" = "swarm" diff --git a/_data/buildx/docker_buildx.yaml b/_data/buildx/docker_buildx.yaml new file mode 100644 index 0000000..0232829 --- /dev/null +++ b/_data/buildx/docker_buildx.yaml @@ -0,0 +1,46 @@ +command: docker buildx +short: Build with BuildKit +long: Build with BuildKit +pname: docker +plink: docker.yaml +cname: +- docker buildx bake +- docker buildx build +- docker buildx create +- docker buildx du +- docker buildx imagetools +- docker buildx inspect +- docker buildx ls +- docker buildx prune +- docker buildx rm +- docker buildx stop +- docker buildx use +- docker buildx version +clink: +- docker_buildx_bake.yaml +- docker_buildx_build.yaml +- docker_buildx_create.yaml +- docker_buildx_du.yaml +- docker_buildx_imagetools.yaml +- docker_buildx_inspect.yaml +- docker_buildx_ls.yaml +- docker_buildx_prune.yaml +- docker_buildx_rm.yaml +- docker_buildx_stop.yaml +- docker_buildx_use.yaml +- docker_buildx_version.yaml +options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_bake.yaml b/_data/buildx/docker_buildx_bake.yaml new file mode 100644 index 0000000..46ed303 --- /dev/null +++ b/_data/buildx/docker_buildx_bake.yaml @@ -0,0 +1,97 @@ +command: docker buildx bake +aliases: f +short: Build from a file +long: Build from a file +usage: docker buildx bake [OPTIONS] [TARGET...] +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: file + shorthand: f + value_type: stringArray + default_value: '[]' + description: Build definition file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: load + value_type: bool + default_value: "false" + description: Shorthand for --set=*.output=type=docker + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-cache + value_type: bool + default_value: "false" + description: Do not use cache when building the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: print + value_type: bool + default_value: "false" + description: Print the options without building + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: progress + value_type: string + default_value: auto + description: | + Set type of progress output (auto, plain, tty). Use plain to show container output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Always attempt to pull a newer version of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: push + value_type: bool + default_value: "false" + description: Shorthand for --set=*.output=type=registry + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + value_type: stringArray + default_value: '[]' + description: 'Override target value (eg: targetpattern.key=value)' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_build.yaml b/_data/buildx/docker_buildx_build.yaml new file mode 100644 index 0000000..da47926 --- /dev/null +++ b/_data/buildx/docker_buildx_build.yaml @@ -0,0 +1,359 @@ +command: docker buildx build +aliases: b +short: Start a build +long: Start a build +usage: docker buildx build [OPTIONS] PATH | URL | - +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: add-host + value_type: stringSlice + default_value: '[]' + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: allow + value_type: stringSlice + default_value: '[]' + description: | + Allow extra privileged entitlement, e.g. network.host, security.insecure + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: build-arg + value_type: stringArray + default_value: '[]' + description: Set build-time variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cache-from + value_type: stringArray + default_value: '[]' + description: | + External cache sources (eg. user/app:cache, type=local,src=path/to/dir) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cache-to + value_type: stringArray + default_value: '[]' + description: | + Cache export destinations (eg. user/app:cache, type=local,dest=path/to/dir) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: compress + value_type: bool + default_value: "false" + description: Compress the build context using gzip + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + description: Name of the Dockerfile (Default is 'PATH/Dockerfile') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force-rm + value_type: bool + default_value: "false" + description: Always remove intermediate containers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: iidfile + value_type: string + description: Write the image ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: stringArray + default_value: '[]' + description: Set metadata for an image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: load + value_type: bool + default_value: "false" + description: Shorthand for --output=type=docker + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: string + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: string + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: string + default_value: default + description: | + Set the networking mode for the RUN instructions during build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-cache + value_type: bool + default_value: "false" + description: Do not use cache when building the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: output + shorthand: o + value_type: stringArray + default_value: '[]' + description: 'Output destination (format: type=local,dest=path)' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: stringArray + default_value: '[]' + description: Set target platform for build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: progress + value_type: string + default_value: auto + description: | + Set type of progress output (auto, plain, tty). Use plain to show container output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Always attempt to pull a newer version of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: push + value_type: bool + default_value: "false" + description: Shorthand for --output=type=registry + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the build output and print image ID on success + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "true" + description: Remove intermediate containers after a successful build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret + value_type: stringArray + default_value: '[]' + description: | + Secret file to expose to the build: id=mysecret,src=/local/secret + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: stringSlice + default_value: '[]' + description: Security options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: string + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: squash + value_type: bool + default_value: "false" + description: Squash newly built layers into a single new layer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ssh + value_type: stringArray + default_value: '[]' + description: | + SSH agent socket or keys to expose to the build (format: default|[=|[,]]) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: stringArray + default_value: '[]' + description: Name and optionally a tag in the 'name:tag' format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target + value_type: string + description: Set the target build stage to build. + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: string + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_create.yaml b/_data/buildx/docker_buildx_create.yaml new file mode 100644 index 0000000..80e1342 --- /dev/null +++ b/_data/buildx/docker_buildx_create.yaml @@ -0,0 +1,107 @@ +command: docker buildx create +short: Create a new builder instance +long: Create a new builder instance +usage: docker buildx create [OPTIONS] [CONTEXT|ENDPOINT] +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: append + value_type: bool + default_value: "false" + description: Append a node to builder instead of changing it + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: buildkitd-flags + value_type: string + description: Flags for buildkitd daemon + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: config + value_type: string + description: BuildKit config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: driver + value_type: string + description: 'Driver to use (available: [])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: driver-opt + value_type: stringArray + default_value: '[]' + description: Options for the driver + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: leave + value_type: bool + default_value: "false" + description: Remove a node from builder instead of changing it + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Builder instance name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: node + value_type: string + description: Create/modify node with given name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: stringArray + default_value: '[]' + description: Fixed platforms for current node + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: use + value_type: bool + default_value: "false" + description: Set the current builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_du.yaml b/_data/buildx/docker_buildx_du.yaml new file mode 100644 index 0000000..630f2dd --- /dev/null +++ b/_data/buildx/docker_buildx_du.yaml @@ -0,0 +1,39 @@ +command: docker buildx du +short: Disk usage +long: Disk usage +usage: docker buildx du +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: filter + value_type: filter + description: Provide filter values + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: verbose + value_type: bool + default_value: "false" + description: Provide a more verbose output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_imagetools.yaml b/_data/buildx/docker_buildx_imagetools.yaml new file mode 100644 index 0000000..cbfeb81 --- /dev/null +++ b/_data/buildx/docker_buildx_imagetools.yaml @@ -0,0 +1,26 @@ +command: docker buildx imagetools +short: Commands to work on images in registry +long: Commands to work on images in registry +pname: docker buildx +plink: docker_buildx.yaml +cname: +- docker buildx imagetools create +- docker buildx imagetools inspect +clink: +- docker_buildx_imagetools_create.yaml +- docker_buildx_imagetools_inspect.yaml +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_imagetools_create.yaml b/_data/buildx/docker_buildx_imagetools_create.yaml new file mode 100644 index 0000000..41332a6 --- /dev/null +++ b/_data/buildx/docker_buildx_imagetools_create.yaml @@ -0,0 +1,60 @@ +command: docker buildx imagetools create +short: Create a new image based on source images +long: Create a new image based on source images +usage: docker buildx imagetools create [OPTIONS] [SOURCE] [SOURCE...] +pname: docker buildx imagetools +plink: docker_buildx_imagetools.yaml +options: +- option: append + value_type: bool + default_value: "false" + description: Append to existing manifest + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dry-run + value_type: bool + default_value: "false" + description: Show final image instead of pushing + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: stringArray + default_value: '[]' + description: Read source descriptor from file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: stringArray + default_value: '[]' + description: Set reference for new image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_imagetools_inspect.yaml b/_data/buildx/docker_buildx_imagetools_inspect.yaml new file mode 100644 index 0000000..2c0ab8b --- /dev/null +++ b/_data/buildx/docker_buildx_imagetools_inspect.yaml @@ -0,0 +1,31 @@ +command: docker buildx imagetools inspect +short: Show details of image in the registry +long: Show details of image in the registry +usage: docker buildx imagetools inspect [OPTIONS] NAME +pname: docker buildx imagetools +plink: docker_buildx_imagetools.yaml +options: +- option: raw + value_type: bool + default_value: "false" + description: Show original JSON manifest + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_inspect.yaml b/_data/buildx/docker_buildx_inspect.yaml new file mode 100644 index 0000000..b9fa151 --- /dev/null +++ b/_data/buildx/docker_buildx_inspect.yaml @@ -0,0 +1,31 @@ +command: docker buildx inspect +short: Inspect current builder instance +long: Inspect current builder instance +usage: docker buildx inspect [NAME] +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: bootstrap + value_type: bool + default_value: "false" + description: Ensure builder has booted before inspecting + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_ls.yaml b/_data/buildx/docker_buildx_ls.yaml new file mode 100644 index 0000000..ae79deb --- /dev/null +++ b/_data/buildx/docker_buildx_ls.yaml @@ -0,0 +1,21 @@ +command: docker buildx ls +short: List builder instances +long: List builder instances +usage: docker buildx ls +pname: docker buildx +plink: docker_buildx.yaml +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_prune.yaml b/_data/buildx/docker_buildx_prune.yaml new file mode 100644 index 0000000..19aa5f2 --- /dev/null +++ b/_data/buildx/docker_buildx_prune.yaml @@ -0,0 +1,68 @@ +command: docker buildx prune +short: 'Remove build cache ' +long: 'Remove build cache ' +usage: docker buildx prune +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Remove all unused images, not just dangling ones + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + value_type: filter + description: Provide filter values (e.g. 'until=24h') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: keep-storage + value_type: bytes + default_value: "0" + description: Amount of disk space to keep for cache + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: verbose + value_type: bool + default_value: "false" + description: Provide a more verbose output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_rm.yaml b/_data/buildx/docker_buildx_rm.yaml new file mode 100644 index 0000000..e3fd65f --- /dev/null +++ b/_data/buildx/docker_buildx_rm.yaml @@ -0,0 +1,21 @@ +command: docker buildx rm +short: Remove a builder instance +long: Remove a builder instance +usage: docker buildx rm [NAME] +pname: docker buildx +plink: docker_buildx.yaml +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_stop.yaml b/_data/buildx/docker_buildx_stop.yaml new file mode 100644 index 0000000..6a495d5 --- /dev/null +++ b/_data/buildx/docker_buildx_stop.yaml @@ -0,0 +1,21 @@ +command: docker buildx stop +short: Stop builder instance +long: Stop builder instance +usage: docker buildx stop [NAME] +pname: docker buildx +plink: docker_buildx.yaml +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_use.yaml b/_data/buildx/docker_buildx_use.yaml new file mode 100644 index 0000000..cf93219 --- /dev/null +++ b/_data/buildx/docker_buildx_use.yaml @@ -0,0 +1,40 @@ +command: docker buildx use +short: Set the current builder instance +long: Set the current builder instance +usage: docker buildx use [OPTIONS] NAME +pname: docker buildx +plink: docker_buildx.yaml +options: +- option: default + value_type: bool + default_value: "false" + description: Set builder as default for current context + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: global + value_type: bool + default_value: "false" + description: Builder persists context changes + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/buildx/docker_buildx_version.yaml b/_data/buildx/docker_buildx_version.yaml new file mode 100644 index 0000000..e0a0550 --- /dev/null +++ b/_data/buildx/docker_buildx_version.yaml @@ -0,0 +1,21 @@ +command: docker buildx version +short: 'Show buildx version information ' +long: 'Show buildx version information ' +usage: docker buildx version +pname: docker buildx +plink: docker_buildx.yaml +inherited_options: +- option: builder + value_type: string + description: Override the configured builder instance + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster.yaml b/_data/cluster/docker_cluster.yaml new file mode 100644 index 0000000..6f28780 --- /dev/null +++ b/_data/cluster/docker_cluster.yaml @@ -0,0 +1,49 @@ +command: docker cluster +short: Docker Cluster +long: A tool to build and manage Docker Clusters. +pname: docker +plink: docker.yaml +cname: +- docker cluster backup +- docker cluster create +- docker cluster inspect +- docker cluster ls +- docker cluster restore +- docker cluster rm +- docker cluster update +- docker cluster version +clink: +- docker_cluster_backup.yaml +- docker_cluster_create.yaml +- docker_cluster_inspect.yaml +- docker_cluster_ls.yaml +- docker_cluster_restore.yaml +- docker_cluster_rm.yaml +- docker_cluster_update.yaml +- docker_cluster_version.yaml +options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_backup.yaml b/_data/cluster/docker_cluster_backup.yaml new file mode 100644 index 0000000..b7f6c55 --- /dev/null +++ b/_data/cluster/docker_cluster_backup.yaml @@ -0,0 +1,60 @@ +command: docker cluster backup +short: Backup a running cluster +long: Backup a running cluster +usage: docker cluster backup [OPTIONS] cluster +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: env + shorthand: e + value_type: stringSlice + default_value: '[]' + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + value_type: string + default_value: backup.tar.gz + description: Cluster backup filename + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: passphrase + value_type: string + description: Cluster backup passphrase + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_create.yaml b/_data/cluster/docker_cluster_create.yaml new file mode 100644 index 0000000..f6de1d9 --- /dev/null +++ b/_data/cluster/docker_cluster_create.yaml @@ -0,0 +1,81 @@ +command: docker cluster create +short: Create a new Docker Cluster +long: Create a new Docker Cluster +usage: docker cluster create [OPTIONS] +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: env + shorthand: e + value_type: stringSlice + default_value: '[]' + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: example + value_type: string + default_value: aws + description: Display an example cluster declaration + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + default_value: cluster.yml + description: Cluster declaration + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + shorthand: "n" + value_type: string + description: Name for the cluster + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: switch-context + shorthand: s + value_type: bool + default_value: "false" + description: Switch context after cluster create. + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_inspect.yaml b/_data/cluster/docker_cluster_inspect.yaml new file mode 100644 index 0000000..a0aa2f3 --- /dev/null +++ b/_data/cluster/docker_cluster_inspect.yaml @@ -0,0 +1,43 @@ +command: docker cluster inspect +short: Display detailed information about a cluster +long: Display detailed information about a cluster +usage: docker cluster inspect [OPTIONS] cluster +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Display complete info about cluster + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_ls.yaml b/_data/cluster/docker_cluster_ls.yaml new file mode 100644 index 0000000..7f54282 --- /dev/null +++ b/_data/cluster/docker_cluster_ls.yaml @@ -0,0 +1,43 @@ +command: docker cluster ls +short: List all available clusters +long: List all available clusters +usage: docker cluster ls [OPTIONS] +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_restore.yaml b/_data/cluster/docker_cluster_restore.yaml new file mode 100644 index 0000000..5f54e07 --- /dev/null +++ b/_data/cluster/docker_cluster_restore.yaml @@ -0,0 +1,60 @@ +command: docker cluster restore +short: Restore a cluster from a backup +long: Restore a cluster from a backup +usage: docker cluster restore [OPTIONS] cluster +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: env + shorthand: e + value_type: stringSlice + default_value: '[]' + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + value_type: string + default_value: backup.tar.gz + description: Cluster backup filename + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: passphrase + value_type: string + description: Cluster backup passphrase + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_rm.yaml b/_data/cluster/docker_cluster_rm.yaml new file mode 100644 index 0000000..1ff30f3 --- /dev/null +++ b/_data/cluster/docker_cluster_rm.yaml @@ -0,0 +1,53 @@ +command: docker cluster rm +short: Remove a cluster +long: Remove a cluster +usage: docker cluster rm [OPTIONS] cluster +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: env + shorthand: e + value_type: stringSlice + default_value: '[]' + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force removal of the cluster files + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_update.yaml b/_data/cluster/docker_cluster_update.yaml new file mode 100644 index 0000000..90e59fd --- /dev/null +++ b/_data/cluster/docker_cluster_update.yaml @@ -0,0 +1,52 @@ +command: docker cluster update +short: Update a running cluster's desired state +long: Update a running cluster's desired state +usage: docker cluster update [OPTIONS] cluster +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: env + shorthand: e + value_type: stringSlice + default_value: '[]' + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + description: Cluster definition + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/cluster/docker_cluster_version.yaml b/_data/cluster/docker_cluster_version.yaml new file mode 100644 index 0000000..facf61c --- /dev/null +++ b/_data/cluster/docker_cluster_version.yaml @@ -0,0 +1,42 @@ +command: docker cluster version +short: Print Version, Commit, and Build type +long: Print Version, Commit, and Build type +usage: docker cluster version +pname: docker cluster +plink: docker_cluster.yaml +options: +- option: json + value_type: bool + default_value: "false" + description: Formats output as JSON. Implies '--log-level error' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: dry-run + value_type: bool + default_value: "false" + description: Skip provisioning resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-level + value_type: string + default_value: warn + description: | + Set the logging level ("trace"|"debug"|"info"|"warn"|"error"|"fatal") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app.yaml b/_data/docker-app/docker_app.yaml new file mode 100644 index 0000000..4028325 --- /dev/null +++ b/_data/docker-app/docker_app.yaml @@ -0,0 +1,45 @@ +command: docker app +short: Docker Application +long: A tool to build and manage Docker Applications. +pname: docker +plink: docker.yaml +cname: +- docker app bundle +- docker app completion +- docker app init +- docker app inspect +- docker app install +- docker app list +- docker app merge +- docker app pull +- docker app push +- docker app render +- docker app split +- docker app status +- docker app uninstall +- docker app upgrade +- docker app validate +- docker app version +clink: +- docker_app_bundle.yaml +- docker_app_completion.yaml +- docker_app_init.yaml +- docker_app_inspect.yaml +- docker_app_install.yaml +- docker_app_list.yaml +- docker_app_merge.yaml +- docker_app_pull.yaml +- docker_app_push.yaml +- docker_app_render.yaml +- docker_app_split.yaml +- docker_app_status.yaml +- docker_app_uninstall.yaml +- docker_app_upgrade.yaml +- docker_app_validate.yaml +- docker_app_version.yaml +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_bundle.yaml b/_data/docker-app/docker_app_bundle.yaml new file mode 100644 index 0000000..79bf360 --- /dev/null +++ b/_data/docker-app/docker_app_bundle.yaml @@ -0,0 +1,24 @@ +command: docker app bundle +short: Create a CNAB invocation image and `bundle.json` for the application +long: Create a CNAB invocation image and `bundle.json` for the application +usage: docker app bundle [APP_NAME] [--output OUTPUT_FILE] +pname: docker app +plink: docker_app.yaml +options: +- option: output + shorthand: o + value_type: string + default_value: bundle.json + description: Output file (- for stdout) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app bundle myapp.dockerapp +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_completion.yaml b/_data/docker-app/docker_app_completion.yaml new file mode 100644 index 0000000..bc7b809 --- /dev/null +++ b/_data/docker-app/docker_app_completion.yaml @@ -0,0 +1,24 @@ +command: docker app completion +short: Generates completion scripts for the specified shell (bash or zsh) +long: | + # Load the "docker app" completion code for bash into the current shell + . <(docker app completion bash) + # Set the "docker app" completion code for bash to autoload on startup in your ~/.bashrc, + # ~/.profile or ~/.bash_profile + . <(docker app completion bash) + # Note: bash-completion is needed. + + # Load the "docker app" completion code for zsh into the current shell + source <(docker app completion zsh) + # Set the "docker app" completion code for zsh to autoload on startup in your ~/.zshrc, + source <(docker app completion zsh) +usage: docker app completion SHELL +pname: docker app +plink: docker_app.yaml +examples: $ . <(docker app completion bash) +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_init.yaml b/_data/docker-app/docker_app_init.yaml new file mode 100644 index 0000000..4f8334e --- /dev/null +++ b/_data/docker-app/docker_app_init.yaml @@ -0,0 +1,51 @@ +command: docker app init +short: Initialize Docker Application definition +long: Start building a Docker Application package. If there is a docker-compose.yml + file in the current directory it will be copied and used. +usage: docker app init APP_NAME [--compose-file COMPOSE_FILE] [--description DESCRIPTION] + [--maintainer NAME:EMAIL ...] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: compose-file + value_type: string + description: Compose file to use as application base (optional) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: description + value_type: string + description: Human readable description of your application (optional) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: maintainer + value_type: stringArray + default_value: '[]' + description: | + Name and email address of person responsible for the application (name:email) (optional) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: single-file + value_type: bool + default_value: "false" + description: Create a single-file Docker Application definition + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app init myapp --description "a useful description" +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_inspect.yaml b/_data/docker-app/docker_app_inspect.yaml new file mode 100644 index 0000000..a64bac9 --- /dev/null +++ b/_data/docker-app/docker_app_inspect.yaml @@ -0,0 +1,52 @@ +command: docker app inspect +short: Shows metadata, parameters and a summary of the Compose file for a given application +long: Shows metadata, parameters and a summary of the Compose file for a given application +usage: docker app inspect [APP_NAME] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: parameters-file + value_type: stringArray + default_value: '[]' + description: Override parameters file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Pull the bundle + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + shorthand: s + value_type: stringArray + default_value: '[]' + description: Override parameter value + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app inspect myapp.dockerapp +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_install.yaml b/_data/docker-app/docker_app_install.yaml new file mode 100644 index 0000000..216cf6e --- /dev/null +++ b/_data/docker-app/docker_app_install.yaml @@ -0,0 +1,115 @@ +command: docker app install +aliases: deploy +short: Install an application +long: |- + Install an application. + By default, the application definition in the current directory will be + installed. The APP_NAME can also be: + - a path to a Docker Application definition (.dockerapp) or a CNAB bundle.json + - a registry Application Package reference +usage: docker app install [APP_NAME] [--name INSTALLATION_NAME] [--target-context + TARGET_CONTEXT] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: credential-set + value_type: stringArray + default_value: '[]' + description: | + Use a YAML file containing a credential set or a credential set present in the credential store + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kubernetes-namespace + value_type: string + default_value: default + description: Kubernetes namespace to install into + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Installation name (defaults to application name) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to install on (swarm, kubernetes) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: parameters-file + value_type: stringArray + default_value: '[]' + description: Override parameters file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Pull the bundle + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + shorthand: s + value_type: stringArray + default_value: '[]' + description: Override parameter value + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target-context + value_type: string + description: | + Context on which the application is installed (default: ) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Sends registry auth + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + $ docker app install myapp.dockerapp --name myinstallation --target-context=mycontext + $ docker app install myrepo/myapp:mytag --name myinstallation --target-context=mycontext + $ docker app install bundle.json --name myinstallation --credential-set=mycredentials.yml +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_list.yaml b/_data/docker-app/docker_app_list.yaml new file mode 100644 index 0000000..8adc3a5 --- /dev/null +++ b/_data/docker-app/docker_app_list.yaml @@ -0,0 +1,22 @@ +command: docker app list +aliases: ls +short: List the installations and their last known installation result +long: List the installations and their last known installation result +usage: docker app list [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: target-context + value_type: string + description: List installations on this context + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_merge.yaml b/_data/docker-app/docker_app_merge.yaml new file mode 100644 index 0000000..3d80384 --- /dev/null +++ b/_data/docker-app/docker_app_merge.yaml @@ -0,0 +1,23 @@ +command: docker app merge +short: Merge a directory format Docker Application definition into a single file +long: Merge a directory format Docker Application definition into a single file +usage: docker app merge [APP_NAME] [--output OUTPUT_FILE] +pname: docker app +plink: docker_app.yaml +options: +- option: output + shorthand: o + value_type: string + description: 'Output file (default: in-place)' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app merge myapp.dockerapp --output myapp-single.dockerapp +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_pull.yaml b/_data/docker-app/docker_app_pull.yaml new file mode 100644 index 0000000..c76d681 --- /dev/null +++ b/_data/docker-app/docker_app_pull.yaml @@ -0,0 +1,24 @@ +command: docker app pull +short: Pull an application package from a registry +long: Pull an application package from a registry +usage: docker app pull NAME:TAG [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app pull docker/app-example:0.1.0 +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_push.yaml b/_data/docker-app/docker_app_push.yaml new file mode 100644 index 0000000..a8973a3 --- /dev/null +++ b/_data/docker-app/docker_app_push.yaml @@ -0,0 +1,44 @@ +command: docker app push +short: Push an application package to a registry +long: Push an application package to a registry +usage: docker app push [APP_NAME] --tag TARGET_REFERENCE [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: stringSlice + default_value: '[]' + description: | + For multi-arch service images, only push the specified platforms + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: string + description: | + Target registry reference (default: : from metadata) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app push myapp --tag myrepo/myapp:mytag +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_render.yaml b/_data/docker-app/docker_app_render.yaml new file mode 100644 index 0000000..2d1996d --- /dev/null +++ b/_data/docker-app/docker_app_render.yaml @@ -0,0 +1,72 @@ +command: docker app render +short: Render the Compose file for an Application Package +long: Render the Compose file for an Application Package +usage: docker app render [APP_NAME] [--set KEY=VALUE ...] [--parameters-file PARAMETERS-FILE + ...] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: formatter + value_type: string + default_value: yaml + description: Configure the output format (yaml|json) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: output + shorthand: o + value_type: string + default_value: '-' + description: Output file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: parameters-file + value_type: stringArray + default_value: '[]' + description: Override parameters file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Pull the bundle + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + shorthand: s + value_type: stringArray + default_value: '[]' + description: Override parameter value + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app render myapp.dockerapp --set key=value +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_split.yaml b/_data/docker-app/docker_app_split.yaml new file mode 100644 index 0000000..822eef2 --- /dev/null +++ b/_data/docker-app/docker_app_split.yaml @@ -0,0 +1,23 @@ +command: docker app split +short: Split a single-file Docker Application definition into the directory format +long: Split a single-file Docker Application definition into the directory format +usage: docker app split [APP_NAME] [--output OUTPUT_DIRECTORY] +pname: docker app +plink: docker_app.yaml +options: +- option: output + shorthand: o + value_type: string + description: 'Output directory (default: in-place)' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app split myapp.dockerapp --output myapp-directory.dockerapp +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_status.yaml b/_data/docker-app/docker_app_status.yaml new file mode 100644 index 0000000..1d2ced6 --- /dev/null +++ b/_data/docker-app/docker_app_status.yaml @@ -0,0 +1,43 @@ +command: docker app status +short: Get the installation status of an application +long: Get the installation status of an application. If the installation is a Docker + Application, the status shows the stack services. +usage: docker app status INSTALLATION_NAME [--target-context TARGET_CONTEXT] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: credential-set + value_type: stringArray + default_value: '[]' + description: | + Use a YAML file containing a credential set or a credential set present in the credential store + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target-context + value_type: string + description: | + Context on which the application is installed (default: ) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Sends registry auth + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app status myinstallation --target-context=mycontext +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_uninstall.yaml b/_data/docker-app/docker_app_uninstall.yaml new file mode 100644 index 0000000..0917ef2 --- /dev/null +++ b/_data/docker-app/docker_app_uninstall.yaml @@ -0,0 +1,51 @@ +command: docker app uninstall +short: Uninstall an application +long: Uninstall an application +usage: docker app uninstall INSTALLATION_NAME [--target-context TARGET_CONTEXT] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: credential-set + value_type: stringArray + default_value: '[]' + description: | + Use a YAML file containing a credential set or a credential set present in the credential store + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + value_type: bool + default_value: "false" + description: Force removal of installation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target-context + value_type: string + description: | + Context on which the application is installed (default: ) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Sends registry auth + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app uninstall myinstallation --target-context=mycontext +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_upgrade.yaml b/_data/docker-app/docker_app_upgrade.yaml new file mode 100644 index 0000000..67bb6c3 --- /dev/null +++ b/_data/docker-app/docker_app_upgrade.yaml @@ -0,0 +1,88 @@ +command: docker app upgrade +short: Upgrade an installed application +long: Upgrade an installed application +usage: docker app upgrade INSTALLATION_NAME [--target-context TARGET_CONTEXT] [OPTIONS] +pname: docker app +plink: docker_app.yaml +options: +- option: app-name + value_type: string + description: Override the installation with another Application Package + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: credential-set + value_type: stringArray + default_value: '[]' + description: | + Use a YAML file containing a credential set or a credential set present in the credential store + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: insecure-registries + value_type: stringSlice + default_value: '[]' + description: | + Use HTTP instead of HTTPS when pulling from/pushing to those registries + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: parameters-file + value_type: stringArray + default_value: '[]' + description: Override parameters file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Pull the bundle + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + shorthand: s + value_type: stringArray + default_value: '[]' + description: Override parameter value + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target-context + value_type: string + description: | + Context on which the application is installed (default: ) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Sends registry auth + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: $ docker app upgrade myinstallation --target-context=mycontext --set key=value +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_validate.yaml b/_data/docker-app/docker_app_validate.yaml new file mode 100644 index 0000000..63200af --- /dev/null +++ b/_data/docker-app/docker_app_validate.yaml @@ -0,0 +1,32 @@ +command: docker app validate +short: Checks the rendered application is syntactically correct +long: Checks the rendered application is syntactically correct +usage: docker app validate [APP_NAME] [--set KEY=VALUE ...] [--parameters-file PARAMETERS_FILE] +pname: docker app +plink: docker_app.yaml +options: +- option: parameters-file + value_type: stringArray + default_value: '[]' + description: Override parameters file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: set + shorthand: s + value_type: stringArray + default_value: '[]' + description: Override parameter value + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docker-app/docker_app_version.yaml b/_data/docker-app/docker_app_version.yaml new file mode 100644 index 0000000..2552c10 --- /dev/null +++ b/_data/docker-app/docker_app_version.yaml @@ -0,0 +1,12 @@ +command: docker app version +short: Print version information +long: Print version information +usage: docker app version +pname: docker app +plink: docker_app.yaml +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/docsarchive/archives.yaml b/_data/docsarchive/archives.yaml new file mode 100644 index 0000000..aad2923 --- /dev/null +++ b/_data/docsarchive/archives.yaml @@ -0,0 +1,15 @@ +- archive: + name: v19.03 + image: docs/docker.github.io:latest + current: true +# When you make a new stable archive version, create a new entry below with the +# appropriate docker image. The current release should always be latest. +- archive: + name: v18.09 + image: docs/docker.github.io:v18.09 +- archive: + name: v18.03 + image: docs/docker.github.io:v18.03 +- archive: + name: v17.06 + image: docs/docker.github.io:v17.06 diff --git a/_data/engine-cli/docker.yaml b/_data/engine-cli/docker.yaml new file mode 100644 index 0000000..dbd4b6b --- /dev/null +++ b/_data/engine-cli/docker.yaml @@ -0,0 +1,125 @@ +command: docker +short: The base command for the Docker CLI. +long: The base command for the Docker CLI. +cname: +- docker attach +- docker build +- docker builder +- docker checkpoint +- docker commit +- docker config +- docker container +- docker context +- docker cp +- docker create +- docker diff +- docker events +- docker exec +- docker export +- docker history +- docker image +- docker images +- docker import +- docker info +- docker inspect +- docker kill +- docker load +- docker login +- docker logout +- docker logs +- docker manifest +- docker network +- docker node +- docker pause +- docker plugin +- docker port +- docker ps +- docker pull +- docker push +- docker rename +- docker restart +- docker rm +- docker rmi +- docker run +- docker save +- docker search +- docker secret +- docker service +- docker stack +- docker start +- docker stats +- docker stop +- docker swarm +- docker system +- docker tag +- docker top +- docker trust +- docker unpause +- docker update +- docker version +- docker volume +- docker wait +clink: +- docker_attach.yaml +- docker_build.yaml +- docker_builder.yaml +- docker_checkpoint.yaml +- docker_commit.yaml +- docker_config.yaml +- docker_container.yaml +- docker_context.yaml +- docker_cp.yaml +- docker_create.yaml +- docker_diff.yaml +- docker_events.yaml +- docker_exec.yaml +- docker_export.yaml +- docker_history.yaml +- docker_image.yaml +- docker_images.yaml +- docker_import.yaml +- docker_info.yaml +- docker_inspect.yaml +- docker_kill.yaml +- docker_load.yaml +- docker_login.yaml +- docker_logout.yaml +- docker_logs.yaml +- docker_manifest.yaml +- docker_network.yaml +- docker_node.yaml +- docker_pause.yaml +- docker_plugin.yaml +- docker_port.yaml +- docker_ps.yaml +- docker_pull.yaml +- docker_push.yaml +- docker_rename.yaml +- docker_restart.yaml +- docker_rm.yaml +- docker_rmi.yaml +- docker_run.yaml +- docker_save.yaml +- docker_search.yaml +- docker_secret.yaml +- docker_service.yaml +- docker_stack.yaml +- docker_start.yaml +- docker_stats.yaml +- docker_stop.yaml +- docker_swarm.yaml +- docker_system.yaml +- docker_tag.yaml +- docker_top.yaml +- docker_trust.yaml +- docker_unpause.yaml +- docker_update.yaml +- docker_version.yaml +- docker_volume.yaml +- docker_wait.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_attach.yaml b/_data/engine-cli/docker_attach.yaml new file mode 100644 index 0000000..6334682 --- /dev/null +++ b/_data/engine-cli/docker_attach.yaml @@ -0,0 +1,166 @@ +command: docker attach +short: Attach local standard input, output, and error streams to a running container +long: |- + Use `docker attach` to attach your terminal's standard input, output, and error + (or any combination of the three) to a running container using the container's + ID or name. This allows you to view its ongoing output or to control it + interactively, as though the commands were running directly in your terminal. + + > **Note:** + > The `attach` command will display the output of the `ENTRYPOINT/CMD` process. This + > can appear as if the attach command is hung when in fact the process may simply + > not be interacting with the terminal at that time. + + You can attach to the same contained process multiple times simultaneously, + from different sessions on the Docker host. + + To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the + container. If `--sig-proxy` is true (the default),`CTRL-c` sends a `SIGINT` to + the container. If the container was run with `-i` and `-t`, you can detach from + a container and leave it running using the `CTRL-p CTRL-q` key sequence. + + > **Note:** + > A process running as PID 1 inside a container is treated specially by + > Linux: it ignores any signal with the default action. So, the process + > will not terminate on `SIGINT` or `SIGTERM` unless it is coded to do + > so. + + It is forbidden to redirect the standard input of a `docker attach` command + while attaching to a tty-enabled container (i.e.: launched with `-t`). + + While a client is connected to container's stdio using `docker attach`, Docker + uses a ~1MB memory buffer to maximize the throughput of the application. If + this buffer is filled, the speed of the API connection will start to have an + effect on the process output writing speed. This is similar to other + applications like SSH. Because of this, it is not recommended to run + performance critical applications that generate a lot of output in the + foreground over a slow client connection. Instead, users should use the + `docker logs` command to get access to the logs. + + ### Override the detach sequence + + If you want, you can configure an override the Docker key sequence for detach. + This is useful if the Docker default sequence conflicts with key sequence you + use for other applications. There are two ways to define your own detach key + sequence, as a per-container override or as a configuration property on your + entire configuration. + + To override the sequence for an individual container, use the + `--detach-keys=""` flag with the `docker attach` command. The format of + the `` is either a letter [a-Z], or the `ctrl-` combined with any of + the following: + + * `a-z` (a single lowercase alpha character ) + * `@` (at sign) + * `[` (left bracket) + * `\\` (two backward slashes) + * `_` (underscore) + * `^` (caret) + + These `a`, `ctrl-a`, `X`, or `ctrl-\\` values are all examples of valid key + sequences. To configure a different configuration default key sequence for all + containers, see [**Configuration file** section](cli.md#configuration-files). +usage: docker attach [OPTIONS] CONTAINER +pname: docker +plink: docker.yaml +options: +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-stdin + value_type: bool + default_value: "false" + description: Do not attach STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sig-proxy + value_type: bool + default_value: "true" + description: Proxy all received signals to the process + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Attach to and detach from a running container + + ```bash + $ docker run -d --name topdemo ubuntu /usr/bin/top -b + + $ docker attach topdemo + + top - 02:05:52 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 + Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie + Cpu(s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st + Mem: 373572k total, 355560k used, 18012k free, 27872k buffers + Swap: 786428k total, 0k used, 786428k free, 221740k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 17200 1116 912 R 0 0.3 0:00.03 top + + top - 02:05:55 up 3:05, 0 users, load average: 0.01, 0.02, 0.05 + Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie + Cpu(s): 0.0%us, 0.2%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st + Mem: 373572k total, 355244k used, 18328k free, 27872k buffers + Swap: 786428k total, 0k used, 786428k free, 221776k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top + + + top - 02:05:58 up 3:06, 0 users, load average: 0.01, 0.02, 0.05 + Tasks: 1 total, 1 running, 0 sleeping, 0 stopped, 0 zombie + Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st + Mem: 373572k total, 355780k used, 17792k free, 27880k buffers + Swap: 786428k total, 0k used, 786428k free, 221776k cached + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top + ^C$ + + $ echo $? + 0 + $ docker ps -a | grep topdemo + + 7998ac8581f9 ubuntu:14.04 "/usr/bin/top -b" 38 seconds ago Exited (0) 21 seconds ago topdemo + ``` + + ### Get the exit code of the container's command + + And in this second example, you can see the exit code returned by the `bash` + process is returned by the `docker attach` command to its caller too: + + ```bash + $ docker run --name test -d -it debian + + 275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab + + $ docker attach test + + root@f38c87f2a42d:/# exit 13 + + exit + + $ echo $? + + 13 + + $ docker ps -a | grep test + + 275c44472aeb debian:7 "/bin/bash" 26 seconds ago Exited (13) 17 seconds ago test + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_build.yaml b/_data/engine-cli/docker_build.yaml new file mode 100644 index 0000000..f853b8f --- /dev/null +++ b/_data/engine-cli/docker_build.yaml @@ -0,0 +1,1022 @@ +command: docker build +short: Build an image from a Dockerfile +long: |- + The `docker build` command builds Docker images from a Dockerfile and a + "context". A build's context is the set of files located in the specified + `PATH` or `URL`. The build process can refer to any of the files in the + context. For example, your build can use a [*COPY*](../builder.md#copy) + instruction to reference a file in the context. + + The `URL` parameter can refer to three kinds of resources: Git repositories, + pre-packaged tarball contexts and plain text files. + + ### Git repositories + + When the `URL` parameter points to the location of a Git repository, the + repository acts as the build context. The system recursively fetches the + repository and its submodules. The commit history is not preserved. A + repository is first pulled into a temporary directory on your local host. After + that succeeds, the directory is sent to the Docker daemon as the context. + Local copy gives you the ability to access private repositories using local + user credentials, VPN's, and so forth. + + > **Note** + > + > If the `URL` parameter contains a fragment the system will recursively clone + > the repository and its submodules using a `git clone --recursive` command. + + Git URLs accept context configuration in their fragment section, separated by a + colon (`:`). The first part represents the reference that Git will check out, + and can be either a branch, a tag, or a remote reference. The second part + represents a subdirectory inside the repository that will be used as a build + context. + + For example, run this command to use a directory called `docker` in the branch + `container`: + + ```bash + $ docker build https://github.com/docker/rootfs.git#container:docker + ``` + + The following table represents all the valid suffixes with their build + contexts: + + Build Syntax Suffix | Commit Used | Build Context Used + --------------------------------|-----------------------|------------------- + `myrepo.git` | `refs/heads/master` | `/` + `myrepo.git#mytag` | `refs/tags/mytag` | `/` + `myrepo.git#mybranch` | `refs/heads/mybranch` | `/` + `myrepo.git#pull/42/head` | `refs/pull/42/head` | `/` + `myrepo.git#:myfolder` | `refs/heads/master` | `/myfolder` + `myrepo.git#master:myfolder` | `refs/heads/master` | `/myfolder` + `myrepo.git#mytag:myfolder` | `refs/tags/mytag` | `/myfolder` + `myrepo.git#mybranch:myfolder` | `refs/heads/mybranch` | `/myfolder` + + > **Note** + > + > You cannot specify the build-context directory (`myfolder` in the examples above) + > when using BuildKit as builder (`DOCKER_BUILDKIT=1`). Support for this feature + > is tracked in [buildkit#1684](https://github.com/moby/buildkit/issues/1684). + + ### Tarball contexts + + If you pass an URL to a remote tarball, the URL itself is sent to the daemon: + + ```bash + $ docker build http://server/context.tar.gz + ``` + + The download operation will be performed on the host the Docker daemon is + running on, which is not necessarily the same host from which the build command + is being issued. The Docker daemon will fetch `context.tar.gz` and use it as the + build context. Tarball contexts must be tar archives conforming to the standard + `tar` UNIX format and can be compressed with any one of the 'xz', 'bzip2', + 'gzip' or 'identity' (no compression) formats. + + ### Text files + + Instead of specifying a context, you can pass a single `Dockerfile` in the + `URL` or pipe the file in via `STDIN`. To pipe a `Dockerfile` from `STDIN`: + + ```bash + $ docker build - < Dockerfile + ``` + + With Powershell on Windows, you can run: + + ```powershell + Get-Content Dockerfile | docker build - + ``` + + If you use `STDIN` or specify a `URL` pointing to a plain text file, the system + places the contents into a file called `Dockerfile`, and any `-f`, `--file` + option is ignored. In this scenario, there is no context. + + By default the `docker build` command will look for a `Dockerfile` at the root + of the build context. The `-f`, `--file`, option lets you specify the path to + an alternative file to use instead. This is useful in cases where the same set + of files are used for multiple builds. The path must be to a file within the + build context. If a relative path is specified then it is interpreted as + relative to the root of the context. + + In most cases, it's best to put each Dockerfile in an empty directory. Then, + add to that directory only the files needed for building the Dockerfile. To + increase the build's performance, you can exclude files and directories by + adding a `.dockerignore` file to that directory as well. For information on + creating one, see the [.dockerignore file](../builder.md#dockerignore-file). + + If the Docker client loses connection to the daemon, the build is canceled. + This happens if you interrupt the Docker client with `CTRL-c` or if the Docker + client is killed for any reason. If the build initiated a pull which is still + running at the time the build is cancelled, the pull is cancelled as well. +usage: docker build [OPTIONS] PATH | URL | - +pname: docker +plink: docker.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: build-arg + value_type: list + description: Set build-time variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cache-from + value_type: stringSlice + default_value: '[]' + description: Images to consider as cache sources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: compress + value_type: bool + default_value: "false" + description: Compress the build context using gzip + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + description: Name of the Dockerfile (Default is 'PATH/Dockerfile') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force-rm + value_type: bool + default_value: "false" + description: Always remove intermediate containers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: iidfile + value_type: string + description: Write the image ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: list + description: Set metadata for an image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: string + default_value: default + description: | + Set the networking mode for the RUN instructions during build + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-cache + value_type: bool + default_value: "false" + description: Do not use cache when building the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: output + shorthand: o + value_type: stringArray + default_value: '[]' + description: 'Output destination (format: type=local,dest=path)' + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.38" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: progress + value_type: string + default_value: auto + description: | + Set type of progress output (auto, plain, tty). Use plain to show container output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Always attempt to pull a newer version of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the build output and print image ID on success + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "true" + description: Remove intermediate containers after a successful build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret + value_type: stringArray + default_value: '[]' + description: | + Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: stringSlice + default_value: '[]' + description: Security options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: squash + value_type: bool + default_value: "false" + description: Squash newly built layers into a single new layer + deprecated: false + min_api_version: "1.25" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: ssh + value_type: stringArray + default_value: '[]' + description: | + SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|[=|[,]]) + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stream + value_type: bool + default_value: "false" + description: Stream attaches to server to negotiate build context + deprecated: false + min_api_version: "1.31" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: list + description: Name and optionally a tag in the 'name:tag' format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target + value_type: string + description: Set the target build stage to build. + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Build with PATH + + ```bash + $ docker build . + + Uploading context 10240 bytes + Step 1/3 : FROM busybox + Pulling repository busybox + ---> e9aa60c60128MB/2.284 MB (100%) endpoint: https://cdn-registry-1.docker.io/v1/ + Step 2/3 : RUN ls -lh / + ---> Running in 9c9e81692ae9 + total 24 + drwxr-xr-x 2 root root 4.0K Mar 12 2013 bin + drwxr-xr-x 5 root root 4.0K Oct 19 00:19 dev + drwxr-xr-x 2 root root 4.0K Oct 19 00:19 etc + drwxr-xr-x 2 root root 4.0K Nov 15 23:34 lib + lrwxrwxrwx 1 root root 3 Mar 12 2013 lib64 -> lib + dr-xr-xr-x 116 root root 0 Nov 15 23:34 proc + lrwxrwxrwx 1 root root 3 Mar 12 2013 sbin -> bin + dr-xr-xr-x 13 root root 0 Nov 15 23:34 sys + drwxr-xr-x 2 root root 4.0K Mar 12 2013 tmp + drwxr-xr-x 2 root root 4.0K Nov 15 23:34 usr + ---> b35f4035db3f + Step 3/3 : CMD echo Hello world + ---> Running in 02071fceb21b + ---> f52f38b7823e + Successfully built f52f38b7823e + Removing intermediate container 9c9e81692ae9 + Removing intermediate container 02071fceb21b + ``` + + This example specifies that the `PATH` is `.`, and so all the files in the + local directory get `tar`d and sent to the Docker daemon. The `PATH` specifies + where to find the files for the "context" of the build on the Docker daemon. + Remember that the daemon could be running on a remote machine and that no + parsing of the Dockerfile happens at the client side (where you're running + `docker build`). That means that *all* the files at `PATH` get sent, not just + the ones listed to [*ADD*](../builder.md#add) in the Dockerfile. + + The transfer of context from the local machine to the Docker daemon is what the + `docker` client means when you see the "Sending build context" message. + + If you wish to keep the intermediate containers after the build is complete, + you must use `--rm=false`. This does not affect the build cache. + + ### Build with URL + + ```bash + $ docker build github.com/creack/docker-firefox + ``` + + This will clone the GitHub repository and use the cloned repository as context. + The Dockerfile at the root of the repository is used as Dockerfile. You can + specify an arbitrary Git repository by using the `git://` or `git@` scheme. + + ```bash + $ docker build -f ctx/Dockerfile http://server/ctx.tar.gz + + Downloading context: http://server/ctx.tar.gz [===================>] 240 B/240 B + Step 1/3 : FROM busybox + ---> 8c2e06607696 + Step 2/3 : ADD ctx/container.cfg / + ---> e7829950cee3 + Removing intermediate container b35224abf821 + Step 3/3 : CMD /bin/ls + ---> Running in fbc63d321d73 + ---> 3286931702ad + Removing intermediate container fbc63d321d73 + Successfully built 377c409b35e4 + ``` + + This sends the URL `http://server/ctx.tar.gz` to the Docker daemon, which + downloads and extracts the referenced tarball. The `-f ctx/Dockerfile` + parameter specifies a path inside `ctx.tar.gz` to the `Dockerfile` that is used + to build the image. Any `ADD` commands in that `Dockerfile` that refers to local + paths must be relative to the root of the contents inside `ctx.tar.gz`. In the + example above, the tarball contains a directory `ctx/`, so the `ADD + ctx/container.cfg /` operation works as expected. + + ### Build with - + + ```bash + $ docker build - < Dockerfile + ``` + + This will read a Dockerfile from `STDIN` without context. Due to the lack of a + context, no contents of any local directory will be sent to the Docker daemon. + Since there is no context, a Dockerfile `ADD` only works if it refers to a + remote URL. + + ```bash + $ docker build - < context.tar.gz + ``` + + This will build an image for a compressed context read from `STDIN`. Supported + formats are: bzip2, gzip and xz. + + ### Use a .dockerignore file + + ```bash + $ docker build . + + Uploading context 18.829 MB + Uploading context + Step 1/2 : FROM busybox + ---> 769b9341d937 + Step 2/2 : CMD echo Hello world + ---> Using cache + ---> 99cc1ad10469 + Successfully built 99cc1ad10469 + $ echo ".git" > .dockerignore + $ docker build . + Uploading context 6.76 MB + Uploading context + Step 1/2 : FROM busybox + ---> 769b9341d937 + Step 2/2 : CMD echo Hello world + ---> Using cache + ---> 99cc1ad10469 + Successfully built 99cc1ad10469 + ``` + + This example shows the use of the `.dockerignore` file to exclude the `.git` + directory from the context. Its effect can be seen in the changed size of the + uploaded context. The builder reference contains detailed information on + [creating a .dockerignore file](../builder.md#dockerignore-file). + + When using the [BuildKit backend](../builder.md#buildkit), `docker build` searches + for a `.dockerignore` file relative to the Dockerfile name. For example, running + `docker build -f myapp.Dockerfile .` will first look for an ignore file named + `myapp.Dockerfile.dockerignore`. If such a file is not found, the `.dockerignore` + file is used if present. Using a Dockerfile based `.dockerignore` is useful if a + project contains multiple Dockerfiles that expect to ignore different sets of + files. + + + ### Tag an image (-t) + + ```bash + $ docker build -t vieux/apache:2.0 . + ``` + + This will build like the previous example, but it will then tag the resulting + image. The repository name will be `vieux/apache` and the tag will be `2.0`. + [Read more about valid tags](tag.md). + + You can apply multiple tags to an image. For example, you can apply the `latest` + tag to a newly built image and add another tag that references a specific + version. + For example, to tag an image both as `whenry/fedora-jboss:latest` and + `whenry/fedora-jboss:v2.1`, use the following: + + ```bash + $ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 . + ``` + + ### Specify a Dockerfile (-f) + + ```bash + $ docker build -f Dockerfile.debug . + ``` + + This will use a file called `Dockerfile.debug` for the build instructions + instead of `Dockerfile`. + + ```bash + $ curl example.com/remote/Dockerfile | docker build -f - . + ``` + + The above command will use the current directory as the build context and read + a Dockerfile from stdin. + + ```bash + $ docker build -f dockerfiles/Dockerfile.debug -t myapp_debug . + $ docker build -f dockerfiles/Dockerfile.prod -t myapp_prod . + ``` + + The above commands will build the current build context (as specified by the + `.`) twice, once using a debug version of a `Dockerfile` and once using a + production version. + + ```bash + $ cd /home/me/myapp/some/dir/really/deep + $ docker build -f /home/me/myapp/dockerfiles/debug /home/me/myapp + $ docker build -f ../../../../dockerfiles/debug /home/me/myapp + ``` + + These two `docker build` commands do the exact same thing. They both use the + contents of the `debug` file instead of looking for a `Dockerfile` and will use + `/home/me/myapp` as the root of the build context. Note that `debug` is in the + directory structure of the build context, regardless of how you refer to it on + the command line. + + > **Note** + > + > `docker build` returns a `no such file or directory` error if the + > file or directory does not exist in the uploaded context. This may + > happen if there is no context, or if you specify a file that is + > elsewhere on the Host system. The context is limited to the current + > directory (and its children) for security reasons, and to ensure + > repeatable builds on remote Docker hosts. This is also the reason why + > `ADD ../file` does not work. + + ### Use a custom parent cgroup (--cgroup-parent) + + When `docker build` is run with the `--cgroup-parent` option the containers + used in the build will be run with the [corresponding `docker run` + flag](../run.md#specify-custom-cgroups). + + ### Set ulimits in container (--ulimit) + + Using the `--ulimit` option with `docker build` will cause each build step's + container to be started using those [`--ulimit` + flag values](run.md#set-ulimits-in-container---ulimit). + + ### Set build-time variables (--build-arg) + + You can use `ENV` instructions in a Dockerfile to define variable + values. These values persist in the built image. However, often + persistence is not what you want. Users want to specify variables differently + depending on which host they build an image on. + + A good example is `http_proxy` or source versions for pulling intermediate + files. The `ARG` instruction lets Dockerfile authors define values that users + can set at build-time using the `--build-arg` flag: + + ```bash + $ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PROXY=http://40.50.60.5:4567 . + ``` + + This flag allows you to pass the build-time variables that are + accessed like regular environment variables in the `RUN` instruction of the + Dockerfile. Also, these values don't persist in the intermediate or final images + like `ENV` values do. You must add `--build-arg` for each build argument. + + Using this flag will not alter the output you see when the `ARG` lines from the + Dockerfile are echoed during the build process. + + For detailed information on using `ARG` and `ENV` instructions, see the + [Dockerfile reference](../builder.md). + + You may also use the `--build-arg` flag without a value, in which case the value + from the local environment will be propagated into the Docker container being + built: + + ```bash + $ export HTTP_PROXY=http://10.20.30.2:1234 + $ docker build --build-arg HTTP_PROXY . + ``` + + This is similar to how `docker run -e` works. Refer to the [`docker run` documentation](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file) + for more information. + + ### Optional security options (--security-opt) + + This flag is only supported on a daemon running on Windows, and only supports + the `credentialspec` option. The `credentialspec` must be in the format + `file://spec.txt` or `registry://keyname`. + + ### Specify isolation technology for container (--isolation) + + This option is useful in situations where you are running Docker containers on + Windows. The `--isolation=` option sets a container's isolation + technology. On Linux, the only supported is the `default` option which uses + Linux namespaces. On Microsoft Windows, you can specify these values: + + + | Value | Description | + |-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value. | + | `process` | Namespace isolation only. | + | `hyperv` | Hyper-V hypervisor partition-based isolation. | + + Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. + + ### Add entries to container hosts file (--add-host) + + You can add other hosts into a container's `/etc/hosts` file by using one or + more `--add-host` flags. This example adds a static address for a host named + `docker`: + + $ docker build --add-host=docker:10.180.0.1 . + + ### Specifying target build stage (--target) + + When building a Dockerfile with multiple build stages, `--target` can be used to + specify an intermediate build stage by name as a final stage for the resulting + image. Commands after the target stage will be skipped. + + ```dockerfile + FROM debian AS build-env + ... + + FROM alpine AS production-env + ... + ``` + + ```bash + $ docker build -t mybuildimage --target build-env . + ``` + + ### Custom build outputs + + By default, a local container image is created from the build result. The + `--output` (or `-o`) flag allows you to override this behavior, and a specify a + custom exporter. For example, custom exporters allow you to export the build + artifacts as files on the local filesystem instead of a Docker image, which can + be useful for generating local binaries, code generation etc. + + The value for `--output` is a CSV-formatted string defining the exporter type + and options. Currently, `local` and `tar` exporters are supported. The `local` + exporter writes the resulting build files to a directory on the client side. The + `tar` exporter is similar but writes the files as a single tarball (`.tar`). + + If no type is specified, the value defaults to the output directory of the local + exporter. Use a hyphen (`-`) to write the output tarball to standard output + (`STDOUT`). + + The following example builds an image using the current directory (`.`) as build + context, and exports the files to a directory named `out` in the current directory. + If the directory does not exist, Docker creates the directory automatically: + + ```bash + $ docker build -o out . + ``` + + The example above uses the short-hand syntax, omitting the `type` options, and + thus uses the default (`local`) exporter. The example below shows the equivalent + using the long-hand CSV syntax, specifying both `type` and `dest` (destination + path): + + ```bash + $ docker build --output type=local,dest=out . + ``` + + Use the `tar` type to export the files as a `.tar` archive: + + ```bash + $ docker build --output type=tar,dest=out.tar . + ``` + + The example below shows the equivalent when using the short-hand syntax. In this + case, `-` is specified as destination, which automatically selects the `tar` type, + and writes the output tarball to standard output, which is then redirected to + the `out.tar` file: + + ```bash + docker build -o - . > out.tar + ``` + + The `--output` option exports all files from the target stage. A common pattern + for exporting only specific files is to do multi-stage builds and to copy the + desired files to a new scratch stage with [`COPY --from`](../builder.md#copy). + + The example `Dockerfile` below uses a separate stage to collect the + build-artifacts for exporting: + + ```dockerfile + FROM golang AS build-stage + RUN go get -u github.com/LK4D4/vndr + + FROM scratch AS export-stage + COPY --from=build-stage /go/bin/vndr / + ``` + + When building the Dockerfile with the `-o` option, only the files from the final + stage are exported to the `out` directory, in this case, the `vndr` binary: + + ```bash + $ docker build -o out . + + [+] Building 2.3s (7/7) FINISHED + => [internal] load build definition from Dockerfile 0.1s + => => transferring dockerfile: 176B 0.0s + => [internal] load .dockerignore 0.0s + => => transferring context: 2B 0.0s + => [internal] load metadata for docker.io/library/golang:latest 1.6s + => [build-stage 1/2] FROM docker.io/library/golang@sha256:2df96417dca0561bf1027742dcc5b446a18957cd28eba6aa79269f23f1846d3f 0.0s + => => resolve docker.io/library/golang@sha256:2df96417dca0561bf1027742dcc5b446a18957cd28eba6aa79269f23f1846d3f 0.0s + => CACHED [build-stage 2/2] RUN go get -u github.com/LK4D4/vndr 0.0s + => [export-stage 1/1] COPY --from=build-stage /go/bin/vndr / 0.2s + => exporting to client 0.4s + => => copying files 10.30MB 0.3s + + $ ls ./out + vndr + ``` + + > **Note** + > + > This feature requires the BuildKit backend. You can either + > [enable BuildKit](../builder.md#buildkit) or use the [buildx](https://github.com/docker/buildx) + > plugin which provides more output type options. + + ### Specifying external cache sources + + In addition to local build cache, the builder can reuse the cache generated from + previous builds with the `--cache-from` flag pointing to an image in the registry. + + To use an image as a cache source, cache metadata needs to be written into the + image on creation. This can be done by setting `--build-arg BUILDKIT_INLINE_CACHE=1` + when building the image. After that, the built image can be used as a cache source + for subsequent builds. + + Upon importing the cache, the builder will only pull the JSON metadata from the + registry and determine possible cache hits based on that information. If there + is a cache hit, the matched layers are pulled into the local environment. + + In addition to images, the cache can also be pulled from special cache manifests + generated by [`buildx`](https://github.com/docker/buildx) or the BuildKit CLI + (`buildctl`). These manifests (when built with the `type=registry` and `mode=max` + options) allow pulling layer data for intermediate stages in multi-stage builds. + + The following example builds an image with inline-cache metadata and pushes it + to a registry, then uses the image as a cache source on another machine: + + ```bash + $ docker build -t myname/myapp --build-arg BUILDKIT_INLINE_CACHE=1 . + $ docker push myname/myapp + ``` + + After pushing the image, the image is used as cache source on another machine. + BuildKit automatically pulls the image from the registry if needed. + + ```bash + # on another machine + $ docker build --cache-from myname/myapp . + ``` + + > **Note** + > + > This feature requires the BuildKit backend. You can either + > [enable BuildKit](../builder.md#buildkit) or use the [buildx](https://github.com/docker/buildx) + > plugin. The previous builder has limited support for reusing cache from + > pre-pulled images. + + ### Squash an image's layers (--squash) (experimental) + + #### Overview + + Once the image is built, squash the new layers into a new image with a single + new layer. Squashing does not destroy any existing image, rather it creates a new + image with the content of the squashed layers. This effectively makes it look + like all `Dockerfile` commands were created with a single layer. The build + cache is preserved with this method. + + The `--squash` option is an experimental feature, and should not be considered + stable. + + + Squashing layers can be beneficial if your Dockerfile produces multiple layers + modifying the same files, for example, files that are created in one step, and + removed in another step. For other use-cases, squashing images may actually have + a negative impact on performance; when pulling an image consisting of multiple + layers, layers can be pulled in parallel, and allows sharing layers between + images (saving space). + + For most use cases, multi-stage builds are a better alternative, as they give more + fine-grained control over your build, and can take advantage of future + optimizations in the builder. Refer to the [use multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/) + section in the userguide for more information. + + + #### Known limitations + + The `--squash` option has a number of known limitations: + + - When squashing layers, the resulting image cannot take advantage of layer + sharing with other images, and may use significantly more space. Sharing the + base image is still supported. + - When using this option you may see significantly more space used due to + storing two copies of the image, one for the build cache with all the cache + layers in tact, and one for the squashed version. + - While squashing layers may produce smaller images, it may have a negative + impact on performance, as a single layer takes longer to extract, and + downloading a single layer cannot be parallelized. + - When attempting to squash an image that does not make changes to the + filesystem (for example, the Dockerfile only contains `ENV` instructions), + the squash step will fail (see [issue #33823](https://github.com/moby/moby/issues/33823)). + + #### Prerequisites + + The example on this page is using experimental mode in Docker 19.03. + + Experimental mode can be enabled by using the `--experimental` flag when starting + the Docker daemon or setting `experimental: true` in the `daemon.json` configuration + file. + + By default, experimental mode is disabled. To see the current configuration of + the docker daemon, use the `docker version` command and check the `Experimental` + line in the `Engine` section: + + ```console + Client: Docker Engine - Community + Version: 19.03.8 + API version: 1.40 + Go version: go1.12.17 + Git commit: afacb8b + Built: Wed Mar 11 01:21:11 2020 + OS/Arch: darwin/amd64 + Experimental: false + + Server: Docker Engine - Community + Engine: + Version: 19.03.8 + API version: 1.40 (minimum version 1.12) + Go version: go1.12.17 + Git commit: afacb8b + Built: Wed Mar 11 01:29:16 2020 + OS/Arch: linux/amd64 + Experimental: true + [...] + ``` + + To enable experimental mode, users need to restart the docker daemon with the + experimental flag enabled. + + #### Enable Docker experimental + + Experimental features are now included in the standard Docker binaries as of + version 1.13.0. For enabling experimental features, you need to start the + Docker daemon with `--experimental` flag. You can also enable the daemon flag + via `/etc/docker/daemon.json`. e.g. + + ```json + { + "experimental": true + } + ``` + + Then make sure the experimental flag is enabled: + + ```bash + $ docker version -f '{{.Server.Experimental}}' + true + ``` + + #### Build an image with `--squash` argument + + The following is an example of docker build with `--squash` argument + + ```dockerfile + FROM busybox + RUN echo hello > /hello + RUN echo world >> /hello + RUN touch remove_me /remove_me + ENV HELLO=world + RUN rm /remove_me + ``` + + An image named `test` is built with `--squash` argument. + + ```bash + $ docker build --squash -t test . + + [...] + ``` + + If everything is right, the history looks like this: + + ```bash + $ docker history test + + IMAGE CREATED CREATED BY SIZE COMMENT + 4e10cb5b4cac 3 seconds ago 12 B merge sha256:88a7b0112a41826885df0e7072698006ee8f621c6ab99fca7fe9151d7b599702 to sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb + 5 minutes ago /bin/sh -c rm /remove_me 0 B + 5 minutes ago /bin/sh -c #(nop) ENV HELLO=world 0 B + 5 minutes ago /bin/sh -c touch remove_me /remove_me 0 B + 5 minutes ago /bin/sh -c echo world >> /hello 0 B + 6 minutes ago /bin/sh -c echo hello > /hello 0 B + 7 weeks ago /bin/sh -c #(nop) CMD ["sh"] 0 B + 7 weeks ago /bin/sh -c #(nop) ADD file:47ca6e777c36a4cfff 1.113 MB + ``` + + We could find that a layer's name is ``, and there is a new layer with + COMMENT `merge`. + + Test the image, check for `/remove_me` being gone, make sure `hello\nworld` is + in `/hello`, make sure the `HELLO` environment variable's value is `world`. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_builder.yaml b/_data/engine-cli/docker_builder.yaml new file mode 100644 index 0000000..c7178bf --- /dev/null +++ b/_data/engine-cli/docker_builder.yaml @@ -0,0 +1,19 @@ +command: docker builder +short: Manage builds +long: Manage builds +usage: docker builder +pname: docker +plink: docker.yaml +cname: +- docker builder build +- docker builder prune +clink: +- docker_builder_build.yaml +- docker_builder_prune.yaml +deprecated: false +min_api_version: "1.31" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_builder_build.yaml b/_data/engine-cli/docker_builder_build.yaml new file mode 100644 index 0000000..c200518 --- /dev/null +++ b/_data/engine-cli/docker_builder_build.yaml @@ -0,0 +1,335 @@ +command: docker builder build +short: Build an image from a Dockerfile +long: Build an image from a Dockerfile +usage: docker builder build [OPTIONS] PATH | URL | - +pname: docker builder +plink: docker_builder.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: build-arg + value_type: list + description: Set build-time variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cache-from + value_type: stringSlice + default_value: '[]' + description: Images to consider as cache sources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: compress + value_type: bool + default_value: "false" + description: Compress the build context using gzip + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + description: Name of the Dockerfile (Default is 'PATH/Dockerfile') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force-rm + value_type: bool + default_value: "false" + description: Always remove intermediate containers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: iidfile + value_type: string + description: Write the image ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: list + description: Set metadata for an image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: string + default_value: default + description: | + Set the networking mode for the RUN instructions during build + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-cache + value_type: bool + default_value: "false" + description: Do not use cache when building the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: output + shorthand: o + value_type: stringArray + default_value: '[]' + description: 'Output destination (format: type=local,dest=path)' + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.38" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: progress + value_type: string + default_value: auto + description: | + Set type of progress output (auto, plain, tty). Use plain to show container output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Always attempt to pull a newer version of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the build output and print image ID on success + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "true" + description: Remove intermediate containers after a successful build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret + value_type: stringArray + default_value: '[]' + description: | + Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: stringSlice + default_value: '[]' + description: Security options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: squash + value_type: bool + default_value: "false" + description: Squash newly built layers into a single new layer + deprecated: false + min_api_version: "1.25" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: ssh + value_type: stringArray + default_value: '[]' + description: | + SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|[=|[,]]) + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stream + value_type: bool + default_value: "false" + description: Stream attaches to server to negotiate build context + deprecated: false + min_api_version: "1.31" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: list + description: Name and optionally a tag in the 'name:tag' format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target + value_type: string + description: Set the target build stage to build. + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.31" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_builder_prune.yaml b/_data/engine-cli/docker_builder_prune.yaml new file mode 100644 index 0000000..f8614f9 --- /dev/null +++ b/_data/engine-cli/docker_builder_prune.yaml @@ -0,0 +1,51 @@ +command: docker builder prune +short: Remove build cache +long: Remove build cache +usage: docker builder prune +pname: docker builder +plink: docker_builder.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Remove all unused build cache, not just dangling ones + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + value_type: filter + description: Provide filter values (e.g. 'until=24h') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: keep-storage + value_type: bytes + default_value: "0" + description: Amount of disk space to keep for cache + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.39" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_checkpoint.yaml b/_data/engine-cli/docker_checkpoint.yaml new file mode 100644 index 0000000..d170105 --- /dev/null +++ b/_data/engine-cli/docker_checkpoint.yaml @@ -0,0 +1,22 @@ +command: docker checkpoint +short: Manage checkpoints +long: Manage checkpoints +usage: docker checkpoint +pname: docker +plink: docker.yaml +cname: +- docker checkpoint create +- docker checkpoint ls +- docker checkpoint rm +clink: +- docker_checkpoint_create.yaml +- docker_checkpoint_ls.yaml +- docker_checkpoint_rm.yaml +deprecated: false +min_api_version: "1.25" +experimental: true +experimentalcli: false +kubernetes: false +swarm: false +os_type: linux + diff --git a/_data/engine-cli/docker_checkpoint_create.yaml b/_data/engine-cli/docker_checkpoint_create.yaml new file mode 100644 index 0000000..c45b1f5 --- /dev/null +++ b/_data/engine-cli/docker_checkpoint_create.yaml @@ -0,0 +1,32 @@ +command: docker checkpoint create +short: Create a checkpoint from a running container +long: Create a checkpoint from a running container +usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT +pname: docker checkpoint +plink: docker_checkpoint.yaml +options: +- option: checkpoint-dir + value_type: string + description: Use a custom checkpoint storage directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: leave-running + value_type: bool + default_value: "false" + description: Leave the container running after checkpoint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.25" +experimental: true +experimentalcli: false +kubernetes: false +swarm: false +os_type: linux + diff --git a/_data/engine-cli/docker_checkpoint_ls.yaml b/_data/engine-cli/docker_checkpoint_ls.yaml new file mode 100644 index 0000000..2d5966a --- /dev/null +++ b/_data/engine-cli/docker_checkpoint_ls.yaml @@ -0,0 +1,24 @@ +command: docker checkpoint ls +aliases: list +short: List checkpoints for a container +long: List checkpoints for a container +usage: docker checkpoint ls [OPTIONS] CONTAINER +pname: docker checkpoint +plink: docker_checkpoint.yaml +options: +- option: checkpoint-dir + value_type: string + description: Use a custom checkpoint storage directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.25" +experimental: true +experimentalcli: false +kubernetes: false +swarm: false +os_type: linux + diff --git a/_data/engine-cli/docker_checkpoint_rm.yaml b/_data/engine-cli/docker_checkpoint_rm.yaml new file mode 100644 index 0000000..eab1482 --- /dev/null +++ b/_data/engine-cli/docker_checkpoint_rm.yaml @@ -0,0 +1,24 @@ +command: docker checkpoint rm +aliases: remove +short: Remove a checkpoint +long: Remove a checkpoint +usage: docker checkpoint rm [OPTIONS] CONTAINER CHECKPOINT +pname: docker checkpoint +plink: docker_checkpoint.yaml +options: +- option: checkpoint-dir + value_type: string + description: Use a custom checkpoint storage directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.25" +experimental: true +experimentalcli: false +kubernetes: false +swarm: false +os_type: linux + diff --git a/_data/engine-cli/docker_commit.yaml b/_data/engine-cli/docker_commit.yaml new file mode 100644 index 0000000..964b0a6 --- /dev/null +++ b/_data/engine-cli/docker_commit.yaml @@ -0,0 +1,133 @@ +command: docker commit +short: Create a new image from a container's changes +long: |- + It can be useful to commit a container's file changes or settings into a new + image. This allows you to debug a container by running an interactive shell, or to + export a working dataset to another server. Generally, it is better to use + Dockerfiles to manage your images in a documented and maintainable way. + [Read more about valid image names and tags](tag.md). + + The commit operation will not include any data contained in + volumes mounted inside the container. + + By default, the container being committed and its processes will be paused + while the image is committed. This reduces the likelihood of encountering data + corruption during the process of creating the commit. If this behavior is + undesired, set the `--pause` option to false. + + The `--change` option will apply `Dockerfile` instructions to the image that is + created. Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`LABEL`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` +usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]] +pname: docker +plink: docker.yaml +options: +- option: author + shorthand: a + value_type: string + description: Author (e.g., "John Hannibal Smith ") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: change + shorthand: c + value_type: list + description: Apply Dockerfile instruction to the created image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: message + shorthand: m + value_type: string + description: Commit message + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pause + shorthand: p + value_type: bool + default_value: "true" + description: Pause container during commit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Commit a container + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + + $ docker commit c3f279d17e0a svendowideit/testimage:version3 + + f5283438590d + + $ docker images + + REPOSITORY TAG ID CREATED SIZE + svendowideit/testimage version3 f5283438590d 16 seconds ago 335.7 MB + ``` + + ### Commit a container with new configurations + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + + $ docker inspect -f "{{ .Config.Env }}" c3f279d17e0a + + [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin] + + $ docker commit --change "ENV DEBUG=true" c3f279d17e0a svendowideit/testimage:version3 + + f5283438590d + + $ docker inspect -f "{{ .Config.Env }}" f5283438590d + + [HOME=/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin DEBUG=true] + ``` + + ### Commit a container with new `CMD` and `EXPOSE` instructions + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + + $ docker commit --change='CMD ["apachectl", "-DFOREGROUND"]' -c "EXPOSE 80" c3f279d17e0a svendowideit/testimage:version4 + + f5283438590d + + $ docker run -d svendowideit/testimage:version4 + + 89373736e2e7f00bc149bd783073ac43d0507da250e999f3f1036e0db60817c0 + + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 89373736e2e7 testimage:version4 "apachectl -DFOREGROU" 3 seconds ago Up 2 seconds 80/tcp distracted_fermat + c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours desperate_dubinsky + 197387f1b436 ubuntu:12.04 /bin/bash 7 days ago Up 25 hours focused_hamilton + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_config.yaml b/_data/engine-cli/docker_config.yaml new file mode 100644 index 0000000..3689f3b --- /dev/null +++ b/_data/engine-cli/docker_config.yaml @@ -0,0 +1,23 @@ +command: docker config +short: Manage Docker configs +long: Manage Docker configs +usage: docker config +pname: docker +plink: docker.yaml +cname: +- docker config create +- docker config inspect +- docker config ls +- docker config rm +clink: +- docker_config_create.yaml +- docker_config_inspect.yaml +- docker_config_ls.yaml +- docker_config_rm.yaml +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_config_create.yaml b/_data/engine-cli/docker_config_create.yaml new file mode 100644 index 0000000..18fc458 --- /dev/null +++ b/_data/engine-cli/docker_config_create.yaml @@ -0,0 +1,32 @@ +command: docker config create +short: Create a config from a file or STDIN +long: Create a config from a file or STDIN +usage: docker config create [OPTIONS] CONFIG file|- +pname: docker config +plink: docker_config.yaml +options: +- option: label + shorthand: l + value_type: list + description: Config labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: template-driver + value_type: string + description: Template driver + deprecated: false + min_api_version: "1.37" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_config_inspect.yaml b/_data/engine-cli/docker_config_inspect.yaml new file mode 100644 index 0000000..015af0d --- /dev/null +++ b/_data/engine-cli/docker_config_inspect.yaml @@ -0,0 +1,32 @@ +command: docker config inspect +short: Display detailed information on one or more configs +long: Display detailed information on one or more configs +usage: docker config inspect [OPTIONS] CONFIG [CONFIG...] +pname: docker config +plink: docker_config.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pretty + value_type: bool + default_value: "false" + description: Print the information in a human friendly format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_config_ls.yaml b/_data/engine-cli/docker_config_ls.yaml new file mode 100644 index 0000000..100f632 --- /dev/null +++ b/_data/engine-cli/docker_config_ls.yaml @@ -0,0 +1,42 @@ +command: docker config ls +aliases: list +short: List configs +long: List configs +usage: docker config ls [OPTIONS] +pname: docker config +plink: docker_config.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print configs using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_config_rm.yaml b/_data/engine-cli/docker_config_rm.yaml new file mode 100644 index 0000000..991ecfc --- /dev/null +++ b/_data/engine-cli/docker_config_rm.yaml @@ -0,0 +1,14 @@ +command: docker config rm +aliases: remove +short: Remove one or more configs +long: Remove one or more configs +usage: docker config rm CONFIG [CONFIG...] +pname: docker config +plink: docker_config.yaml +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_container.yaml b/_data/engine-cli/docker_container.yaml new file mode 100644 index 0000000..3c501b4 --- /dev/null +++ b/_data/engine-cli/docker_container.yaml @@ -0,0 +1,64 @@ +command: docker container +short: Manage containers +long: Manage containers. +usage: docker container +pname: docker +plink: docker.yaml +cname: +- docker container attach +- docker container commit +- docker container cp +- docker container create +- docker container diff +- docker container exec +- docker container export +- docker container inspect +- docker container kill +- docker container logs +- docker container ls +- docker container pause +- docker container port +- docker container prune +- docker container rename +- docker container restart +- docker container rm +- docker container run +- docker container start +- docker container stats +- docker container stop +- docker container top +- docker container unpause +- docker container update +- docker container wait +clink: +- docker_container_attach.yaml +- docker_container_commit.yaml +- docker_container_cp.yaml +- docker_container_create.yaml +- docker_container_diff.yaml +- docker_container_exec.yaml +- docker_container_export.yaml +- docker_container_inspect.yaml +- docker_container_kill.yaml +- docker_container_logs.yaml +- docker_container_ls.yaml +- docker_container_pause.yaml +- docker_container_port.yaml +- docker_container_prune.yaml +- docker_container_rename.yaml +- docker_container_restart.yaml +- docker_container_rm.yaml +- docker_container_run.yaml +- docker_container_start.yaml +- docker_container_stats.yaml +- docker_container_stop.yaml +- docker_container_top.yaml +- docker_container_unpause.yaml +- docker_container_update.yaml +- docker_container_wait.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_attach.yaml b/_data/engine-cli/docker_container_attach.yaml new file mode 100644 index 0000000..95b4d3e --- /dev/null +++ b/_data/engine-cli/docker_container_attach.yaml @@ -0,0 +1,39 @@ +command: docker container attach +short: Attach local standard input, output, and error streams to a running container +long: Attach local standard input, output, and error streams to a running container +usage: docker container attach [OPTIONS] CONTAINER +pname: docker container +plink: docker_container.yaml +options: +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-stdin + value_type: bool + default_value: "false" + description: Do not attach STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sig-proxy + value_type: bool + default_value: "true" + description: Proxy all received signals to the process + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_commit.yaml b/_data/engine-cli/docker_container_commit.yaml new file mode 100644 index 0000000..8524a53 --- /dev/null +++ b/_data/engine-cli/docker_container_commit.yaml @@ -0,0 +1,50 @@ +command: docker container commit +short: Create a new image from a container's changes +long: Create a new image from a container's changes +usage: docker container commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]] +pname: docker container +plink: docker_container.yaml +options: +- option: author + shorthand: a + value_type: string + description: Author (e.g., "John Hannibal Smith ") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: change + shorthand: c + value_type: list + description: Apply Dockerfile instruction to the created image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: message + shorthand: m + value_type: string + description: Commit message + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pause + shorthand: p + value_type: bool + default_value: "true" + description: Pause container during commit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_cp.yaml b/_data/engine-cli/docker_container_cp.yaml new file mode 100644 index 0000000..e308f40 --- /dev/null +++ b/_data/engine-cli/docker_container_cp.yaml @@ -0,0 +1,40 @@ +command: docker container cp +short: Copy files/folders between a container and the local filesystem +long: |- + Copy files/folders between a container and the local filesystem + + Use '-' as the source to read a tar archive from stdin + and extract it to a directory destination in a container. + Use '-' as the destination to stream a tar archive of a + container source to stdout. +usage: "docker container cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-\n\tdocker cp + [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH" +pname: docker container +plink: docker_container.yaml +options: +- option: archive + shorthand: a + value_type: bool + default_value: "false" + description: Archive mode (copy all uid/gid information) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: follow-link + shorthand: L + value_type: bool + default_value: "false" + description: Always follow symbol link in SRC_PATH + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_create.yaml b/_data/engine-cli/docker_container_create.yaml new file mode 100644 index 0000000..efbd9f0 --- /dev/null +++ b/_data/engine-cli/docker_container_create.yaml @@ -0,0 +1,871 @@ +command: docker container create +short: Create a new container +long: Create a new container +usage: docker container create [OPTIONS] IMAGE [COMMAND] [ARG...] +pname: docker container +plink: docker_container.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: attach + shorthand: a + value_type: list + description: Attach to STDIN, STDOUT or STDERR + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight-device + value_type: list + default_value: '[]' + description: Block IO weight (relative device weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-add + value_type: list + description: Add Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-drop + value_type: list + description: Drop Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cidfile + value_type: string + description: Write the container ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-count + value_type: int64 + default_value: "0" + description: CPU count (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-percent + value_type: int64 + default_value: "0" + description: CPU percent (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device + value_type: list + description: Add a host device to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-cgroup-rule + value_type: list + description: Add a rule to the cgroup allowed devices list + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-bps + value_type: list + default_value: '[]' + description: Limit read rate (bytes per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-iops + value_type: list + default_value: '[]' + description: Limit read rate (IO per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-bps + value_type: list + default_value: '[]' + description: Limit write rate (bytes per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-iops + value_type: list + default_value: '[]' + description: Limit write rate (IO per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns + value_type: list + description: Set custom DNS servers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-opt + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search + value_type: list + description: Set custom DNS search domains + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: domainname + value_type: string + description: Container NIS domain name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: string + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-file + value_type: list + description: Read in a file of environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: expose + value_type: list + description: Expose a port or a range of ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: gpus + value_type: gpu-request + description: GPU devices to add to the container ('all' to pass all GPUs) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-add + value_type: list + description: Add additional groups to join + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + default_value: 0s + description: Time between running the check (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + default_value: 0s + description: | + Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + default_value: 0s + description: | + Maximum time to allow one check to run (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: help + value_type: bool + default_value: "false" + description: Print usage + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + shorthand: h + value_type: string + description: Container host name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Run an init inside the container that forwards signals and reaps processes + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: io-maxbandwidth + value_type: bytes + default_value: "0" + description: | + Maximum IO bandwidth limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: io-maxiops + value_type: uint64 + default_value: "0" + description: Maximum IOps limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: ip + value_type: string + description: IPv4 address (e.g., 172.30.100.104) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip6 + value_type: string + description: IPv6 address (e.g., 2001:db8::33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipc + value_type: string + description: IPC mode to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Set meta data on a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-file + value_type: list + description: Read in a line delimited file of labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + value_type: list + description: Add link to another container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link-local-ip + value_type: list + description: Container IPv4/IPv6 link-local addresses + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Log driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mac-address + value_type: string + description: Container MAC address (e.g., 92:d0:c6:0a:29:33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swappiness + value_type: int64 + default_value: "-1" + description: Tune container memory swappiness (0 to 100) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount + value_type: mount + description: Attach a filesystem mount to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Assign a name to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-kill-disable + value_type: bool + default_value: "false" + description: Disable OOM Killer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-score-adj + value_type: int + default_value: "0" + description: Tune host's OOM preferences (-1000 to 1000) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pid + value_type: string + description: PID namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish + shorthand: p + value_type: list + description: Publish a container's port(s) to the host + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-all + shorthand: P + value_type: bool + default_value: "false" + description: Publish all exposed ports to random ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + default_value: "no" + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "false" + description: Automatically remove the container when it exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: runtime + value_type: string + description: Runtime to use for this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: list + description: Security Options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + default_value: SIGTERM + description: Signal to stop a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-timeout + value_type: int + default_value: "0" + description: Timeout (in seconds) to stop a container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: storage-opt + value_type: list + description: Storage driver options for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl + value_type: map + default_value: map[] + description: Sysctl options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tmpfs + value_type: list + description: Mount a tmpfs directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: userns + value_type: string + description: User namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: uts + value_type: string + description: UTS namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume + shorthand: v + value_type: list + description: Bind mount a volume + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume-driver + value_type: string + description: Optional volume driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes-from + value_type: list + description: Mount volumes from the specified container(s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_diff.yaml b/_data/engine-cli/docker_container_diff.yaml new file mode 100644 index 0000000..48c1ccf --- /dev/null +++ b/_data/engine-cli/docker_container_diff.yaml @@ -0,0 +1,12 @@ +command: docker container diff +short: Inspect changes to files or directories on a container's filesystem +long: Inspect changes to files or directories on a container's filesystem +usage: docker container diff CONTAINER +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_exec.yaml b/_data/engine-cli/docker_container_exec.yaml new file mode 100644 index 0000000..7f6a1a5 --- /dev/null +++ b/_data/engine-cli/docker_container_exec.yaml @@ -0,0 +1,89 @@ +command: docker container exec +short: Run a command in a running container +long: Run a command in a running container +usage: docker container exec [OPTIONS] CONTAINER COMMAND [ARG...] +pname: docker container +plink: docker_container.yaml +options: +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: 'Detached mode: run command in the background' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to the command + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_export.yaml b/_data/engine-cli/docker_container_export.yaml new file mode 100644 index 0000000..e45c77d --- /dev/null +++ b/_data/engine-cli/docker_container_export.yaml @@ -0,0 +1,22 @@ +command: docker container export +short: Export a container's filesystem as a tar archive +long: Export a container's filesystem as a tar archive +usage: docker container export [OPTIONS] CONTAINER +pname: docker container +plink: docker_container.yaml +options: +- option: output + shorthand: o + value_type: string + description: Write to a file, instead of STDOUT + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_inspect.yaml b/_data/engine-cli/docker_container_inspect.yaml new file mode 100644 index 0000000..c27e4a4 --- /dev/null +++ b/_data/engine-cli/docker_container_inspect.yaml @@ -0,0 +1,32 @@ +command: docker container inspect +short: Display detailed information on one or more containers +long: Display detailed information on one or more containers +usage: docker container inspect [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: size + shorthand: s + value_type: bool + default_value: "false" + description: Display total file sizes + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_kill.yaml b/_data/engine-cli/docker_container_kill.yaml new file mode 100644 index 0000000..44c184a --- /dev/null +++ b/_data/engine-cli/docker_container_kill.yaml @@ -0,0 +1,23 @@ +command: docker container kill +short: Kill one or more running containers +long: Kill one or more running containers +usage: docker container kill [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: signal + shorthand: s + value_type: string + default_value: KILL + description: Signal to send to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_logs.yaml b/_data/engine-cli/docker_container_logs.yaml new file mode 100644 index 0000000..4bfb043 --- /dev/null +++ b/_data/engine-cli/docker_container_logs.yaml @@ -0,0 +1,70 @@ +command: docker container logs +short: Fetch the logs of a container +long: Fetch the logs of a container +usage: docker container logs [OPTIONS] CONTAINER +pname: docker container +plink: docker_container.yaml +options: +- option: details + value_type: bool + default_value: "false" + description: Show extra details provided to logs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: follow + shorthand: f + value_type: bool + default_value: "false" + description: Follow log output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: since + value_type: string + description: | + Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tail + value_type: string + default_value: all + description: Number of lines to show from the end of the logs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: timestamps + shorthand: t + value_type: bool + default_value: "false" + description: Show timestamps + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: until + value_type: string + description: | + Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_ls.yaml b/_data/engine-cli/docker_container_ls.yaml new file mode 100644 index 0000000..59f445b --- /dev/null +++ b/_data/engine-cli/docker_container_ls.yaml @@ -0,0 +1,90 @@ +command: docker container ls +aliases: ps, list +short: List containers +long: List containers +usage: docker container ls [OPTIONS] +pname: docker container +plink: docker_container.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all containers (default shows just running) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print containers using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: last + shorthand: "n" + value_type: int + default_value: "-1" + description: Show n last created containers (includes all states) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: latest + shorthand: l + value_type: bool + default_value: "false" + description: Show the latest created container (includes all states) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: size + shorthand: s + value_type: bool + default_value: "false" + description: Display total file sizes + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_pause.yaml b/_data/engine-cli/docker_container_pause.yaml new file mode 100644 index 0000000..dd28f67 --- /dev/null +++ b/_data/engine-cli/docker_container_pause.yaml @@ -0,0 +1,12 @@ +command: docker container pause +short: Pause all processes within one or more containers +long: Pause all processes within one or more containers +usage: docker container pause CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_port.yaml b/_data/engine-cli/docker_container_port.yaml new file mode 100644 index 0000000..e211a44 --- /dev/null +++ b/_data/engine-cli/docker_container_port.yaml @@ -0,0 +1,12 @@ +command: docker container port +short: List port mappings or a specific mapping for the container +long: List port mappings or a specific mapping for the container +usage: docker container port CONTAINER [PRIVATE_PORT[/PROTO]] +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_prune.yaml b/_data/engine-cli/docker_container_prune.yaml new file mode 100644 index 0000000..b26f0e2 --- /dev/null +++ b/_data/engine-cli/docker_container_prune.yaml @@ -0,0 +1,116 @@ +command: docker container prune +short: Remove all stopped containers +long: Removes all stopped containers. +usage: docker container prune [OPTIONS] +pname: docker container +plink: docker_container.yaml +options: +- option: filter + value_type: filter + description: Provide filter values (e.g. 'until=') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Prune containers + + ```bash + $ docker container prune + WARNING! This will remove all stopped containers. + Are you sure you want to continue? [y/N] y + Deleted Containers: + 4a7f7eebae0f63178aff7eb0aa39cd3f0627a203ab2df258c1a00b456cf20063 + f98f9c2aa1eaf727e4ec9c0283bc7d4aa4762fbdba7f26191f26c97f64090360 + + Total reclaimed space: 212 B + ``` + + ### Filtering + + The filtering flag (`--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * until (``) - only remove containers created before given timestamp + * label (`label=`, `label==`, `label!=`, or `label!==`) - only remove containers with (or without, in case `label!=...` is used) the specified labels. + + The `until` filter can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the daemon machine’s time. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the daemon will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), + which removes containers with the specified labels. The other + format is the `label!=...` (`label!=` or `label!==`), which removes + containers without the specified labels. + + The following removes containers created more than 5 minutes ago: + + ```bash + $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}' + + CONTAINER ID IMAGE COMMAND CREATED AT STATUS + 61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 41 seconds ago + 53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 12 minutes ago + + $ docker container prune --force --filter "until=5m" + + Deleted Containers: + 53a9bc23a5168b6caa2bfbefddf1b30f93c7ad57f3dec271fd32707497cb9369 + + Total reclaimed space: 25 B + + $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}' + + CONTAINER ID IMAGE COMMAND CREATED AT STATUS + 61b9efa71024 busybox "sh" 2017-01-04 13:23:33 -0800 PST Exited (0) 44 seconds ago + ``` + + The following removes containers created before `2017-01-04T13:10:00`: + + ```bash + $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}' + + CONTAINER ID IMAGE COMMAND CREATED AT STATUS + 53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 7 minutes ago + 4a75091a6d61 busybox "sh" 2017-01-04 13:09:53 -0800 PST Exited (0) 9 minutes ago + + $ docker container prune --force --filter "until=2017-01-04T13:10:00" + + Deleted Containers: + 4a75091a6d618526fcd8b33ccd6e5928ca2a64415466f768a6180004b0c72c6c + + Total reclaimed space: 27 B + + $ docker ps -a --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.CreatedAt}}\t{{.Status}}' + + CONTAINER ID IMAGE COMMAND CREATED AT STATUS + 53a9bc23a516 busybox "sh" 2017-01-04 13:11:59 -0800 PST Exited (0) 9 minutes ago + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_rename.yaml b/_data/engine-cli/docker_container_rename.yaml new file mode 100644 index 0000000..088cfe0 --- /dev/null +++ b/_data/engine-cli/docker_container_rename.yaml @@ -0,0 +1,12 @@ +command: docker container rename +short: Rename a container +long: Rename a container +usage: docker container rename CONTAINER NEW_NAME +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_restart.yaml b/_data/engine-cli/docker_container_restart.yaml new file mode 100644 index 0000000..74d8bba --- /dev/null +++ b/_data/engine-cli/docker_container_restart.yaml @@ -0,0 +1,23 @@ +command: docker container restart +short: Restart one or more containers +long: Restart one or more containers +usage: docker container restart [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: time + shorthand: t + value_type: int + default_value: "10" + description: Seconds to wait for stop before killing the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_rm.yaml b/_data/engine-cli/docker_container_rm.yaml new file mode 100644 index 0000000..cce6056 --- /dev/null +++ b/_data/engine-cli/docker_container_rm.yaml @@ -0,0 +1,43 @@ +command: docker container rm +short: Remove one or more containers +long: Remove one or more containers +usage: docker container rm [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the removal of a running container (uses SIGKILL) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + shorthand: l + value_type: bool + default_value: "false" + description: Remove the specified link + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes + shorthand: v + value_type: bool + default_value: "false" + description: Remove anonymous volumes associated with the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_run.yaml b/_data/engine-cli/docker_container_run.yaml new file mode 100644 index 0000000..87a149b --- /dev/null +++ b/_data/engine-cli/docker_container_run.yaml @@ -0,0 +1,898 @@ +command: docker container run +short: Run a command in a new container +long: Run a command in a new container +usage: docker container run [OPTIONS] IMAGE [COMMAND] [ARG...] +pname: docker container +plink: docker_container.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: attach + shorthand: a + value_type: list + description: Attach to STDIN, STDOUT or STDERR + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight-device + value_type: list + default_value: '[]' + description: Block IO weight (relative device weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-add + value_type: list + description: Add Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-drop + value_type: list + description: Drop Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cidfile + value_type: string + description: Write the container ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-count + value_type: int64 + default_value: "0" + description: CPU count (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-percent + value_type: int64 + default_value: "0" + description: CPU percent (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: Run container in background and print container ID + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device + value_type: list + description: Add a host device to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-cgroup-rule + value_type: list + description: Add a rule to the cgroup allowed devices list + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-bps + value_type: list + default_value: '[]' + description: Limit read rate (bytes per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-iops + value_type: list + default_value: '[]' + description: Limit read rate (IO per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-bps + value_type: list + default_value: '[]' + description: Limit write rate (bytes per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-iops + value_type: list + default_value: '[]' + description: Limit write rate (IO per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns + value_type: list + description: Set custom DNS servers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-opt + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search + value_type: list + description: Set custom DNS search domains + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: domainname + value_type: string + description: Container NIS domain name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: string + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-file + value_type: list + description: Read in a file of environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: expose + value_type: list + description: Expose a port or a range of ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: gpus + value_type: gpu-request + description: GPU devices to add to the container ('all' to pass all GPUs) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-add + value_type: list + description: Add additional groups to join + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + default_value: 0s + description: Time between running the check (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + default_value: 0s + description: | + Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + default_value: 0s + description: | + Maximum time to allow one check to run (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: help + value_type: bool + default_value: "false" + description: Print usage + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + shorthand: h + value_type: string + description: Container host name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Run an init inside the container that forwards signals and reaps processes + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: io-maxbandwidth + value_type: bytes + default_value: "0" + description: | + Maximum IO bandwidth limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: io-maxiops + value_type: uint64 + default_value: "0" + description: Maximum IOps limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: ip + value_type: string + description: IPv4 address (e.g., 172.30.100.104) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip6 + value_type: string + description: IPv6 address (e.g., 2001:db8::33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipc + value_type: string + description: IPC mode to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Set meta data on a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-file + value_type: list + description: Read in a line delimited file of labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + value_type: list + description: Add link to another container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link-local-ip + value_type: list + description: Container IPv4/IPv6 link-local addresses + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Log driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mac-address + value_type: string + description: Container MAC address (e.g., 92:d0:c6:0a:29:33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swappiness + value_type: int64 + default_value: "-1" + description: Tune container memory swappiness (0 to 100) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount + value_type: mount + description: Attach a filesystem mount to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Assign a name to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-kill-disable + value_type: bool + default_value: "false" + description: Disable OOM Killer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-score-adj + value_type: int + default_value: "0" + description: Tune host's OOM preferences (-1000 to 1000) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pid + value_type: string + description: PID namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish + shorthand: p + value_type: list + description: Publish a container's port(s) to the host + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-all + shorthand: P + value_type: bool + default_value: "false" + description: Publish all exposed ports to random ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + default_value: "no" + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "false" + description: Automatically remove the container when it exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: runtime + value_type: string + description: Runtime to use for this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: list + description: Security Options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sig-proxy + value_type: bool + default_value: "true" + description: Proxy received signals to the process + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + default_value: SIGTERM + description: Signal to stop a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-timeout + value_type: int + default_value: "0" + description: Timeout (in seconds) to stop a container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: storage-opt + value_type: list + description: Storage driver options for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl + value_type: map + default_value: map[] + description: Sysctl options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tmpfs + value_type: list + description: Mount a tmpfs directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: userns + value_type: string + description: User namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: uts + value_type: string + description: UTS namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume + shorthand: v + value_type: list + description: Bind mount a volume + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume-driver + value_type: string + description: Optional volume driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes-from + value_type: list + description: Mount volumes from the specified container(s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_start.yaml b/_data/engine-cli/docker_container_start.yaml new file mode 100644 index 0000000..e31d6be --- /dev/null +++ b/_data/engine-cli/docker_container_start.yaml @@ -0,0 +1,59 @@ +command: docker container start +short: Start one or more stopped containers +long: Start one or more stopped containers +usage: docker container start [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: attach + shorthand: a + value_type: bool + default_value: "false" + description: Attach STDOUT/STDERR and forward signals + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: checkpoint + value_type: string + description: Restore from this checkpoint + deprecated: false + experimental: true + experimentalcli: false + kubernetes: false + swarm: false + os_type: linux +- option: checkpoint-dir + value_type: string + description: Use a custom checkpoint storage directory + deprecated: false + experimental: true + experimentalcli: false + kubernetes: false + swarm: false + os_type: linux +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Attach container's STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_stats.yaml b/_data/engine-cli/docker_container_stats.yaml new file mode 100644 index 0000000..d8f081e --- /dev/null +++ b/_data/engine-cli/docker_container_stats.yaml @@ -0,0 +1,49 @@ +command: docker container stats +short: Display a live stream of container(s) resource usage statistics +long: Display a live stream of container(s) resource usage statistics +usage: docker container stats [OPTIONS] [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all containers (default shows just running) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-stream + value_type: bool + default_value: "false" + description: Disable streaming stats and only pull the first result + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_stop.yaml b/_data/engine-cli/docker_container_stop.yaml new file mode 100644 index 0000000..80fa23d --- /dev/null +++ b/_data/engine-cli/docker_container_stop.yaml @@ -0,0 +1,23 @@ +command: docker container stop +short: Stop one or more running containers +long: Stop one or more running containers +usage: docker container stop [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: time + shorthand: t + value_type: int + default_value: "10" + description: Seconds to wait for stop before killing it + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_top.yaml b/_data/engine-cli/docker_container_top.yaml new file mode 100644 index 0000000..c356563 --- /dev/null +++ b/_data/engine-cli/docker_container_top.yaml @@ -0,0 +1,12 @@ +command: docker container top +short: Display the running processes of a container +long: Display the running processes of a container +usage: docker container top CONTAINER [ps OPTIONS] +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_unpause.yaml b/_data/engine-cli/docker_container_unpause.yaml new file mode 100644 index 0000000..fcd8612 --- /dev/null +++ b/_data/engine-cli/docker_container_unpause.yaml @@ -0,0 +1,12 @@ +command: docker container unpause +short: Unpause all processes within one or more containers +long: Unpause all processes within one or more containers +usage: docker container unpause CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_update.yaml b/_data/engine-cli/docker_container_update.yaml new file mode 100644 index 0000000..252ce31 --- /dev/null +++ b/_data/engine-cli/docker_container_update.yaml @@ -0,0 +1,152 @@ +command: docker container update +short: Update configuration of one or more containers +long: Update configuration of one or more containers +usage: docker container update [OPTIONS] CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +options: +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit the CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit the CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_container_wait.yaml b/_data/engine-cli/docker_container_wait.yaml new file mode 100644 index 0000000..9edf877 --- /dev/null +++ b/_data/engine-cli/docker_container_wait.yaml @@ -0,0 +1,12 @@ +command: docker container wait +short: Block until one or more containers stop, then print their exit codes +long: Block until one or more containers stop, then print their exit codes +usage: docker container wait CONTAINER [CONTAINER...] +pname: docker container +plink: docker_container.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context.yaml b/_data/engine-cli/docker_context.yaml new file mode 100644 index 0000000..b85be83 --- /dev/null +++ b/_data/engine-cli/docker_context.yaml @@ -0,0 +1,30 @@ +command: docker context +short: Manage contexts +long: Manage contexts +usage: docker context +pname: docker +plink: docker.yaml +cname: +- docker context create +- docker context export +- docker context import +- docker context inspect +- docker context ls +- docker context rm +- docker context update +- docker context use +clink: +- docker_context_create.yaml +- docker_context_export.yaml +- docker_context_import.yaml +- docker_context_inspect.yaml +- docker_context_ls.yaml +- docker_context_rm.yaml +- docker_context_update.yaml +- docker_context_use.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_create.yaml b/_data/engine-cli/docker_context_create.yaml new file mode 100644 index 0000000..a310209 --- /dev/null +++ b/_data/engine-cli/docker_context_create.yaml @@ -0,0 +1,125 @@ +command: docker context create +short: Create a context +long: |- + Creates a new `context`. This allows you to quickly switch the cli + configuration to connect to different clusters or single nodes. +usage: docker context create [OPTIONS] CONTEXT +pname: docker context +plink: docker_context.yaml +options: +- option: default-stack-orchestrator + value_type: string + description: | + Default orchestrator for stack operations to use with this context (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: description + value_type: string + description: Description of the context + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: docker + value_type: stringToString + default_value: '[]' + description: set the docker endpoint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: from + value_type: string + description: create context from a named context + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kubernetes + value_type: stringToString + default_value: '[]' + description: set the kubernetes endpoint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create a context with a docker and kubernetes endpoint + + To create a context from scratch provide the docker and, if required, + kubernetes options. The example below creates the context `my-context` + with a docker endpoint of `/var/run/docker.sock` and a kubernetes configuration + sourced from the file `/home/me/my-kube-config`: + + ```bash + $ docker context create \ + --docker host=unix:///var/run/docker.sock \ + --kubernetes config-file=/home/me/my-kube-config \ + my-context + ``` + + ### Create a context based on an existing context + + Use the `--from=` option to create a new context from + an existing context. The example below creates a new context named `my-context` + from the existing context `existing-context`: + + ```bash + $ docker context create --from existing-context my-context + ``` + + If the `--from` option is not set, the `context` is created from the current context: + + ```bash + $ docker context create my-context + ``` + + This can be used to create a context out of an existing `DOCKER_HOST` based script: + + ```bash + $ source my-setup-script.sh + $ docker context create my-context + ``` + + To source only the `docker` endpoint configuration from an existing context + use the `--docker from=` option. The example below creates a + new context named `my-context` using the docker endpoint configuration from + the existing context `existing-context` and a kubernetes configuration sourced + from the file `/home/me/my-kube-config`: + + ```bash + $ docker context create \ + --docker from=existing-context \ + --kubernetes config-file=/home/me/my-kube-config \ + my-context + ``` + + To source only the `kubernetes` configuration from an existing context use the + `--kubernetes from=` option. The example below creates a new + context named `my-context` using the kuberentes configuration from the existing + context `existing-context` and a docker endpoint of `/var/run/docker.sock`: + + ```bash + $ docker context create \ + --docker host=unix:///var/run/docker.sock \ + --kubernetes from=existing-context \ + my-context + ``` + + Docker and Kubernetes endpoints configurations, as well as default stack + orchestrator and description can be modified with `docker context update`. + + Refer to the [`docker context update` reference](context_update.md) for details. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_export.yaml b/_data/engine-cli/docker_context_export.yaml new file mode 100644 index 0000000..021fb0b --- /dev/null +++ b/_data/engine-cli/docker_context_export.yaml @@ -0,0 +1,26 @@ +command: docker context export +short: Export a context to a tar or kubeconfig file +long: |- + Exports a context in a file that can then be used with `docker context import` + (or with `kubectl` if `--kubeconfig` is set). Default output filename is + `.dockercontext`, or `.kubeconfig` if `--kubeconfig` is set. + To export to `STDOUT`, you can run `docker context export my-context -`. +usage: docker context export [OPTIONS] CONTEXT [FILE|-] +pname: docker context +plink: docker_context.yaml +options: +- option: kubeconfig + value_type: bool + default_value: "false" + description: Export as a kubeconfig file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_import.yaml b/_data/engine-cli/docker_context_import.yaml new file mode 100644 index 0000000..da71cae --- /dev/null +++ b/_data/engine-cli/docker_context_import.yaml @@ -0,0 +1,14 @@ +command: docker context import +short: Import a context from a tar or zip file +long: |- + Imports a context previously exported with `docker context export`. To import + from stdin, use a hyphen (`-`) as filename. +usage: docker context import CONTEXT FILE|- +pname: docker context +plink: docker_context.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_inspect.yaml b/_data/engine-cli/docker_context_inspect.yaml new file mode 100644 index 0000000..345cd2c --- /dev/null +++ b/_data/engine-cli/docker_context_inspect.yaml @@ -0,0 +1,60 @@ +command: docker context inspect +short: Display detailed information on one or more contexts +long: Inspects one or more contexts. +usage: docker context inspect [OPTIONS] [CONTEXT] [CONTEXT...] +pname: docker context +plink: docker_context.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Inspect a context by name + + ```bash + $ docker context inspect "local+aks" + + [ + { + "Name": "local+aks", + "Metadata": { + "Description": "Local Docker Engine + Azure AKS endpoint", + "StackOrchestrator": "kubernetes" + }, + "Endpoints": { + "docker": { + "Host": "npipe:////./pipe/docker_engine", + "SkipTLSVerify": false + }, + "kubernetes": { + "Host": "https://simon-aks-***.hcp.uksouth.azmk8s.io:443", + "SkipTLSVerify": false, + "DefaultNamespace": "default" + } + }, + "TLSMaterial": { + "kubernetes": [ + "ca.pem", + "cert.pem", + "key.pem" + ] + }, + "Storage": { + "MetadataPath": "C:\\Users\\simon\\.docker\\contexts\\meta\\cb6d08c0a1bfa5fe6f012e61a442788c00bed93f509141daff05f620fc54ddee", + "TLSPath": "C:\\Users\\simon\\.docker\\contexts\\tls\\cb6d08c0a1bfa5fe6f012e61a442788c00bed93f509141daff05f620fc54ddee" + } + } + ] + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_ls.yaml b/_data/engine-cli/docker_context_ls.yaml new file mode 100644 index 0000000..437cf09 --- /dev/null +++ b/_data/engine-cli/docker_context_ls.yaml @@ -0,0 +1,42 @@ +command: docker context ls +aliases: list +short: List contexts +long: List contexts +usage: docker context ls [OPTIONS] +pname: docker context +plink: docker_context.yaml +options: +- option: format + value_type: string + description: Pretty-print contexts using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show context names + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Use `docker context ls` to print all contexts. The currently active context is + indicated with an `*`: + + ```bash + NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR + default * Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm + production tcp:///prod.corp.example.com:2376 + staging tcp:///stage.corp.example.com:2376 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_rm.yaml b/_data/engine-cli/docker_context_rm.yaml new file mode 100644 index 0000000..f690a2e --- /dev/null +++ b/_data/engine-cli/docker_context_rm.yaml @@ -0,0 +1,24 @@ +command: docker context rm +aliases: remove +short: Remove one or more contexts +long: Remove one or more contexts +usage: docker context rm CONTEXT [CONTEXT...] +pname: docker context +plink: docker_context.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the removal of a context in use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_update.yaml b/_data/engine-cli/docker_context_update.yaml new file mode 100644 index 0000000..d5980a6 --- /dev/null +++ b/_data/engine-cli/docker_context_update.yaml @@ -0,0 +1,59 @@ +command: docker context update +short: Update a context +long: |- + Updates an existing `context`. + See [context create](context_create.md). +usage: docker context update [OPTIONS] CONTEXT +pname: docker context +plink: docker_context.yaml +options: +- option: default-stack-orchestrator + value_type: string + description: | + Default orchestrator for stack operations to use with this context (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: description + value_type: string + description: Description of the context + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: docker + value_type: stringToString + default_value: '[]' + description: set the docker endpoint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kubernetes + value_type: stringToString + default_value: '[]' + description: set the kubernetes endpoint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Update an existing context + + ```bash + $ docker context update \ + --description "some description" \ + --docker "host=tcp://myserver:2376,ca=~/ca-file,cert=~/cert-file,key=~/key-file" \ + my-context + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_context_use.yaml b/_data/engine-cli/docker_context_use.yaml new file mode 100644 index 0000000..3a44c21 --- /dev/null +++ b/_data/engine-cli/docker_context_use.yaml @@ -0,0 +1,15 @@ +command: docker context use +short: Set the current docker context +long: |- + Set the default context to use, when `DOCKER_HOST`, `DOCKER_CONTEXT` environment + variables and `--host`, `--context` global options are not set. + To disable usage of contexts, you can use the special `default` context. +usage: docker context use CONTEXT +pname: docker context +plink: docker_context.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_cp.yaml b/_data/engine-cli/docker_cp.yaml new file mode 100644 index 0000000..0c70ef5 --- /dev/null +++ b/_data/engine-cli/docker_cp.yaml @@ -0,0 +1,116 @@ +command: docker cp +short: Copy files/folders between a container and the local filesystem +long: |- + The `docker cp` utility copies the contents of `SRC_PATH` to the `DEST_PATH`. + You can copy from the container's file system to the local machine or the + reverse, from the local filesystem to the container. If `-` is specified for + either the `SRC_PATH` or `DEST_PATH`, you can also stream a tar archive from + `STDIN` or to `STDOUT`. The `CONTAINER` can be a running or stopped container. + The `SRC_PATH` or `DEST_PATH` can be a file or directory. + + The `docker cp` command assumes container paths are relative to the container's + `/` (root) directory. This means supplying the initial forward slash is optional; + The command sees `compassionate_darwin:/tmp/foo/myfile.txt` and + `compassionate_darwin:tmp/foo/myfile.txt` as identical. Local machine paths can + be an absolute or relative value. The command interprets a local machine's + relative paths as relative to the current working directory where `docker cp` is + run. + + The `cp` command behaves like the Unix `cp -a` command in that directories are + copied recursively with permissions preserved if possible. Ownership is set to + the user and primary group at the destination. For example, files copied to a + container are created with `UID:GID` of the root user. Files copied to the local + machine are created with the `UID:GID` of the user which invoked the `docker cp` + command. However, if you specify the `-a` option, `docker cp` sets the ownership + to the user and primary group at the source. + If you specify the `-L` option, `docker cp` follows any symbolic link + in the `SRC_PATH`. `docker cp` does *not* create parent directories for + `DEST_PATH` if they do not exist. + + Assuming a path separator of `/`, a first argument of `SRC_PATH` and second + argument of `DEST_PATH`, the behavior is as follows: + + - `SRC_PATH` specifies a file + - `DEST_PATH` does not exist + - the file is saved to a file created at `DEST_PATH` + - `DEST_PATH` does not exist and ends with `/` + - Error condition: the destination directory must exist. + - `DEST_PATH` exists and is a file + - the destination is overwritten with the source file's contents + - `DEST_PATH` exists and is a directory + - the file is copied into this directory using the basename from + `SRC_PATH` + - `SRC_PATH` specifies a directory + - `DEST_PATH` does not exist + - `DEST_PATH` is created as a directory and the *contents* of the source + directory are copied into this directory + - `DEST_PATH` exists and is a file + - Error condition: cannot copy a directory to a file + - `DEST_PATH` exists and is a directory + - `SRC_PATH` does not end with `/.` (that is: _slash_ followed by _dot_) + - the source directory is copied into this directory + - `SRC_PATH` does end with `/.` (that is: _slash_ followed by _dot_) + - the *content* of the source directory is copied into this + directory + + The command requires `SRC_PATH` and `DEST_PATH` to exist according to the above + rules. If `SRC_PATH` is local and is a symbolic link, the symbolic link, not + the target, is copied by default. To copy the link target and not the link, specify + the `-L` option. + + A colon (`:`) is used as a delimiter between `CONTAINER` and its path. You can + also use `:` when specifying paths to a `SRC_PATH` or `DEST_PATH` on a local + machine, for example `file:name.txt`. If you use a `:` in a local machine path, + you must be explicit with a relative or absolute path, for example: + + `/path/to/file:name.txt` or `./file:name.txt` + + It is not possible to copy certain system files such as resources under + `/proc`, `/sys`, `/dev`, [tmpfs](run.md#mount-tmpfs---tmpfs), and mounts created by + the user in the container. However, you can still copy such files by manually + running `tar` in `docker exec`. Both of the following examples do the same thing + in different ways (consider `SRC_PATH` and `DEST_PATH` are directories): + + ```bash + $ docker exec CONTAINER tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - + ``` + + ```bash + $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i CONTAINER tar Cxf DEST_PATH - + ``` + + Using `-` as the `SRC_PATH` streams the contents of `STDIN` as a tar archive. + The command extracts the content of the tar to the `DEST_PATH` in container's + filesystem. In this case, `DEST_PATH` must specify a directory. Using `-` as + the `DEST_PATH` streams the contents of the resource as a tar archive to `STDOUT`. +usage: "docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-\n\tdocker cp [OPTIONS] + SRC_PATH|- CONTAINER:DEST_PATH" +pname: docker +plink: docker.yaml +options: +- option: archive + shorthand: a + value_type: bool + default_value: "false" + description: Archive mode (copy all uid/gid information) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: follow-link + shorthand: L + value_type: bool + default_value: "false" + description: Always follow symbol link in SRC_PATH + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_create.yaml b/_data/engine-cli/docker_create.yaml new file mode 100644 index 0000000..5269b80 --- /dev/null +++ b/_data/engine-cli/docker_create.yaml @@ -0,0 +1,990 @@ +command: docker create +short: Create a new container +long: |- + The `docker create` command creates a writeable container layer over the + specified image and prepares it for running the specified command. The + container ID is then printed to `STDOUT`. This is similar to `docker run -d` + except the container is never started. You can then use the + `docker start ` command to start the container at any point. + + This is useful when you want to set up a container configuration ahead of time + so that it is ready to start when you need it. The initial status of the + new container is `created`. + + Please see the [run command](run.md) section and the [Docker run reference](../run.md) for more details. +usage: docker create [OPTIONS] IMAGE [COMMAND] [ARG...] +pname: docker +plink: docker.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: attach + shorthand: a + value_type: list + description: Attach to STDIN, STDOUT or STDERR + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight-device + value_type: list + default_value: '[]' + description: Block IO weight (relative device weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-add + value_type: list + description: Add Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-drop + value_type: list + description: Drop Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cidfile + value_type: string + description: Write the container ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-count + value_type: int64 + default_value: "0" + description: CPU count (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-percent + value_type: int64 + default_value: "0" + description: CPU percent (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device + value_type: list + description: Add a host device to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-cgroup-rule + value_type: list + description: Add a rule to the cgroup allowed devices list + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-bps + value_type: list + default_value: '[]' + description: Limit read rate (bytes per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-iops + value_type: list + default_value: '[]' + description: Limit read rate (IO per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-bps + value_type: list + default_value: '[]' + description: Limit write rate (bytes per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-iops + value_type: list + default_value: '[]' + description: Limit write rate (IO per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns + value_type: list + description: Set custom DNS servers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-opt + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search + value_type: list + description: Set custom DNS search domains + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: domainname + value_type: string + description: Container NIS domain name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: string + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-file + value_type: list + description: Read in a file of environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: expose + value_type: list + description: Expose a port or a range of ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: gpus + value_type: gpu-request + description: GPU devices to add to the container ('all' to pass all GPUs) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-add + value_type: list + description: Add additional groups to join + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + default_value: 0s + description: Time between running the check (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + default_value: 0s + description: | + Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + default_value: 0s + description: | + Maximum time to allow one check to run (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: help + value_type: bool + default_value: "false" + description: Print usage + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + shorthand: h + value_type: string + description: Container host name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Run an init inside the container that forwards signals and reaps processes + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: io-maxbandwidth + value_type: bytes + default_value: "0" + description: | + Maximum IO bandwidth limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: io-maxiops + value_type: uint64 + default_value: "0" + description: Maximum IOps limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: ip + value_type: string + description: IPv4 address (e.g., 172.30.100.104) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip6 + value_type: string + description: IPv6 address (e.g., 2001:db8::33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipc + value_type: string + description: IPC mode to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Set meta data on a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-file + value_type: list + description: Read in a line delimited file of labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + value_type: list + description: Add link to another container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link-local-ip + value_type: list + description: Container IPv4/IPv6 link-local addresses + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Log driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mac-address + value_type: string + description: Container MAC address (e.g., 92:d0:c6:0a:29:33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swappiness + value_type: int64 + default_value: "-1" + description: Tune container memory swappiness (0 to 100) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount + value_type: mount + description: Attach a filesystem mount to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Assign a name to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-kill-disable + value_type: bool + default_value: "false" + description: Disable OOM Killer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-score-adj + value_type: int + default_value: "0" + description: Tune host's OOM preferences (-1000 to 1000) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pid + value_type: string + description: PID namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish + shorthand: p + value_type: list + description: Publish a container's port(s) to the host + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-all + shorthand: P + value_type: bool + default_value: "false" + description: Publish all exposed ports to random ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + default_value: "no" + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "false" + description: Automatically remove the container when it exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: runtime + value_type: string + description: Runtime to use for this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: list + description: Security Options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + default_value: SIGTERM + description: Signal to stop a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-timeout + value_type: int + default_value: "0" + description: Timeout (in seconds) to stop a container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: storage-opt + value_type: list + description: Storage driver options for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl + value_type: map + default_value: map[] + description: Sysctl options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tmpfs + value_type: list + description: Mount a tmpfs directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: userns + value_type: string + description: User namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: uts + value_type: string + description: UTS namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume + shorthand: v + value_type: list + description: Bind mount a volume + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume-driver + value_type: string + description: Optional volume driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes-from + value_type: list + description: Mount volumes from the specified container(s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create and start a container + + ```bash + $ docker create -t -i fedora bash + + 6d8af538ec541dd581ebc2a24153a28329acb5268abe5ef868c1f1a261221752 + + $ docker start -a -i 6d8af538ec5 + + bash-4.2# + ``` + + ### Initialize volumes + + As of v1.4.0 container volumes are initialized during the `docker create` phase + (i.e., `docker run` too). For example, this allows you to `create` the `data` + volume container, and then use it from another container: + + ```bash + $ docker create -v /data --name data ubuntu + + 240633dfbb98128fa77473d3d9018f6123b99c454b3251427ae190a7d951ad57 + + $ docker run --rm --volumes-from data ubuntu ls -la /data + + total 8 + drwxr-xr-x 2 root root 4096 Dec 5 04:10 . + drwxr-xr-x 48 root root 4096 Dec 5 04:11 .. + ``` + + Similarly, `create` a host directory bind mounted volume container, which can + then be used from the subsequent container: + + ```bash + $ docker create -v /home/docker:/docker --name docker ubuntu + + 9aa88c08f319cd1e4515c3c46b0de7cc9aa75e878357b1e96f91e2c773029f03 + + $ docker run --rm --volumes-from docker ubuntu ls -la /docker + + total 20 + drwxr-sr-x 5 1000 staff 180 Dec 5 04:00 . + drwxr-xr-x 48 root root 4096 Dec 5 04:13 .. + -rw-rw-r-- 1 1000 staff 3833 Dec 5 04:01 .ash_history + -rw-r--r-- 1 1000 staff 446 Nov 28 11:51 .ashrc + -rw-r--r-- 1 1000 staff 25 Dec 5 04:00 .gitconfig + drwxr-sr-x 3 1000 staff 60 Dec 1 03:28 .local + -rw-r--r-- 1 1000 staff 920 Nov 28 11:51 .profile + drwx--S--- 2 1000 staff 460 Dec 5 00:51 .ssh + drwxr-xr-x 32 1000 staff 1140 Dec 5 04:01 docker + ``` + + + Set storage driver options per container. + + ```bash + $ docker create -it --storage-opt size=120G fedora /bin/bash + ``` + + This (size) will allow to set the container rootfs size to 120G at creation time. + This option is only available for the `devicemapper`, `btrfs`, `overlay2`, + `windowsfilter` and `zfs` graph drivers. + For the `devicemapper`, `btrfs`, `windowsfilter` and `zfs` graph drivers, + user cannot pass a size less than the Default BaseFS Size. + For the `overlay2` storage driver, the size option is only available if the + backing fs is `xfs` and mounted with the `pquota` mount option. + Under these conditions, user can pass any size less than the backing fs size. + + ### Specify isolation technology for container (--isolation) + + This option is useful in situations where you are running Docker containers on + Windows. The `--isolation=` option sets a container's isolation + technology. On Linux, the only supported is the `default` option which uses + Linux namespaces. On Microsoft Windows, you can specify these values: + + + | Value | Description | + |-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `default` | Use the value specified by the Docker daemon's `--exec-opt` . If the `daemon` does not specify an isolation technology, Microsoft Windows uses `process` as its default value if the + daemon is running on Windows server, or `hyperv` if running on Windows client. | + | `process` | Namespace isolation only. | + | `hyperv` | Hyper-V hypervisor partition-based isolation. | + + Specifying the `--isolation` flag without a value is the same as setting `--isolation="default"`. + + ### Dealing with dynamically created devices (--device-cgroup-rule) + + Devices available to a container are assigned at creation time. The + assigned devices will both be added to the cgroup.allow file and + created into the container once it is run. This poses a problem when + a new device needs to be added to running container. + + One of the solution is to add a more permissive rule to a container + allowing it access to a wider range of devices. For example, supposing + our container needs access to a character device with major `42` and + any number of minor number (added as new devices appear), the + following rule would be added: + + ``` + docker create --device-cgroup-rule='c 42:* rmw' -name my-container my-image + ``` + + Then, a user could ask `udev` to execute a script that would `docker exec my-container mknod newDevX c 42 ` + the required device when it is added. + + NOTE: initially present devices still need to be explicitly added to + the create/run command +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_diff.yaml b/_data/engine-cli/docker_diff.yaml new file mode 100644 index 0000000..4fd4fd4 --- /dev/null +++ b/_data/engine-cli/docker_diff.yaml @@ -0,0 +1,49 @@ +command: docker diff +short: Inspect changes to files or directories on a container's filesystem +long: |- + List the changed files and directories in a container᾿s filesystem since the + container was created. Three different types of change are tracked: + + | Symbol | Description | + |--------|---------------------------------| + | `A` | A file or directory was added | + | `D` | A file or directory was deleted | + | `C` | A file or directory was changed | + + You can use the full or shortened container ID or the container name set using + `docker run --name` option. +usage: docker diff CONTAINER +pname: docker +plink: docker.yaml +examples: |- + Inspect the changes to an `nginx` container: + + ```bash + $ docker diff 1fdfd1f54c1b + + C /dev + C /dev/console + C /dev/core + C /dev/stdout + C /dev/fd + C /dev/ptmx + C /dev/stderr + C /dev/stdin + C /run + A /run/nginx.pid + C /var/lib/nginx/tmp + A /var/lib/nginx/tmp/client_body + A /var/lib/nginx/tmp/fastcgi + A /var/lib/nginx/tmp/proxy + A /var/lib/nginx/tmp/scgi + A /var/lib/nginx/tmp/uwsgi + C /var/log/nginx + A /var/log/nginx/access.log + A /var/log/nginx/error.log + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_events.yaml b/_data/engine-cli/docker_events.yaml new file mode 100644 index 0000000..da511c9 --- /dev/null +++ b/_data/engine-cli/docker_events.yaml @@ -0,0 +1,433 @@ +command: docker events +short: Get real time events from the server +long: |- + Use `docker events` to get real-time events from the server. These events differ + per Docker object type. Different event types have different scopes. Local + scoped events are only seen on the node they take place on, and swarm scoped + events are seen on all managers. + + Only the last 1000 log events are returned. You can use filters to further limit + the number of events returned. + + ### Object types + + #### Containers + + Docker containers report the following events: + + - `attach` + - `commit` + - `copy` + - `create` + - `destroy` + - `detach` + - `die` + - `exec_create` + - `exec_detach` + - `exec_die` + - `exec_start` + - `export` + - `health_status` + - `kill` + - `oom` + - `pause` + - `rename` + - `resize` + - `restart` + - `start` + - `stop` + - `top` + - `unpause` + - `update` + + #### Images + + Docker images report the following events: + + - `delete` + - `import` + - `load` + - `pull` + - `push` + - `save` + - `tag` + - `untag` + + #### Plugins + + Docker plugins report the following events: + + - `enable` + - `disable` + - `install` + - `remove` + + #### Volumes + + Docker volumes report the following events: + + - `create` + - `destroy` + - `mount` + - `unmount` + + #### Networks + + Docker networks report the following events: + + - `create` + - `connect` + - `destroy` + - `disconnect` + - `remove` + + #### Daemons + + Docker daemons report the following events: + + - `reload` + + #### Services + + Docker services report the following events: + + - `create` + - `remove` + - `update` + + #### Nodes + + Docker nodes report the following events: + + - `create` + - `remove` + - `update` + + #### Secrets + + Docker secrets report the following events: + + - `create` + - `remove` + - `update` + + #### Configs + + Docker configs report the following events: + + - `create` + - `remove` + - `update` + + ### Limiting, filtering, and formatting the output + + #### Limit events by time + + The `--since` and `--until` parameters can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the client machine’s time. If you do not provide the `--since` option, + the command returns only new and/or live events. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the client will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + Only the last 1000 log events are returned. You can use filters to further limit + the number of events returned. + + #### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If you would + like to use multiple filters, pass multiple flags (e.g., + `--filter "foo=bar" --filter "bif=baz"`) + + Using the same filter multiple times will be handled as a *OR*; for example + `--filter container=588a23dac085 --filter container=a8f7720b8c22` will display + events for container 588a23dac085 *OR* container a8f7720b8c22 + + Using multiple filters will be handled as a *AND*; for example + `--filter container=588a23dac085 --filter event=start` will display events for + container container 588a23dac085 *AND* the event type is *start* + + The currently supported filters are: + + * config (`config=`) + * container (`container=`) + * daemon (`daemon=`) + * event (`event=`) + * image (`image=`) + * label (`label=` or `label==`) + * network (`network=`) + * node (`node=`) + * plugin (`plugin=`) + * scope (`scope=`) + * secret (`secret=`) + * service (`service=`) + * type (`type=`) + * volume (`volume=`) + + #### Format + + If a format (`--format`) is specified, the given template will be executed + instead of the default + format. Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. + + If a format is set to `{{json .}}`, the events are streamed as valid JSON + Lines. For information about JSON Lines, please refer to http://jsonlines.org/. +usage: docker events [OPTIONS] +pname: docker +plink: docker.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: since + value_type: string + description: Show all events created since timestamp + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: until + value_type: string + description: Stream events until this timestamp + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Basic example + + You'll need two shells for this example. + + **Shell 1: Listening for events:** + + ```bash + $ docker events + ``` + + **Shell 2: Start and Stop containers:** + + ```bash + $ docker create --name test alpine:latest top + $ docker start test + $ docker stop test + ``` + + **Shell 1: (Again .. now showing events):** + + ```console + 2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + ``` + + To exit the `docker events` command, use `CTRL+C`. + + ### Filter events by time + + You can filter the output by an absolute timestamp or relative time on the host + machine, using the following different time syntaxes: + + ```bash + $ docker events --since 1483283804 + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --since '2017-01-05' + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --since '2013-09-03T15:49:29' + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --since '10m' + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --since '2017-01-05T00:35:30' --until '2017-01-05T00:36:05' + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + ``` + + ### Filter events by criteria + + The following commands show several different ways to filter the `docker event` + output. + + ```bash + $ docker events --filter 'event=stop' + + 2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain) + + $ docker events --filter 'image=alpine' + + 2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15) + 2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9) + 2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner) + 2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner) + + $ docker events --filter 'container=test' + + 2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8' + + 2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9) + 2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test) + 2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker events --filter 'container=test' --filter 'event=stop' + + 2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test) + + $ docker events --filter 'type=volume' + + 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) + 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate) + 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local) + 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) + + $ docker events --filter 'type=network' + + 2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge) + 2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge) + + $ docker events --filter 'container=container_1' --filter 'container=container_2' + + 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) + 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) + 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) + 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) + + $ docker events --filter 'type=volume' + + 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) + 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) + 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) + 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) + + $ docker events --filter 'type=network' + + 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) + 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) + + $ docker events --filter 'type=plugin' + + 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) + 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) + + $ docker events -f type=service + + 2017-07-12T06:34:07.999446625Z service create wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) + 2017-07-12T06:34:21.405496207Z service remove wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) + + $ docker events -f type=node + + 2017-07-12T06:21:51.951586759Z node update 3xyz5ttp1a253q74z1thwywk9 (name=ip-172-31-23-42, state.new=ready, state.old=unknown) + + $ docker events -f type=secret + + 2017-07-12T06:32:13.915704367Z secret create s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) + 2017-07-12T06:32:37.052647783Z secret remove s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) + + $ docker events -f type=config + 2017-07-12T06:44:13.349037127Z config create u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) + 2017-07-12T06:44:36.327694184Z config remove u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) + + $ docker events --filter 'scope=swarm' + + 2017-07-10T07:46:50.250024503Z service create m8qcxu8081woyof7w3jaax6gk (name=affectionate_wilson) + 2017-07-10T07:47:31.093797134Z secret create 6g5pufzsv438p9tbvl9j94od4 (name=new_secret) + ``` + + ### Format the output + + ```bash + $ docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' + + Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + ``` + + #### Format as JSON + + ```bash + $ docker events --format '{{json .}}' + + {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + {"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e.. + {"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42.. + {"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_exec.yaml b/_data/engine-cli/docker_exec.yaml new file mode 100644 index 0000000..b845ceb --- /dev/null +++ b/_data/engine-cli/docker_exec.yaml @@ -0,0 +1,176 @@ +command: docker exec +short: Run a command in a running container +long: |- + The `docker exec` command runs a new command in a running container. + + The command started using `docker exec` only runs while the container's primary + process (`PID 1`) is running, and it is not restarted if the container is + restarted. + + COMMAND will run in the default directory of the container. If the + underlying image has a custom directory specified with the WORKDIR directive + in its Dockerfile, this will be used instead. + + COMMAND should be an executable, a chained or a quoted command + will not work. Example: `docker exec -ti my_container "echo a && echo b"` will + not work, but `docker exec -ti my_container sh -c "echo a && echo b"` will. +usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] +pname: docker +plink: docker.yaml +options: +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: 'Detached mode: run command in the background' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to the command + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Run `docker exec` on a running container + + First, start a container. + + ```bash + $ docker run --name ubuntu_bash --rm -i -t ubuntu bash + ``` + + This will create a container named `ubuntu_bash` and start a Bash session. + + Next, execute a command on the container. + + ```bash + $ docker exec -d ubuntu_bash touch /tmp/execWorks + ``` + + This will create a new file `/tmp/execWorks` inside the running container + `ubuntu_bash`, in the background. + + Next, execute an interactive `bash` shell on the container. + + ```bash + $ docker exec -it ubuntu_bash bash + ``` + + This will create a new Bash session in the container `ubuntu_bash`. + + Next, set an environment variable in the current bash session. + + ```bash + $ docker exec -it -e VAR=1 ubuntu_bash bash + ``` + + This will create a new Bash session in the container `ubuntu_bash` with environment + variable `$VAR` set to "1". Note that this environment variable will only be valid + on the current Bash session. + + By default `docker exec` command runs in the same working directory set when container was created. + + ```bash + $ docker exec -it ubuntu_bash pwd + / + ``` + + You can select working directory for the command to execute into + + ```bash + $ docker exec -it -w /root ubuntu_bash pwd + /root + ``` + + + ### Try to run `docker exec` on a paused container + + If the container is paused, then the `docker exec` command will fail with an error: + + ```bash + $ docker pause test + + test + + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 1ae3b36715d2 ubuntu:latest "bash" 17 seconds ago Up 16 seconds (Paused) test + + $ docker exec test ls + + FATA[0000] Error response from daemon: Container test is paused, unpause the container before exec + + $ echo $? + 1 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_export.yaml b/_data/engine-cli/docker_export.yaml new file mode 100644 index 0000000..b75e3d5 --- /dev/null +++ b/_data/engine-cli/docker_export.yaml @@ -0,0 +1,39 @@ +command: docker export +short: Export a container's filesystem as a tar archive +long: |- + The `docker export` command does not export the contents of volumes associated + with the container. If a volume is mounted on top of an existing directory in + the container, `docker export` will export the contents of the *underlying* + directory, not the contents of the volume. + + Refer to [Backup, restore, or migrate data volumes](https://docs.docker.com/v17.03/engine/tutorials/dockervolumes/#backup-restore-or-migrate-data-volumes) + in the user guide for examples on exporting data in a volume. +usage: docker export [OPTIONS] CONTAINER +pname: docker +plink: docker.yaml +options: +- option: output + shorthand: o + value_type: string + description: Write to a file, instead of STDOUT + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Each of these commands has the same result. + + ```bash + $ docker export red_panda > latest.tar + ``` + + ```bash + $ docker export --output="latest.tar" red_panda + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_history.yaml b/_data/engine-cli/docker_history.yaml new file mode 100644 index 0000000..13fc6d0 --- /dev/null +++ b/_data/engine-cli/docker_history.yaml @@ -0,0 +1,106 @@ +command: docker history +short: Show the history of an image +long: Show the history of an image +usage: docker history [OPTIONS] IMAGE +pname: docker +plink: docker.yaml +options: +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: human + shorthand: H + value_type: bool + default_value: "true" + description: Print sizes and dates in human readable format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + To see how the `docker:latest` image was built: + + ```bash + $ docker history docker + + IMAGE CREATED CREATED BY SIZE COMMENT + 3e23a5875458 8 days ago /bin/sh -c #(nop) ENV LC_ALL=C.UTF-8 0 B + 8578938dd170 8 days ago /bin/sh -c dpkg-reconfigure locales && loc 1.245 MB + be51b77efb42 8 days ago /bin/sh -c apt-get update && apt-get install 338.3 MB + 4b137612be55 6 weeks ago /bin/sh -c #(nop) ADD jessie.tar.xz in / 121 MB + 750d58736b4b 6 weeks ago /bin/sh -c #(nop) MAINTAINER Tianon Gravi : 4 weeks ago + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image.yaml b/_data/engine-cli/docker_image.yaml new file mode 100644 index 0000000..c094b25 --- /dev/null +++ b/_data/engine-cli/docker_image.yaml @@ -0,0 +1,38 @@ +command: docker image +short: Manage images +long: Manage images. +usage: docker image +pname: docker +plink: docker.yaml +cname: +- docker image build +- docker image history +- docker image import +- docker image inspect +- docker image load +- docker image ls +- docker image prune +- docker image pull +- docker image push +- docker image rm +- docker image save +- docker image tag +clink: +- docker_image_build.yaml +- docker_image_history.yaml +- docker_image_import.yaml +- docker_image_inspect.yaml +- docker_image_load.yaml +- docker_image_ls.yaml +- docker_image_prune.yaml +- docker_image_pull.yaml +- docker_image_push.yaml +- docker_image_rm.yaml +- docker_image_save.yaml +- docker_image_tag.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_build.yaml b/_data/engine-cli/docker_image_build.yaml new file mode 100644 index 0000000..647384b --- /dev/null +++ b/_data/engine-cli/docker_image_build.yaml @@ -0,0 +1,334 @@ +command: docker image build +short: Build an image from a Dockerfile +long: Build an image from a Dockerfile +usage: docker image build [OPTIONS] PATH | URL | - +pname: docker image +plink: docker_image.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: build-arg + value_type: list + description: Set build-time variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cache-from + value_type: stringSlice + default_value: '[]' + description: Images to consider as cache sources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: compress + value_type: bool + default_value: "false" + description: Compress the build context using gzip + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit the CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: file + shorthand: f + value_type: string + description: Name of the Dockerfile (Default is 'PATH/Dockerfile') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force-rm + value_type: bool + default_value: "false" + description: Always remove intermediate containers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: iidfile + value_type: string + description: Write the image ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: list + description: Set metadata for an image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: string + default_value: default + description: | + Set the networking mode for the RUN instructions during build + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-cache + value_type: bool + default_value: "false" + description: Do not use cache when building the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: output + shorthand: o + value_type: stringArray + default_value: '[]' + description: 'Output destination (format: type=local,dest=path)' + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.38" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: progress + value_type: string + default_value: auto + description: | + Set type of progress output (auto, plain, tty). Use plain to show container output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pull + value_type: bool + default_value: "false" + description: Always attempt to pull a newer version of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the build output and print image ID on success + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "true" + description: Remove intermediate containers after a successful build + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret + value_type: stringArray + default_value: '[]' + description: | + Secret file to expose to the build (only if BuildKit enabled): id=mysecret,src=/local/secret + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: stringSlice + default_value: '[]' + description: Security options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: squash + value_type: bool + default_value: "false" + description: Squash newly built layers into a single new layer + deprecated: false + min_api_version: "1.25" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: ssh + value_type: stringArray + default_value: '[]' + description: | + SSH agent socket or keys to expose to the build (only if BuildKit enabled) (format: default|[=|[,]]) + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stream + value_type: bool + default_value: "false" + description: Stream attaches to server to negotiate build context + deprecated: false + min_api_version: "1.31" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: tag + shorthand: t + value_type: list + description: Name and optionally a tag in the 'name:tag' format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: target + value_type: string + description: Set the target build stage to build. + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_history.yaml b/_data/engine-cli/docker_image_history.yaml new file mode 100644 index 0000000..265accf --- /dev/null +++ b/_data/engine-cli/docker_image_history.yaml @@ -0,0 +1,50 @@ +command: docker image history +short: Show the history of an image +long: Show the history of an image +usage: docker image history [OPTIONS] IMAGE +pname: docker image +plink: docker_image.yaml +options: +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: human + shorthand: H + value_type: bool + default_value: "true" + description: Print sizes and dates in human readable format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_import.yaml b/_data/engine-cli/docker_image_import.yaml new file mode 100644 index 0000000..b2a6656 --- /dev/null +++ b/_data/engine-cli/docker_image_import.yaml @@ -0,0 +1,40 @@ +command: docker image import +short: Import the contents from a tarball to create a filesystem image +long: Import the contents from a tarball to create a filesystem image +usage: docker image import [OPTIONS] file|URL|- [REPOSITORY[:TAG]] +pname: docker image +plink: docker_image.yaml +options: +- option: change + shorthand: c + value_type: list + description: Apply Dockerfile instruction to the created image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: message + shorthand: m + value_type: string + description: Set commit message for imported image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_inspect.yaml b/_data/engine-cli/docker_image_inspect.yaml new file mode 100644 index 0000000..e795731 --- /dev/null +++ b/_data/engine-cli/docker_image_inspect.yaml @@ -0,0 +1,22 @@ +command: docker image inspect +short: Display detailed information on one or more images +long: Display detailed information on one or more images +usage: docker image inspect [OPTIONS] IMAGE [IMAGE...] +pname: docker image +plink: docker_image.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_load.yaml b/_data/engine-cli/docker_image_load.yaml new file mode 100644 index 0000000..61d47da --- /dev/null +++ b/_data/engine-cli/docker_image_load.yaml @@ -0,0 +1,32 @@ +command: docker image load +short: Load an image from a tar archive or STDIN +long: Load an image from a tar archive or STDIN +usage: docker image load [OPTIONS] +pname: docker image +plink: docker_image.yaml +options: +- option: input + shorthand: i + value_type: string + description: Read from tar archive file, instead of STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the load output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_ls.yaml b/_data/engine-cli/docker_image_ls.yaml new file mode 100644 index 0000000..0e341e8 --- /dev/null +++ b/_data/engine-cli/docker_image_ls.yaml @@ -0,0 +1,69 @@ +command: docker image ls +aliases: images, list +short: List images +long: List images +usage: docker image ls [OPTIONS] [REPOSITORY[:TAG]] +pname: docker image +plink: docker_image.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all images (default hides intermediate images) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: digests + value_type: bool + default_value: "false" + description: Show digests + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_prune.yaml b/_data/engine-cli/docker_image_prune.yaml new file mode 100644 index 0000000..cb717a3 --- /dev/null +++ b/_data/engine-cli/docker_image_prune.yaml @@ -0,0 +1,216 @@ +command: docker image prune +short: Remove unused images +long: Remove all dangling images. If `-a` is specified, will also remove all images + not referenced by any container. +usage: docker image prune [OPTIONS] +pname: docker image +plink: docker_image.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Remove all unused images, not just dangling ones + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + value_type: filter + description: Provide filter values (e.g. 'until=') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Example output: + + ```bash + $ docker image prune -a + + WARNING! This will remove all images without at least one container associated to them. + Are you sure you want to continue? [y/N] y + Deleted Images: + untagged: alpine:latest + untagged: alpine@sha256:3dcdb92d7432d56604d4545cbd324b14e647b313626d99b889d0626de158f73a + deleted: sha256:4e38e38c8ce0b8d9041a9c4fefe786631d1416225e13b0bfe8cfa2321aec4bba + deleted: sha256:4fe15f8d0ae69e169824f25f1d4da3015a48feeeeebb265cd2e328e15c6a869f + untagged: alpine:3.3 + untagged: alpine@sha256:4fa633f4feff6a8f02acfc7424efd5cb3e76686ed3218abf4ca0fa4a2a358423 + untagged: my-jq:latest + deleted: sha256:ae67841be6d008a374eff7c2a974cde3934ffe9536a7dc7ce589585eddd83aff + deleted: sha256:34f6f1261650bc341eb122313372adc4512b4fceddc2a7ecbb84f0958ce5ad65 + deleted: sha256:cf4194e8d8db1cb2d117df33f2c75c0369c3a26d96725efb978cc69e046b87e7 + untagged: my-curl:latest + deleted: sha256:b2789dd875bf427de7f9f6ae001940073b3201409b14aba7e5db71f408b8569e + deleted: sha256:96daac0cb203226438989926fc34dd024f365a9a8616b93e168d303cfe4cb5e9 + deleted: sha256:5cbd97a14241c9cd83250d6b6fc0649833c4a3e84099b968dd4ba403e609945e + deleted: sha256:a0971c4015c1e898c60bf95781c6730a05b5d8a2ae6827f53837e6c9d38efdec + deleted: sha256:d8359ca3b681cc5396a4e790088441673ed3ce90ebc04de388bfcd31a0716b06 + deleted: sha256:83fc9ba8fb70e1da31dfcc3c88d093831dbd4be38b34af998df37e8ac538260c + deleted: sha256:ae7041a4cc625a9c8e6955452f7afe602b401f662671cea3613f08f3d9343b35 + deleted: sha256:35e0f43a37755b832f0bbea91a2360b025ee351d7309dae0d9737bc96b6d0809 + deleted: sha256:0af941dd29f00e4510195dd00b19671bc591e29d1495630e7e0f7c44c1e6a8c0 + deleted: sha256:9fc896fc2013da84f84e45b3096053eb084417b42e6b35ea0cce5a3529705eac + deleted: sha256:47cf20d8c26c46fff71be614d9f54997edacfe8d46d51769706e5aba94b16f2b + deleted: sha256:2c675ee9ed53425e31a13e3390bf3f539bf8637000e4bcfbb85ee03ef4d910a1 + + Total reclaimed space: 16.43 MB + ``` + + ### Filtering + + The filtering flag (`--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * until (``) - only remove images created before given timestamp + * label (`label=`, `label==`, `label!=`, or `label!==`) - only remove images with (or without, in case `label!=...` is used) the specified labels. + + The `until` filter can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the daemon machine’s time. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the daemon will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), + which removes images with the specified labels. The other + format is the `label!=...` (`label!=` or `label!==`), which removes + images without the specified labels. + + > **Predicting what will be removed** + > + > If you are using positive filtering (testing for the existence of a label or + > that a label has a specific value), you can use `docker image ls` with the + > same filtering syntax to see which images match your filter. + > + > However, if you are using negative filtering (testing for the absence of a + > label or that a label does *not* have a specific value), this type of filter + > does not work with `docker image ls` so you cannot easily predict which images + > will be removed. In addition, the confirmation prompt for `docker image prune` + > always warns that *all* dangling images will be removed, even if you are using + > `--filter`. + + The following removes images created before `2017-01-04T00:00:00`: + + ```bash + $ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}' + REPOSITORY TAG IMAGE ID CREATED AT SIZE + foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB + alpine latest 88e169ea8f46 2016-12-27 10:17:25 -0800 PST 3.98 MB + busybox latest e02e811dd08f 2016-10-07 14:03:58 -0700 PDT 1.09 MB + + $ docker image prune -a --force --filter "until=2017-01-04T00:00:00" + + Deleted Images: + untagged: alpine:latest + untagged: alpine@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8 + untagged: busybox:latest + untagged: busybox@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912 + deleted: sha256:e02e811dd08fd49e7f6032625495118e63f597eb150403d02e3238af1df240ba + deleted: sha256:e88b3f82283bc59d5e0df427c824e9f95557e661fcb0ea15fb0fb6f97760f9d9 + + Total reclaimed space: 1.093 MB + + $ docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedAt}}\t{{.Size}}' + + REPOSITORY TAG IMAGE ID CREATED AT SIZE + foo latest 2f287ac753da 2017-01-04 13:42:23 -0800 PST 3.98 MB + ``` + + The following removes images created more than 10 days (`240h`) ago: + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + foo latest 2f287ac753da 14 seconds ago 3.98 MB + alpine latest 88e169ea8f46 8 days ago 3.98 MB + debian jessie 7b0a06c805e8 2 months ago 123 MB + busybox latest e02e811dd08f 2 months ago 1.09 MB + golang 1.7.0 138c2e655421 4 months ago 670 MB + + $ docker image prune -a --force --filter "until=240h" + + Deleted Images: + untagged: golang:1.7.0 + untagged: golang@sha256:6765038c2b8f407fd6e3ecea043b44580c229ccfa2a13f6d85866cf2b4a9628e + deleted: sha256:138c2e6554219de65614d88c15521bfb2da674cbb0bf840de161f89ff4264b96 + deleted: sha256:ec353c2e1a673f456c4b78906d0d77f9d9456cfb5229b78c6a960bfb7496b76a + deleted: sha256:fe22765feaf3907526b4921c73ea6643ff9e334497c9b7e177972cf22f68ee93 + deleted: sha256:ff845959c80148421a5c3ae11cc0e6c115f950c89bc949646be55ed18d6a2912 + deleted: sha256:a4320831346648c03db64149eafc83092e2b34ab50ca6e8c13112388f25899a7 + deleted: sha256:4c76020202ee1d9709e703b7c6de367b325139e74eebd6b55b30a63c196abaf3 + deleted: sha256:d7afd92fb07236c8a2045715a86b7d5f0066cef025018cd3ca9a45498c51d1d6 + deleted: sha256:9e63c5bce4585dd7038d830a1f1f4e44cb1a1515b00e620ac718e934b484c938 + untagged: debian:jessie + untagged: debian@sha256:c1af755d300d0c65bb1194d24bce561d70c98a54fb5ce5b1693beb4f7988272f + deleted: sha256:7b0a06c805e8f23807fb8856621c60851727e85c7bcb751012c813f122734c8d + deleted: sha256:f96222d75c5563900bc4dd852179b720a0885de8f7a0619ba0ac76e92542bbc8 + + Total reclaimed space: 792.6 MB + + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + foo latest 2f287ac753da About a minute ago 3.98 MB + alpine latest 88e169ea8f46 8 days ago 3.98 MB + busybox latest e02e811dd08f 2 months ago 1.09 MB + ``` + + The following example removes images with the label `deprecated`: + + ```bash + $ docker image prune --filter="label=deprecated" + ``` + + The following example removes images with the label `maintainer` set to `john`: + + ```bash + $ docker image prune --filter="label=maintainer=john" + ``` + + This example removes images which have no `maintainer` label: + + ```bash + $ docker image prune --filter="label!=maintainer" + ``` + + This example removes images which have a maintainer label not set to `john`: + + ```bash + $ docker image prune --filter="label!=maintainer=john" + ``` + + > **Note** + > + > You are prompted for confirmation before the `prune` removes + > anything, but you are not shown a list of what will potentially be removed. + > In addition, `docker image ls` does not support negative filtering, so it + > difficult to predict what images will actually be removed. +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_pull.yaml b/_data/engine-cli/docker_image_pull.yaml new file mode 100644 index 0000000..8e8b675 --- /dev/null +++ b/_data/engine-cli/docker_image_pull.yaml @@ -0,0 +1,51 @@ +command: docker image pull +short: Pull an image or a repository from a registry +long: Pull an image or a repository from a registry +usage: docker image pull [OPTIONS] NAME[:TAG|@DIGEST] +pname: docker image +plink: docker_image.yaml +options: +- option: all-tags + shorthand: a + value_type: bool + default_value: "false" + description: Download all tagged images in the repository + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress verbose output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_push.yaml b/_data/engine-cli/docker_image_push.yaml new file mode 100644 index 0000000..b4f5f22 --- /dev/null +++ b/_data/engine-cli/docker_image_push.yaml @@ -0,0 +1,22 @@ +command: docker image push +short: Push an image or a repository to a registry +long: Push an image or a repository to a registry +usage: docker image push [OPTIONS] NAME[:TAG] +pname: docker image +plink: docker_image.yaml +options: +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image signing + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_rm.yaml b/_data/engine-cli/docker_image_rm.yaml new file mode 100644 index 0000000..c60a498 --- /dev/null +++ b/_data/engine-cli/docker_image_rm.yaml @@ -0,0 +1,33 @@ +command: docker image rm +aliases: rmi, remove +short: Remove one or more images +long: Remove one or more images +usage: docker image rm [OPTIONS] IMAGE [IMAGE...] +pname: docker image +plink: docker_image.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force removal of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-prune + value_type: bool + default_value: "false" + description: Do not delete untagged parents + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_save.yaml b/_data/engine-cli/docker_image_save.yaml new file mode 100644 index 0000000..1fbdbb1 --- /dev/null +++ b/_data/engine-cli/docker_image_save.yaml @@ -0,0 +1,22 @@ +command: docker image save +short: Save one or more images to a tar archive (streamed to STDOUT by default) +long: Save one or more images to a tar archive (streamed to STDOUT by default) +usage: docker image save [OPTIONS] IMAGE [IMAGE...] +pname: docker image +plink: docker_image.yaml +options: +- option: output + shorthand: o + value_type: string + description: Write to a file, instead of STDOUT + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_image_tag.yaml b/_data/engine-cli/docker_image_tag.yaml new file mode 100644 index 0000000..3830ef1 --- /dev/null +++ b/_data/engine-cli/docker_image_tag.yaml @@ -0,0 +1,12 @@ +command: docker image tag +short: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE +long: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE +usage: docker image tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG] +pname: docker image +plink: docker_image.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_images.yaml b/_data/engine-cli/docker_images.yaml new file mode 100644 index 0000000..76d8eac --- /dev/null +++ b/_data/engine-cli/docker_images.yaml @@ -0,0 +1,379 @@ +command: docker images +short: List images +long: |- + The default `docker images` will show all top level + images, their repository and tags, and their size. + + Docker images have intermediate layers that increase reusability, + decrease disk usage, and speed up `docker build` by + allowing each step to be cached. These intermediate layers are not shown + by default. + + The `SIZE` is the cumulative space taken up by the image and all + its parent images. This is also the disk space used by the contents of the + Tar file created when you `docker save` an image. + + An image will be listed more than once if it has multiple repository names + or tags. This single image (identifiable by its matching `IMAGE ID`) + uses up the `SIZE` listed only once. +usage: docker images [OPTIONS] [REPOSITORY[:TAG]] +pname: docker +plink: docker.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all images (default hides intermediate images) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: digests + value_type: bool + default_value: "false" + description: Show digests + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only show numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### List the most recently created images + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + 77af4d6b9913 19 hours ago 1.089 GB + committ latest b6fa739cedf5 19 hours ago 1.089 GB + 78a85c484f71 19 hours ago 1.089 GB + docker latest 30557a29d5ab 20 hours ago 1.089 GB + 5ed6274db6ce 24 hours ago 1.089 GB + postgres 9 746b819f315e 4 days ago 213.4 MB + postgres 9.3 746b819f315e 4 days ago 213.4 MB + postgres 9.3.5 746b819f315e 4 days ago 213.4 MB + postgres latest 746b819f315e 4 days ago 213.4 MB + ``` + + ### List images by name and tag + + The `docker images` command takes an optional `[REPOSITORY[:TAG]]` argument + that restricts the list to images that match the argument. If you specify + `REPOSITORY`but no `TAG`, the `docker images` command lists all images in the + given repository. + + For example, to list all images in the "java" repository, run this command : + + ```bash + $ docker images java + + REPOSITORY TAG IMAGE ID CREATED SIZE + java 8 308e519aac60 6 days ago 824.5 MB + java 7 493d82594c15 3 months ago 656.3 MB + java latest 2711b1d6f3aa 5 months ago 603.9 MB + ``` + + The `[REPOSITORY[:TAG]]` value must be an "exact match". This means that, for example, + `docker images jav` does not match the image `java`. + + If both `REPOSITORY` and `TAG` are provided, only images matching that + repository and tag are listed. To find all local images in the "java" + repository with tag "8" you can use: + + ```bash + $ docker images java:8 + + REPOSITORY TAG IMAGE ID CREATED SIZE + java 8 308e519aac60 6 days ago 824.5 MB + ``` + + If nothing matches `REPOSITORY[:TAG]`, the list is empty. + + ```bash + $ docker images java:0 + + REPOSITORY TAG IMAGE ID CREATED SIZE + ``` + + ### List the full length image IDs + + ```bash + $ docker images --no-trunc + + REPOSITORY TAG IMAGE ID CREATED SIZE + sha256:77af4d6b9913e693e8d0b4b294fa62ade6054e6b2f1ffb617ac955dd63fb0182 19 hours ago 1.089 GB + committest latest sha256:b6fa739cedf5ea12a620a439402b6004d057da800f91c7524b5086a5e4749c9f 19 hours ago 1.089 GB + sha256:78a85c484f71509adeaace20e72e941f6bdd2b25b4c75da8693efd9f61a37921 19 hours ago 1.089 GB + docker latest sha256:30557a29d5abc51e5f1d5b472e79b7e296f595abcf19fe6b9199dbbc809c6ff4 20 hours ago 1.089 GB + sha256:0124422dd9f9cf7ef15c0617cda3931ee68346455441d66ab8bdc5b05e9fdce5 20 hours ago 1.089 GB + sha256:18ad6fad340262ac2a636efd98a6d1f0ea775ae3d45240d3418466495a19a81b 22 hours ago 1.082 GB + sha256:f9f1e26352f0a3ba6a0ff68167559f64f3e21ff7ada60366e2d44a04befd1d3a 23 hours ago 1.089 GB + tryout latest sha256:2629d1fa0b81b222fca63371ca16cbf6a0772d07759ff80e8d1369b926940074 23 hours ago 131.5 MB + sha256:5ed6274db6ceb2397844896966ea239290555e74ef307030ebb01ff91b1914df 24 hours ago 1.089 GB + ``` + + ### List image digests + + Images that use the v2 or later format have a content-addressable identifier + called a `digest`. As long as the input used to generate the image is + unchanged, the digest value is predictable. To list image digest values, use + the `--digests` flag: + + ```bash + $ docker images --digests + REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE + localhost:5000/test/busybox sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 4986bf8c1536 9 weeks ago 2.43 MB + ``` + + When pushing or pulling to a 2.0 registry, the `push` or `pull` command + output includes the image digest. You can `pull` using a digest value. You can + also reference by digest in `create`, `run`, and `rmi` commands, as well as the + `FROM` image reference in a Dockerfile. + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * dangling (boolean - true or false) + * label (`label=` or `label==`) + * before (`[:]`, `` or ``) - filter images created before given id or references + * since (`[:]`, `` or ``) - filter images created since given id or references + * reference (pattern of an image reference) - filter images whose reference matches the specified pattern + + #### Show untagged images (dangling) + + ```bash + $ docker images --filter "dangling=true" + + REPOSITORY TAG IMAGE ID CREATED SIZE + 8abc22fbb042 4 weeks ago 0 B + 48e5f45168b9 4 weeks ago 2.489 MB + bf747efa0e2f 4 weeks ago 0 B + 980fe10e5736 12 weeks ago 101.4 MB + dea752e4e117 12 weeks ago 101.4 MB + 511136ea3c5a 8 months ago 0 B + ``` + + This will display untagged images that are the leaves of the images tree (not + intermediary layers). These images occur when a new build of an image takes the + `repo:tag` away from the image ID, leaving it as `:` or untagged. + A warning will be issued if trying to remove an image when a container is presently + using it. By having this flag it allows for batch cleanup. + + You can use this in conjunction with `docker rmi ...`: + + ```bash + $ docker rmi $(docker images -f "dangling=true" -q) + + 8abc22fbb042 + 48e5f45168b9 + bf747efa0e2f + 980fe10e5736 + dea752e4e117 + 511136ea3c5a + ``` + + Docker warns you if any containers exist that are using these untagged images. + + + #### Show images with a given label + + The `label` filter matches images based on the presence of a `label` alone or a `label` and a + value. + + The following filter matches images with the `com.example.version` label regardless of its value. + + ```bash + $ docker images --filter "label=com.example.version" + + REPOSITORY TAG IMAGE ID CREATED SIZE + match-me-1 latest eeae25ada2aa About a minute ago 188.3 MB + match-me-2 latest dea752e4e117 About a minute ago 188.3 MB + ``` + + The following filter matches images with the `com.example.version` label with the `1.0` value. + + ```bash + $ docker images --filter "label=com.example.version=1.0" + + REPOSITORY TAG IMAGE ID CREATED SIZE + match-me latest 511136ea3c5a About a minute ago 188.3 MB + ``` + + In this example, with the `0.1` value, it returns an empty set because no matches were found. + + ```bash + $ docker images --filter "label=com.example.version=0.1" + REPOSITORY TAG IMAGE ID CREATED SIZE + ``` + + #### Filter images by time + + The `before` filter shows only images created before the image with + given id or reference. For example, having these images: + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + image1 latest eeae25ada2aa 4 minutes ago 188.3 MB + image2 latest dea752e4e117 9 minutes ago 188.3 MB + image3 latest 511136ea3c5a 25 minutes ago 188.3 MB + ``` + + Filtering with `before` would give: + + ```bash + $ docker images --filter "before=image1" + + REPOSITORY TAG IMAGE ID CREATED SIZE + image2 latest dea752e4e117 9 minutes ago 188.3 MB + image3 latest 511136ea3c5a 25 minutes ago 188.3 MB + ``` + + Filtering with `since` would give: + + ```bash + $ docker images --filter "since=image3" + REPOSITORY TAG IMAGE ID CREATED SIZE + image1 latest eeae25ada2aa 4 minutes ago 188.3 MB + image2 latest dea752e4e117 9 minutes ago 188.3 MB + ``` + + #### Filter images by reference + + The `reference` filter shows only images whose reference matches + the specified pattern. + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + busybox latest e02e811dd08f 5 weeks ago 1.09 MB + busybox uclibc e02e811dd08f 5 weeks ago 1.09 MB + busybox musl 733eb3059dce 5 weeks ago 1.21 MB + busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB + ``` + + Filtering with `reference` would give: + + ```bash + $ docker images --filter=reference='busy*:*libc' + + REPOSITORY TAG IMAGE ID CREATED SIZE + busybox uclibc e02e811dd08f 5 weeks ago 1.09 MB + busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB + ``` + + Filtering with multiple `reference` would give, either match A or B: + + ```bash + $ docker images --filter=reference='busy*:uclibc' --filter=reference='busy*:glibc' + + REPOSITORY TAG IMAGE ID CREATED SIZE + busybox uclibc e02e811dd08f 5 weeks ago 1.09 MB + busybox glibc 21c16b6787c6 5 weeks ago 4.19 MB + ``` + + ### Format the output + + The formatting option (`--format`) will pretty print container output + using a Go template. + + Valid placeholders for the Go template are listed below: + + | Placeholder | Description| + | ---- | ---- | + | `.ID` | Image ID | + | `.Repository` | Image repository | + | `.Tag` | Image tag | + | `.Digest` | Image digest | + | `.CreatedSince` | Elapsed time since the image was created | + | `.CreatedAt` | Time when the image was created | + | `.Size` | Image disk size | + + When using the `--format` option, the `image` command will either + output the data exactly as the template declares or, when using the + `table` directive, will include column headers as well. + + The following example uses a template without headers and outputs the + `ID` and `Repository` entries separated by a colon (`:`) for all images: + + ```bash + $ docker images --format "{{.ID}}: {{.Repository}}" + + 77af4d6b9913: + b6fa739cedf5: committ + 78a85c484f71: + 30557a29d5ab: docker + 5ed6274db6ce: + 746b819f315e: postgres + 746b819f315e: postgres + 746b819f315e: postgres + 746b819f315e: postgres + ``` + + To list all images with their repository and tag in a table format you + can use: + + ```bash + $ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}" + + IMAGE ID REPOSITORY TAG + 77af4d6b9913 + b6fa739cedf5 committ latest + 78a85c484f71 + 30557a29d5ab docker latest + 5ed6274db6ce + 746b819f315e postgres 9 + 746b819f315e postgres 9.3 + 746b819f315e postgres 9.3.5 + 746b819f315e postgres latest + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_import.yaml b/_data/engine-cli/docker_import.yaml new file mode 100644 index 0000000..a2e73f2 --- /dev/null +++ b/_data/engine-cli/docker_import.yaml @@ -0,0 +1,97 @@ +command: docker import +short: Import the contents from a tarball to create a filesystem image +long: |- + You can specify a `URL` or `-` (dash) to take data directly from `STDIN`. The + `URL` can point to an archive (.tar, .tar.gz, .tgz, .bzip, .tar.xz, or .txz) + containing a filesystem or to an individual file on the Docker host. If you + specify an archive, Docker untars it in the container relative to the `/` + (root). If you specify an individual file, you must specify the full path within + the host. To import from a remote location, specify a `URI` that begins with the + `http://` or `https://` protocol. + + The `--change` option will apply `Dockerfile` instructions to the image + that is created. + Supported `Dockerfile` instructions: + `CMD`|`ENTRYPOINT`|`ENV`|`EXPOSE`|`ONBUILD`|`USER`|`VOLUME`|`WORKDIR` +usage: docker import [OPTIONS] file|URL|- [REPOSITORY[:TAG]] +pname: docker +plink: docker.yaml +options: +- option: change + shorthand: c + value_type: list + description: Apply Dockerfile instruction to the created image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: message + shorthand: m + value_type: string + description: Set commit message for imported image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Import from a remote location + + This will create a new untagged image. + + ```bash + $ docker import http://example.com/exampleimage.tgz + ``` + + ### Import from a local file + + - Import to docker via pipe and `STDIN`. + + ```bash + $ cat exampleimage.tgz | docker import - exampleimagelocal:new + ``` + + - Import with a commit message. + + ```bash + $ cat exampleimage.tgz | docker import --message "New image imported from tarball" - exampleimagelocal:new + ``` + + - Import to docker from a local archive. + + ```bash + $ docker import /path/to/exampleimage.tgz + ``` + + ### Import from a local directory + + ```bash + $ sudo tar -c . | docker import - exampleimagedir + ``` + + ### Import from a local directory with new configurations + + ```bash + $ sudo tar -c . | docker import --change "ENV DEBUG=true" - exampleimagedir + ``` + + Note the `sudo` in this example – you must preserve + the ownership of the files (especially root ownership) during the + archiving with tar. If you are not root (or the sudo command) when you + tar, then the ownerships might not get preserved. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_info.yaml b/_data/engine-cli/docker_info.yaml new file mode 100644 index 0000000..f7d4805 --- /dev/null +++ b/_data/engine-cli/docker_info.yaml @@ -0,0 +1,242 @@ +command: docker info +short: Display system-wide information +long: |- + This command displays system wide information regarding the Docker installation. + Information displayed includes the kernel version, number of containers and images. + The number of images shown is the number of unique images. The same image tagged + under different names is counted only once. + + If a format is specified, the given template will be executed instead of the + default format. Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. + + Depending on the storage driver in use, additional information can be shown, such + as pool name, data file, metadata file, data space used, total data space, metadata + space used, and total metadata space. + + The data file is where the images are stored and the metadata file is where the + meta data regarding those images are stored. When run for the first time Docker + allocates a certain amount of data space and meta data space from the space + available on the volume where `/var/lib/docker` is mounted. +usage: docker info [OPTIONS] +pname: docker +plink: docker.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Show output + + The example below shows the output for a daemon running on Red Hat Enterprise Linux, + using the `devicemapper` storage driver. As can be seen in the output, additional + information about the `devicemapper` storage driver is shown: + + ```bash + $ docker info + Client: + Debug Mode: false + + Server: + Containers: 14 + Running: 3 + Paused: 1 + Stopped: 10 + Images: 52 + Server Version: 1.10.3 + Storage Driver: devicemapper + Pool Name: docker-202:2-25583803-pool + Pool Blocksize: 65.54 kB + Base Device Size: 10.74 GB + Backing Filesystem: xfs + Data file: /dev/loop0 + Metadata file: /dev/loop1 + Data Space Used: 1.68 GB + Data Space Total: 107.4 GB + Data Space Available: 7.548 GB + Metadata Space Used: 2.322 MB + Metadata Space Total: 2.147 GB + Metadata Space Available: 2.145 GB + Udev Sync Supported: true + Deferred Removal Enabled: false + Deferred Deletion Enabled: false + Deferred Deleted Device Count: 0 + Data loop file: /var/lib/docker/devicemapper/devicemapper/data + Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata + Library Version: 1.02.107-RHEL7 (2015-12-01) + Execution Driver: native-0.2 + Logging Driver: json-file + Plugins: + Volume: local + Network: null host bridge + Kernel Version: 3.10.0-327.el7.x86_64 + Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo) + OSType: linux + Architecture: x86_64 + CPUs: 1 + Total Memory: 991.7 MiB + Name: ip-172-30-0-91.ec2.internal + ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S + Docker Root Dir: /var/lib/docker + Debug Mode: false + Username: gordontheturtle + Registry: https://index.docker.io/v1/ + Insecure registries: + myinsecurehost:5000 + 127.0.0.0/8 + ``` + + ### Show debugging output + + Here is a sample output for a daemon running on Ubuntu, using the overlay2 + storage driver and a node that is part of a 2-node swarm: + + ```bash + $ docker -D info + Client: + Debug Mode: true + + Server: + Containers: 14 + Running: 3 + Paused: 1 + Stopped: 10 + Images: 52 + Server Version: 1.13.0 + Storage Driver: overlay2 + Backing Filesystem: extfs + Supports d_type: true + Native Overlay Diff: false + Logging Driver: json-file + Cgroup Driver: cgroupfs + Plugins: + Volume: local + Network: bridge host macvlan null overlay + Swarm: active + NodeID: rdjq45w1op418waxlairloqbm + Is Manager: true + ClusterID: te8kdyw33n36fqiz74bfjeixd + Managers: 1 + Nodes: 2 + Orchestration: + Task History Retention Limit: 5 + Raft: + Snapshot Interval: 10000 + Number of Old Snapshots to Retain: 0 + Heartbeat Tick: 1 + Election Tick: 3 + Dispatcher: + Heartbeat Period: 5 seconds + CA Configuration: + Expiry Duration: 3 months + Root Rotation In Progress: false + Node Address: 172.16.66.128 172.16.66.129 + Manager Addresses: + 172.16.66.128:2477 + Runtimes: runc + Default Runtime: runc + Init Binary: docker-init + containerd version: 8517738ba4b82aff5662c97ca4627e7e4d03b531 + runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2 + init version: N/A (expected: v0.13.0) + Security Options: + apparmor + seccomp + Profile: default + Kernel Version: 4.4.0-31-generic + Operating System: Ubuntu 16.04.1 LTS + OSType: linux + Architecture: x86_64 + CPUs: 2 + Total Memory: 1.937 GiB + Name: ubuntu + ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326 + Docker Root Dir: /var/lib/docker + Debug Mode: true + File Descriptors: 30 + Goroutines: 123 + System Time: 2016-11-12T17:24:37.955404361-08:00 + EventsListeners: 0 + Http Proxy: http://test:test@proxy.example.com:8080 + Https Proxy: https://test:test@proxy.example.com:8080 + No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com + Registry: https://index.docker.io/v1/ + WARNING: No swap limit support + Labels: + storage=ssd + staging=true + Experimental: false + Insecure Registries: + 127.0.0.0/8 + Registry Mirrors: + http://192.168.1.2/ + http://registry-mirror.example.com:5000/ + Live Restore Enabled: false + ``` + + The global `-D` option causes all `docker` commands to output debug information. + + ### Format the output + + You can also specify the output format: + + ```bash + $ docker info --format '{{json .}}' + + {"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...} + ``` + + ### Run `docker info` on Windows + + Here is a sample output for a daemon running on Windows Server 2016: + + ```console + E:\docker>docker info + Client: + Debug Mode: false + + Server: + Containers: 1 + Running: 0 + Paused: 0 + Stopped: 1 + Images: 17 + Server Version: 1.13.0 + Storage Driver: windowsfilter + Windows: + Logging Driver: json-file + Plugins: + Volume: local + Network: nat null overlay + Swarm: inactive + Default Isolation: process + Kernel Version: 10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937) + Operating System: Windows Server 2016 Datacenter + OSType: windows + Architecture: x86_64 + CPUs: 8 + Total Memory: 3.999 GiB + Name: WIN-V0V70C0LU5P + ID: NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62 + Docker Root Dir: C:\control + Debug Mode: false + Registry: https://index.docker.io/v1/ + Insecure Registries: + 127.0.0.0/8 + Registry Mirrors: + http://192.168.1.2/ + http://registry-mirror.example.com:5000/ + Live Restore Enabled: false + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_inspect.yaml b/_data/engine-cli/docker_inspect.yaml new file mode 100644 index 0000000..675803b --- /dev/null +++ b/_data/engine-cli/docker_inspect.yaml @@ -0,0 +1,104 @@ +command: docker inspect +short: Return low-level information on Docker objects +long: |- + Docker inspect provides detailed information on constructs controlled by Docker. + + By default, `docker inspect` will render results in a JSON array. +usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...] +pname: docker +plink: docker.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: size + shorthand: s + value_type: bool + default_value: "false" + description: Display total file sizes if the type is container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: type + value_type: string + description: Return JSON for specified type + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Get an instance's IP address + + For the most part, you can pick out any field from the JSON in a fairly + straightforward manner. + + ```bash + $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID + ``` + + ### Get an instance's MAC address + + ```bash + $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID + ``` + + ### Get an instance's log path + + ```bash + $ docker inspect --format='{{.LogPath}}' $INSTANCE_ID + ``` + + ### Get an instance's image name + + ```bash + $ docker inspect --format='{{.Config.Image}}' $INSTANCE_ID + ``` + + ### List all port bindings + + You can loop over arrays and maps in the results to produce simple text + output: + + ```bash + $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID + ``` + + ### Find a specific port mapping + + The `.Field` syntax doesn't work when the field name begins with a + number, but the template language's `index` function does. The + `.NetworkSettings.Ports` section contains a map of the internal port + mappings to a list of external address/port objects. To grab just the + numeric public port, you use `index` to find the specific port map, and + then `index` 0 contains the first object inside of that. Then we ask for + the `HostPort` field to get the public address. + + ```bash + $ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID + ``` + + ### Get a subsection in JSON format + + If you request a field which is itself a structure containing other + fields, by default you get a Go-style dump of the inner values. + Docker adds a template function, `json`, which can be applied to get + results in JSON format. + + ```bash + $ docker inspect --format='{{json .Config}}' $INSTANCE_ID + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_kill.yaml b/_data/engine-cli/docker_kill.yaml new file mode 100644 index 0000000..997dc41 --- /dev/null +++ b/_data/engine-cli/docker_kill.yaml @@ -0,0 +1,64 @@ +command: docker kill +short: Kill one or more running containers +long: |- + The `docker kill` subcommand kills one or more containers. The main process + inside the container is sent `SIGKILL` signal (default), or the signal that is + specified with the `--signal` option. You can kill a container using the + container's ID, ID-prefix, or name. + + > **Note** + > + > `ENTRYPOINT` and `CMD` in the *shell* form run as a child process of + > `/bin/sh -c`, which does not pass signals. This means that the executable is + > not the container’s PID 1 and does not receive Unix signals. +usage: docker kill [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: signal + shorthand: s + value_type: string + default_value: KILL + description: Signal to send to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Send a KILL signal to a container + + The following example sends the default `KILL` signal to the container named + `my_container`: + + ```bash + $ docker kill my_container + ``` + + ### Send a custom signal to a container + + The following example sends a `SIGHUP` signal to the container named + `my_container`: + + ```bash + $ docker kill --signal=SIGHUP my_container + ``` + + + You can specify a custom signal either by _name_, or _number_. The `SIG` prefix + is optional, so the following examples are equivalent: + + ```bash + $ docker kill --signal=SIGHUP my_container + $ docker kill --signal=HUP my_container + $ docker kill --signal=1 my_container + ``` + + Refer to the [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) + man-page for a list of standard Linux signals. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_load.yaml b/_data/engine-cli/docker_load.yaml new file mode 100644 index 0000000..6c78f49 --- /dev/null +++ b/_data/engine-cli/docker_load.yaml @@ -0,0 +1,62 @@ +command: docker load +short: Load an image from a tar archive or STDIN +long: |- + Load an image or repository from a tar archive (even if compressed with gzip, + bzip2, or xz) from a file or STDIN. It restores both images and tags. +usage: docker load [OPTIONS] +pname: docker +plink: docker.yaml +options: +- option: input + shorthand: i + value_type: string + description: Read from tar archive file, instead of STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress the load output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker image ls + + REPOSITORY TAG IMAGE ID CREATED SIZE + + $ docker load < busybox.tar.gz + + Loaded image: busybox:latest + $ docker images + REPOSITORY TAG IMAGE ID CREATED SIZE + busybox latest 769b9341d937 7 weeks ago 2.489 MB + + $ docker load --input fedora.tar + + Loaded image: fedora:rawhide + + Loaded image: fedora:20 + + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + busybox latest 769b9341d937 7 weeks ago 2.489 MB + fedora rawhide 0d20aec6529d 7 weeks ago 387 MB + fedora 20 58394af37342 7 weeks ago 385.5 MB + fedora heisenbug 58394af37342 7 weeks ago 385.5 MB + fedora latest 58394af37342 7 weeks ago 385.5 MB + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_login.yaml b/_data/engine-cli/docker_login.yaml new file mode 100644 index 0000000..b486de1 --- /dev/null +++ b/_data/engine-cli/docker_login.yaml @@ -0,0 +1,193 @@ +command: docker login +short: Log in to a Docker registry +long: Login to a registry. +usage: docker login [OPTIONS] [SERVER] +pname: docker +plink: docker.yaml +options: +- option: password + shorthand: p + value_type: string + description: Password + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: password-stdin + value_type: bool + default_value: "false" + description: Take the password from stdin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: username + shorthand: u + value_type: string + description: Username + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Login to a self-hosted registry + + If you want to login to a self-hosted registry you can specify this by + adding the server name. + + ```bash + $ docker login localhost:8080 + ``` + + ### Provide a password using STDIN + + To run the `docker login` command non-interactively, you can set the + `--password-stdin` flag to provide a password through `STDIN`. Using + `STDIN` prevents the password from ending up in the shell's history, + or log-files. + + The following example reads a password from a file, and passes it to the + `docker login` command using `STDIN`: + + ```bash + $ cat ~/my_password.txt | docker login --username foo --password-stdin + ``` + + ### Privileged user requirement + + `docker login` requires user to use `sudo` or be `root`, except when: + + 1. connecting to a remote daemon, such as a `docker-machine` provisioned `docker engine`. + 2. user is added to the `docker` group. This will impact the security of your system; the `docker` group is `root` equivalent. See [Docker Daemon Attack Surface](https://docs.docker.com/engine/security/#docker-daemon-attack-surface) for details. + + You can log into any public or private repository for which you have + credentials. When you log in, the command stores credentials in + `$HOME/.docker/config.json` on Linux or `%USERPROFILE%/.docker/config.json` on + Windows, via the procedure described below. + + ### Credentials store + + The Docker Engine can keep user credentials in an external credentials store, + such as the native keychain of the operating system. Using an external store + is more secure than storing credentials in the Docker configuration file. + + To use a credentials store, you need an external helper program to interact + with a specific keychain or external store. Docker requires the helper + program to be in the client's host `$PATH`. + + This is the list of currently available credentials helpers and where + you can download them from: + + - D-Bus Secret Service: https://github.com/docker/docker-credential-helpers/releases + - Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases + - Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases + - [pass](https://www.passwordstore.org/): https://github.com/docker/docker-credential-helpers/releases + + #### Configure the credentials store + + You need to specify the credentials store in `$HOME/.docker/config.json` + to tell the docker engine to use it. The value of the config property should be + the suffix of the program to use (i.e. everything after `docker-credential-`). + For example, to use `docker-credential-osxkeychain`: + + ```json + { + "credsStore": "osxkeychain" + } + ``` + + If you are currently logged in, run `docker logout` to remove + the credentials from the file and run `docker login` again. + + #### Default behavior + + By default, Docker looks for the native binary on each of the platforms, i.e. + "osxkeychain" on macOS, "wincred" on windows, and "pass" on Linux. A special + case is that on Linux, Docker will fall back to the "secretservice" binary if + it cannot find the "pass" binary. If none of these binaries are present, it + stores the credentials (i.e. password) in base64 encoding in the config files + described above. + + #### Credential helper protocol + + Credential helpers can be any program or script that follows a very simple protocol. + This protocol is heavily inspired by Git, but it differs in the information shared. + + The helpers always use the first argument in the command to identify the action. + There are only three possible values for that argument: `store`, `get`, and `erase`. + + The `store` command takes a JSON payload from the standard input. That payload carries + the server address, to identify the credential, the user name, and either a password + or an identity token. + + ```json + { + "ServerURL": "https://index.docker.io/v1", + "Username": "david", + "Secret": "passw0rd1" + } + ``` + + If the secret being stored is an identity token, the Username should be set to + ``. + + The `store` command can write error messages to `STDOUT` that the docker engine + will show if there was an issue. + + The `get` command takes a string payload from the standard input. That payload carries + the server address that the docker engine needs credentials for. This is + an example of that payload: `https://index.docker.io/v1`. + + The `get` command writes a JSON payload to `STDOUT`. Docker reads the user name + and password from this payload: + + ```json + { + "Username": "david", + "Secret": "passw0rd1" + } + ``` + + The `erase` command takes a string payload from `STDIN`. That payload carries + the server address that the docker engine wants to remove credentials for. This is + an example of that payload: `https://index.docker.io/v1`. + + The `erase` command can write error messages to `STDOUT` that the docker engine + will show if there was an issue. + + ### Credential helpers + + Credential helpers are similar to the credential store above, but act as the + designated programs to handle credentials for *specific registries*. The default + credential store (`credsStore` or the config file itself) will not be used for + operations concerning credentials of the specified registries. + + #### Configure credential helpers + + If you are currently logged in, run `docker logout` to remove + the credentials from the default store. + + Credential helpers are specified in a similar way to `credsStore`, but + allow for multiple helpers to be configured at a time. Keys specify the + registry domain, and values specify the suffix of the program to use + (i.e. everything after `docker-credential-`). + For example: + + ```json + { + "credHelpers": { + "registry.example.com": "registryhelper", + "awesomereg.example.org": "hip-star", + "unicorn.example.io": "vcbait" + } + } + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_logout.yaml b/_data/engine-cli/docker_logout.yaml new file mode 100644 index 0000000..2c4f41b --- /dev/null +++ b/_data/engine-cli/docker_logout.yaml @@ -0,0 +1,16 @@ +command: docker logout +short: Log out from a Docker registry +long: Log out from a Docker registry +usage: docker logout [SERVER] +pname: docker +plink: docker.yaml +examples: |- + ```bash + $ docker logout localhost:8080 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_logs.yaml b/_data/engine-cli/docker_logs.yaml new file mode 100644 index 0000000..269efd8 --- /dev/null +++ b/_data/engine-cli/docker_logs.yaml @@ -0,0 +1,121 @@ +command: docker logs +short: Fetch the logs of a container +long: |- + The `docker logs` command batch-retrieves logs present at the time of execution. + + > **Note** + > + > This command is only functional for containers that are started with the + > `json-file` or `journald` logging driver. + + For more information about selecting and configuring logging drivers, refer to + [Configure logging drivers](https://docs.docker.com/config/containers/logging/configure/). + + The `docker logs --follow` command will continue streaming the new output from + the container's `STDOUT` and `STDERR`. + + Passing a negative number or a non-integer to `--tail` is invalid and the + value is set to `all` in that case. + + The `docker logs --timestamps` command will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants) + , for example `2014-09-16T06:17:46.000000000Z`, to each + log entry. To ensure that the timestamps are aligned the + nano-second part of the timestamp will be padded with zero when necessary. + + The `docker logs --details` command will add on extra attributes, such as + environment variables and labels, provided to `--log-opt` when creating the + container. + + The `--since` option shows only the container logs generated after + a given date. You can specify the date as an RFC 3339 date, a UNIX + timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Besides RFC3339 date + format you may also use RFC3339Nano, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the client will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. You can combine the + `--since` option with either or both of the `--follow` or `--tail` options. +usage: docker logs [OPTIONS] CONTAINER +pname: docker +plink: docker.yaml +options: +- option: details + value_type: bool + default_value: "false" + description: Show extra details provided to logs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: follow + shorthand: f + value_type: bool + default_value: "false" + description: Follow log output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: since + value_type: string + description: | + Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tail + value_type: string + default_value: all + description: Number of lines to show from the end of the logs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: timestamps + shorthand: t + value_type: bool + default_value: "false" + description: Show timestamps + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: until + value_type: string + description: | + Show logs before a timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Retrieve logs until a specific point in time + + In order to retrieve logs before a specific point in time, run: + + ```bash + $ docker run --name test -d busybox sh -c "while true; do $(echo date); sleep 1; done" + $ date + Tue 14 Nov 2017 16:40:00 CET + $ docker logs -f --until=2s test + Tue 14 Nov 2017 16:40:00 CET + Tue 14 Nov 2017 16:40:01 CET + Tue 14 Nov 2017 16:40:02 CET + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_manifest.yaml b/_data/engine-cli/docker_manifest.yaml new file mode 100644 index 0000000..28453f6 --- /dev/null +++ b/_data/engine-cli/docker_manifest.yaml @@ -0,0 +1,280 @@ +command: docker manifest +short: Manage Docker image manifests and manifest lists +long: |- + The `docker manifest` command by itself performs no action. In order to operate + on a manifest or manifest list, one of the subcommands must be used. + + A single manifest is information about an image, such as layers, size, and digest. + The docker manifest command also gives users additional information such as the os + and architecture an image was built for. + + A manifest list is a list of image layers that is created by specifying one or + more (ideally more than one) image names. It can then be used in the same way as + an image name in `docker pull` and `docker run` commands, for example. + + Ideally a manifest list is created from images that are identical in function for + different os/arch combinations. For this reason, manifest lists are often referred + to as "multi-arch images". However, a user could create a manifest list that points + to two images -- one for windows on amd64, and one for darwin on amd64. + + ### manifest inspect + + ```bash + manifest inspect --help + + Usage: docker manifest inspect [OPTIONS] [MANIFEST_LIST] MANIFEST + + Display an image manifest, or manifest list + + Options: + --help Print usage + --insecure Allow communication with an insecure registry + -v, --verbose Output additional info including layers and platform + ``` + + ### manifest create + + ```bash + Usage: docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...] + + Create a local manifest list for annotating and pushing to a registry + + Options: + -a, --amend Amend an existing manifest list + --insecure Allow communication with an insecure registry + --help Print usage + ``` + + ### manifest annotate + + ```bash + Usage: docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST + + Add additional information to a local image manifest + + Options: + --arch string Set architecture + --help Print usage + --os string Set operating system + --os-features stringSlice Set operating system feature + --variant string Set architecture variant + + ``` + + ### manifest push + + ```bash + Usage: docker manifest push [OPTIONS] MANIFEST_LIST + + Push a manifest list to a repository + + Options: + --help Print usage + --insecure Allow push to an insecure registry + -p, --purge Remove the local manifest list after push + ``` + + ### Working with insecure registries + + The manifest command interacts solely with a Docker registry. Because of this, + it has no way to query the engine for the list of allowed insecure registries. + To allow the CLI to interact with an insecure registry, some `docker manifest` + commands have an `--insecure` flag. For each transaction, such as a `create`, + which queries a registry, the `--insecure` flag must be specified. This flag + tells the CLI that this registry call may ignore security concerns like missing + or self-signed certificates. Likewise, on a `manifest push` to an insecure + registry, the `--insecure` flag must be specified. If this is not used with an + insecure registry, the manifest command fails to find a registry that meets the + default requirements. +usage: docker manifest COMMAND +pname: docker +plink: docker.yaml +cname: +- docker manifest annotate +- docker manifest create +- docker manifest inspect +- docker manifest push +clink: +- docker_manifest_annotate.yaml +- docker_manifest_create.yaml +- docker_manifest_inspect.yaml +- docker_manifest_push.yaml +examples: |- + ### Inspect an image's manifest object + + ```bash + $ docker manifest inspect hello-world + { + "schemaVersion": 2, + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "config": { + "mediaType": "application/vnd.docker.container.image.v1+json", + "size": 1520, + "digest": "sha256:1815c82652c03bfd8644afda26fb184f2ed891d921b20a0703b46768f9755c57" + }, + "layers": [ + { + "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 972, + "digest": "sha256:b04784fba78d739b526e27edc02a5a8cd07b1052e9283f5fc155828f4b614c28" + } + ] + } + ``` + + ### Inspect an image's manifest and get the os/arch info + + The `docker manifest inspect` command takes an optional `--verbose` flag + that gives you the image's name (Ref), and architecture and os (Platform). + + Just as with other docker commands that take image names, you can refer to an image with or + without a tag, or by digest (e.g. `hello-world@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f`). + + Here is an example of inspecting an image's manifest with the `--verbose` flag: + + ```bash + $ docker manifest inspect --verbose hello-world + { + "Ref": "docker.io/library/hello-world:latest", + "Digest": "sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f", + "SchemaV2Manifest": { + "schemaVersion": 2, + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "config": { + "mediaType": "application/vnd.docker.container.image.v1+json", + "size": 1520, + "digest": "sha256:1815c82652c03bfd8644afda26fb184f2ed891d921b20a0703b46768f9755c57" + }, + "layers": [ + { + "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", + "size": 972, + "digest": "sha256:b04784fba78d739b526e27edc02a5a8cd07b1052e9283f5fc155828f4b614c28" + } + ] + }, + "Platform": { + "architecture": "amd64", + "os": "linux" + } + } + ``` + + ### Create and push a manifest list + + To create a manifest list, you first `create` the manifest list locally by + specifying the constituent images you would like to have included in your + manifest list. Keep in mind that this is pushed to a registry, so if you want to + push to a registry other than the docker registry, you need to create your + manifest list with the registry name or IP and port. + This is similar to tagging an image and pushing it to a foreign registry. + + After you have created your local copy of the manifest list, you may optionally + `annotate` it. Annotations allowed are the architecture and operating system + (overriding the image's current values), os features, and an architecture variant. + + Finally, you need to `push` your manifest list to the desired registry. Below are + descriptions of these three commands, and an example putting them all together. + + ```bash + $ docker manifest create 45.55.81.106:5000/coolapp:v1 \ + 45.55.81.106:5000/coolapp-ppc64le-linux:v1 \ + 45.55.81.106:5000/coolapp-arm-linux:v1 \ + 45.55.81.106:5000/coolapp-amd64-linux:v1 \ + 45.55.81.106:5000/coolapp-amd64-windows:v1 + + Created manifest list 45.55.81.106:5000/coolapp:v1 + ``` + + ```bash + $ docker manifest annotate 45.55.81.106:5000/coolapp:v1 45.55.81.106:5000/coolapp-arm-linux --arch arm + ``` + + ```bash + $ docker manifest push 45.55.81.106:5000/coolapp:v1 + Pushed manifest 45.55.81.106:5000/coolapp@sha256:9701edc932223a66e49dd6c894a11db8c2cf4eccd1414f1ec105a623bf16b426 with digest: sha256:f67dcc5fc786f04f0743abfe0ee5dae9bd8caf8efa6c8144f7f2a43889dc513b + Pushed manifest 45.55.81.106:5000/coolapp@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f with digest: sha256:b64ca0b60356a30971f098c92200b1271257f100a55b351e6bbe985638352f3a + Pushed manifest 45.55.81.106:5000/coolapp@sha256:39dc41c658cf25f33681a41310372f02728925a54aac3598310bfb1770615fc9 with digest: sha256:df436846483aff62bad830b730a0d3b77731bcf98ba5e470a8bbb8e9e346e4e8 + Pushed manifest 45.55.81.106:5000/coolapp@sha256:f91b1145cd4ac800b28122313ae9e88ac340bb3f1e3a4cd3e59a3648650f3275 with digest: sha256:5bb8e50aa2edd408bdf3ddf61efb7338ff34a07b762992c9432f1c02fc0e5e62 + sha256:050b213d49d7673ba35014f21454c573dcbec75254a08f4a7c34f66a47c06aba + + ``` + + ### Inspect a manifest list + + ```bash + $ docker manifest inspect coolapp:v1 + { + "schemaVersion": 2, + "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", + "manifests": [ + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "size": 424, + "digest": "sha256:f67dcc5fc786f04f0743abfe0ee5dae9bd8caf8efa6c8144f7f2a43889dc513b", + "platform": { + "architecture": "arm", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "size": 424, + "digest": "sha256:b64ca0b60356a30971f098c92200b1271257f100a55b351e6bbe985638352f3a", + "platform": { + "architecture": "amd64", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "size": 425, + "digest": "sha256:df436846483aff62bad830b730a0d3b77731bcf98ba5e470a8bbb8e9e346e4e8", + "platform": { + "architecture": "ppc64le", + "os": "linux" + } + }, + { + "mediaType": "application/vnd.docker.distribution.manifest.v2+json", + "size": 425, + "digest": "sha256:5bb8e50aa2edd408bdf3ddf61efb7338ff34a07b762992c9432f1c02fc0e5e62", + "platform": { + "architecture": "s390x", + "os": "linux" + } + } + ] + } + ``` + + ### Push to an insecure registry + + Here is an example of creating and pushing a manifest list using a known + insecure registry. + + ```bash + $ docker manifest create --insecure myprivateregistry.mycompany.com/repo/image:1.0 \ + myprivateregistry.mycompany.com/repo/image-linux-ppc64le:1.0 \ + myprivateregistry.mycompany.com/repo/image-linux-s390x:1.0 \ + myprivateregistry.mycompany.com/repo/image-linux-arm:1.0 \ + myprivateregistry.mycompany.com/repo/image-linux-armhf:1.0 \ + myprivateregistry.mycompany.com/repo/image-windows-amd64:1.0 \ + myprivateregistry.mycompany.com/repo/image-linux-amd64:1.0 + + $ docker manifest push --insecure myprivateregistry.mycompany.com/repo/image:tag + ``` + + > **Note** + > + > The `--insecure` flag is not required to annotate a manifest list, + > since annotations are to a locally-stored copy of a manifest list. You may also + > skip the `--insecure` flag if you are performing a `docker manifest inspect` + > on a locally-stored manifest list. Be sure to keep in mind that locally-stored + > manifest lists are never used by the engine on a `docker pull`. +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_manifest_annotate.yaml b/_data/engine-cli/docker_manifest_annotate.yaml new file mode 100644 index 0000000..c1491c2 --- /dev/null +++ b/_data/engine-cli/docker_manifest_annotate.yaml @@ -0,0 +1,46 @@ +command: docker manifest annotate +short: Add additional information to a local image manifest +long: Add additional information to a local image manifest +usage: docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST +pname: docker manifest +plink: docker_manifest.yaml +options: +- option: arch + value_type: string + description: Set architecture + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: os + value_type: string + description: Set operating system + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: os-features + value_type: stringSlice + default_value: '[]' + description: Set operating system feature + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: variant + value_type: string + description: Set architecture variant + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_manifest_create.yaml b/_data/engine-cli/docker_manifest_create.yaml new file mode 100644 index 0000000..9bee33d --- /dev/null +++ b/_data/engine-cli/docker_manifest_create.yaml @@ -0,0 +1,32 @@ +command: docker manifest create +short: Create a local manifest list for annotating and pushing to a registry +long: Create a local manifest list for annotating and pushing to a registry +usage: docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...] +pname: docker manifest +plink: docker_manifest.yaml +options: +- option: amend + shorthand: a + value_type: bool + default_value: "false" + description: Amend an existing manifest list + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: insecure + value_type: bool + default_value: "false" + description: Allow communication with an insecure registry + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_manifest_inspect.yaml b/_data/engine-cli/docker_manifest_inspect.yaml new file mode 100644 index 0000000..8da0a57 --- /dev/null +++ b/_data/engine-cli/docker_manifest_inspect.yaml @@ -0,0 +1,32 @@ +command: docker manifest inspect +short: Display an image manifest, or manifest list +long: Display an image manifest, or manifest list +usage: docker manifest inspect [OPTIONS] [MANIFEST_LIST] MANIFEST +pname: docker manifest +plink: docker_manifest.yaml +options: +- option: insecure + value_type: bool + default_value: "false" + description: Allow communication with an insecure registry + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: verbose + shorthand: v + value_type: bool + default_value: "false" + description: Output additional info including layers and platform + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_manifest_push.yaml b/_data/engine-cli/docker_manifest_push.yaml new file mode 100644 index 0000000..e286da6 --- /dev/null +++ b/_data/engine-cli/docker_manifest_push.yaml @@ -0,0 +1,32 @@ +command: docker manifest push +short: Push a manifest list to a repository +long: Push a manifest list to a repository +usage: docker manifest push [OPTIONS] MANIFEST_LIST +pname: docker manifest +plink: docker_manifest.yaml +options: +- option: insecure + value_type: bool + default_value: "false" + description: Allow push to an insecure registry + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: purge + shorthand: p + value_type: bool + default_value: "false" + description: Remove the local manifest list after push + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: true +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network.yaml b/_data/engine-cli/docker_network.yaml new file mode 100644 index 0000000..bfaa897 --- /dev/null +++ b/_data/engine-cli/docker_network.yaml @@ -0,0 +1,31 @@ +command: docker network +short: Manage networks +long: |- + Manage networks. You can use subcommands to create, inspect, list, remove, + prune, connect, and disconnect networks. +usage: docker network +pname: docker +plink: docker.yaml +cname: +- docker network connect +- docker network create +- docker network disconnect +- docker network inspect +- docker network ls +- docker network prune +- docker network rm +clink: +- docker_network_connect.yaml +- docker_network_create.yaml +- docker_network_disconnect.yaml +- docker_network_inspect.yaml +- docker_network_ls.yaml +- docker_network_prune.yaml +- docker_network_rm.yaml +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_connect.yaml b/_data/engine-cli/docker_network_connect.yaml new file mode 100644 index 0000000..b0274cd --- /dev/null +++ b/_data/engine-cli/docker_network_connect.yaml @@ -0,0 +1,136 @@ +command: docker network connect +short: Connect a container to a network +long: |- + Connects a container to a network. You can connect a container by name + or by ID. Once connected, the container can communicate with other containers in + the same network. +usage: docker network connect [OPTIONS] NETWORK CONTAINER +pname: docker network +plink: docker_network.yaml +options: +- option: alias + value_type: stringSlice + default_value: '[]' + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: driver-opt + value_type: stringSlice + default_value: '[]' + description: driver options for the network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip + value_type: string + description: IPv4 address (e.g., 172.30.100.104) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip6 + value_type: string + description: IPv6 address (e.g., 2001:db8::33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + value_type: list + description: Add link to another container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link-local-ip + value_type: stringSlice + default_value: '[]' + description: Add a link-local address for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Connect a running container to a network + + ```bash + $ docker network connect multi-host-network container1 + ``` + + ### Connect a container to a network when it starts + + You can also use the `docker run --network=` option to start a container and immediately connect it to a network. + + ```bash + $ docker run -itd --network=multi-host-network busybox + ``` + + ### Specify the IP address a container will use on a given network + + You can specify the IP address you want to be assigned to the container's interface. + + ```bash + $ docker network connect --ip 10.10.36.122 multi-host-network container2 + ``` + + ### Use the legacy `--link` option + + You can use `--link` option to link another container with a preferred alias + + ```bash + $ docker network connect --link container1:c1 multi-host-network container2 + ``` + + ### Create a network alias for a container + + `--alias` option can be used to resolve the container by another name in the network + being connected to. + + ```bash + $ docker network connect --alias db --alias mysql multi-host-network container2 + ``` + + ### Network implications of stopping, pausing, or restarting containers + + You can pause, restart, and stop containers that are connected to a network. + A container connects to its configured networks when it runs. + + If specified, the container's IP address(es) is reapplied when a stopped + container is restarted. If the IP address is no longer available, the container + fails to start. One way to guarantee that the IP address is available is + to specify an `--ip-range` when creating the network, and choose the static IP + address(es) from outside that range. This ensures that the IP address is not + given to another container while this container is not on the network. + + ```bash + $ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network + ``` + + ```bash + $ docker network connect --ip 172.20.128.2 multi-host-network container2 + ``` + + To verify the container is connected, use the `docker network inspect` command. Use `docker network disconnect` to remove a container from the network. + + Once connected in network, containers can communicate using only another + container's IP address or name. For `overlay` networks or custom plugins that + support multi-host connectivity, containers connected to the same multi-host + network but launched from different Engines can also communicate in this way. + + You can connect a container to one or more networks. The networks need not be the same type. For example, you can connect a single container bridge and overlay networks. +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_create.yaml b/_data/engine-cli/docker_network_create.yaml new file mode 100644 index 0000000..94e6248 --- /dev/null +++ b/_data/engine-cli/docker_network_create.yaml @@ -0,0 +1,345 @@ +command: docker network create +short: Create a network +long: |- + Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are the + built-in network drivers. If you have installed a third party or your own custom + network driver you can specify that `DRIVER` here also. If you don't specify the + `--driver` option, the command automatically creates a `bridge` network for you. + When you install Docker Engine it creates a `bridge` network automatically. This + network corresponds to the `docker0` bridge that Engine has traditionally relied + on. When you launch a new container with `docker run` it automatically connects to + this bridge network. You cannot remove this default bridge network, but you can + create new ones using the `network create` command. + + ```bash + $ docker network create -d bridge my-bridge-network + ``` + + Bridge networks are isolated networks on a single Engine installation. If you + want to create a network that spans multiple Docker hosts each running an + Engine, you must create an `overlay` network. Unlike `bridge` networks, overlay + networks require some pre-existing conditions before you can create one. These + conditions are: + + * Access to a key-value store. Engine supports Consul, Etcd, and ZooKeeper (Distributed store) key-value stores. + * A cluster of hosts with connectivity to the key-value store. + * A properly configured Engine `daemon` on each host in the cluster. + + The `dockerd` options that support the `overlay` network are: + + * `--cluster-store` + * `--cluster-store-opt` + * `--cluster-advertise` + + To read more about these options and how to configure them, see ["*Get started + with multi-host network*"](https://docs.docker.com/engine/userguide/networking/get-started-overlay). + + While not required, it is a good idea to install Docker Swarm to + manage the cluster that makes up your network. Swarm provides sophisticated + discovery and server management tools that can assist your implementation. + + Once you have prepared the `overlay` network prerequisites you simply choose a + Docker host in the cluster and issue the following to create the network: + + ```bash + $ docker network create -d overlay my-multihost-network + ``` + + Network names must be unique. The Docker daemon attempts to identify naming + conflicts but this is not guaranteed. It is the user's responsibility to avoid + name conflicts. + + ### Overlay network limitations + + You should create overlay networks with `/24` blocks (the default), which limits + you to 256 IP addresses, when you create networks using the default VIP-based + endpoint-mode. This recommendation addresses + [limitations with swarm mode](https://github.com/moby/moby/issues/30820). If you + need more than 256 IP addresses, do not increase the IP block size. You can + either use `dnsrr` endpoint mode with an external load balancer, or use multiple + smaller overlay networks. See + [Configure service discovery](https://docs.docker.com/engine/swarm/networking/#configure-service-discovery) + for more information about different endpoint modes. +usage: docker network create [OPTIONS] NETWORK +pname: docker network +plink: docker_network.yaml +options: +- option: attachable + value_type: bool + default_value: "false" + description: Enable manual container attachment + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: aux-address + value_type: map + default_value: map[] + description: Auxiliary IPv4 or IPv6 addresses used by Network driver + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: config-from + value_type: string + description: The network from which copying the configuration + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: config-only + value_type: bool + default_value: "false" + description: Create a configuration only network + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: driver + shorthand: d + value_type: string + default_value: bridge + description: Driver to manage the Network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: gateway + value_type: stringSlice + default_value: '[]' + description: IPv4 or IPv6 Gateway for the master subnet + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ingress + value_type: bool + default_value: "false" + description: Create swarm routing-mesh network + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: internal + value_type: bool + default_value: "false" + description: Restrict external access to the network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip-range + value_type: stringSlice + default_value: '[]' + description: Allocate container ip from a sub-range + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipam-driver + value_type: string + default_value: default + description: IP Address Management Driver + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipam-opt + value_type: map + default_value: map[] + description: Set IPAM driver specific options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipv6 + value_type: bool + default_value: "false" + description: Enable IPv6 networking + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: list + description: Set metadata on a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: opt + shorthand: o + value_type: map + default_value: map[] + description: Set driver specific options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: scope + value_type: string + description: Control the network's scope + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: subnet + value_type: stringSlice + default_value: '[]' + description: Subnet in CIDR format that represents a network segment + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Connect containers + + When you start a container, use the `--network` flag to connect it to a network. + This example adds the `busybox` container to the `mynet` network: + + ```bash + $ docker run -itd --network=mynet busybox + ``` + + If you want to add a container to a network after the container is already + running, use the `docker network connect` subcommand. + + You can connect multiple containers to the same network. Once connected, the + containers can communicate using only another container's IP address or name. + For `overlay` networks or custom plugins that support multi-host connectivity, + containers connected to the same multi-host network but launched from different + Engines can also communicate in this way. + + You can disconnect a container from a network using the `docker network + disconnect` command. + + ### Specify advanced options + + When you create a network, Engine creates a non-overlapping subnetwork for the + network by default. This subnetwork is not a subdivision of an existing + network. It is purely for ip-addressing purposes. You can override this default + and specify subnetwork values directly using the `--subnet` option. On a + `bridge` network you can only create a single subnet: + + ```bash + $ docker network create --driver=bridge --subnet=192.168.0.0/16 br0 + ``` + + Additionally, you also specify the `--gateway` `--ip-range` and `--aux-address` + options. + + ```bash + $ docker network create \ + --driver=bridge \ + --subnet=172.28.0.0/16 \ + --ip-range=172.28.5.0/24 \ + --gateway=172.28.5.254 \ + br0 + ``` + + If you omit the `--gateway` flag the Engine selects one for you from inside a + preferred pool. For `overlay` networks and for network driver plugins that + support it you can create multiple subnetworks. This example uses two `/25` + subnet mask to adhere to the current guidance of not having more than 256 IPs in + a single overlay network. Each of the subnetworks has 126 usable addresses. + + ```bash + $ docker network create -d overlay \ + --subnet=192.168.10.0/25 \ + --subnet=192.168.20.0/25 \ + --gateway=192.168.10.100 \ + --gateway=192.168.20.100 \ + --aux-address="my-router=192.168.10.5" --aux-address="my-switch=192.168.10.6" \ + --aux-address="my-printer=192.168.20.5" --aux-address="my-nas=192.168.20.6" \ + my-multihost-network + ``` + + Be sure that your subnetworks do not overlap. If they do, the network create + fails and Engine returns an error. + + ### Bridge driver options + + When creating a custom network, the default network driver (i.e. `bridge`) has + additional options that can be passed. The following are those options and the + equivalent docker daemon flags used for docker0 bridge: + + | Option | Equivalent | Description | + |--------------------------------------------------|-------------|-------------------------------------------------------| + | `com.docker.network.bridge.name` | - | Bridge name to be used when creating the Linux bridge | + | `com.docker.network.bridge.enable_ip_masquerade` | `--ip-masq` | Enable IP masquerading | + | `com.docker.network.bridge.enable_icc` | `--icc` | Enable or Disable Inter Container Connectivity | + | `com.docker.network.bridge.host_binding_ipv4` | `--ip` | Default IP when binding container ports | + | `com.docker.network.driver.mtu` | `--mtu` | Set the containers network MTU | + | `com.docker.network.container_interface_prefix` | - | Set a custom prefix for container interfaces | + + The following arguments can be passed to `docker network create` for any + network driver, again with their approximate equivalents to `docker daemon`. + + | Argument | Equivalent | Description | + |--------------|----------------|--------------------------------------------| + | `--gateway` | - | IPv4 or IPv6 Gateway for the master subnet | + | `--ip-range` | `--fixed-cidr` | Allocate IPs from a range | + | `--internal` | - | Restrict external access to the network | + | `--ipv6` | `--ipv6` | Enable IPv6 networking | + | `--subnet` | `--bip` | Subnet for network | + + For example, let's use `-o` or `--opt` options to specify an IP address binding + when publishing ports: + + ```bash + $ docker network create \ + -o "com.docker.network.bridge.host_binding_ipv4"="172.19.0.1" \ + simple-network + ``` + + ### Network internal mode + + By default, when you connect a container to an `overlay` network, Docker also + connects a bridge network to it to provide external connectivity. If you want + to create an externally isolated `overlay` network, you can specify the + `--internal` option. + + ### Network ingress mode + + You can create the network which will be used to provide the routing-mesh in the + swarm cluster. You do so by specifying `--ingress` when creating the network. Only + one ingress network can be created at the time. The network can be removed only + if no services depend on it. Any option available when creating an overlay network + is also available when creating the ingress network, besides the `--attachable` option. + + ```bash + $ docker network create -d overlay \ + --subnet=10.11.0.0/16 \ + --ingress \ + --opt com.docker.network.driver.mtu=9216 \ + --opt encrypted=true \ + my-ingress-network + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_disconnect.yaml b/_data/engine-cli/docker_network_disconnect.yaml new file mode 100644 index 0000000..562069a --- /dev/null +++ b/_data/engine-cli/docker_network_disconnect.yaml @@ -0,0 +1,30 @@ +command: docker network disconnect +short: Disconnect a container from a network +long: |- + Disconnects a container from a network. The container must be running to + disconnect it from the network. +usage: docker network disconnect [OPTIONS] NETWORK CONTAINER +pname: docker network +plink: docker_network.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the container to disconnect from a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker network disconnect multi-host-network container1 + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_inspect.yaml b/_data/engine-cli/docker_network_inspect.yaml new file mode 100644 index 0000000..8c83d19 --- /dev/null +++ b/_data/engine-cli/docker_network_inspect.yaml @@ -0,0 +1,35 @@ +command: docker network inspect +short: Display detailed information on one or more networks +long: |- + Returns information about one or more networks. By default, this command renders + all results in a JSON object. +usage: docker network inspect [OPTIONS] NETWORK [NETWORK...] +pname: docker network +plink: docker_network.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: verbose + shorthand: v + value_type: bool + default_value: "false" + description: Verbose output for diagnostics + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_ls.yaml b/_data/engine-cli/docker_network_ls.yaml new file mode 100644 index 0000000..d3d9a19 --- /dev/null +++ b/_data/engine-cli/docker_network_ls.yaml @@ -0,0 +1,254 @@ +command: docker network ls +aliases: list +short: List networks +long: |- + Lists all the networks the Engine `daemon` knows about. This includes the + networks that span across multiple hosts in a cluster. +usage: docker network ls [OPTIONS] +pname: docker network +plink: docker_network.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Provide filter values (e.g. 'driver=bridge') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print networks using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate the output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display network IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### List all networks + + ```bash + $ sudo docker network ls + NETWORK ID NAME DRIVER SCOPE + 7fca4eb8c647 bridge bridge local + 9f904ee27bf5 none null local + cf03ee007fb4 host host local + 78b03ee04fc4 multi-host overlay swarm + ``` + + Use the `--no-trunc` option to display the full network id: + + ```bash + $ docker network ls --no-trunc + NETWORK ID NAME DRIVER SCOPE + 18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null local + c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host local + 7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge local + 95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge local + 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge local + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there + is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). + Multiple filter flags are combined as an `OR` filter. For example, + `-f type=custom -f type=builtin` returns both `custom` and `builtin` networks. + + The currently supported filters are: + + * driver + * id (network's id) + * label (`label=` or `label==`) + * name (network's name) + * scope (`swarm|global|local`) + * type (`custom|builtin`) + + #### Driver + + The `driver` filter matches networks based on their driver. + + The following example matches networks with the `bridge` driver: + + ```bash + $ docker network ls --filter driver=bridge + NETWORK ID NAME DRIVER SCOPE + db9db329f835 test1 bridge local + f6e212da9dfd test2 bridge local + ``` + + #### ID + + The `id` filter matches on all or part of a network's ID. + + The following filter matches all networks with an ID containing the + `63d1ff1f77b0...` string. + + ```bash + $ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 + NETWORK ID NAME DRIVER SCOPE + 63d1ff1f77b0 dev bridge local + ``` + + You can also filter for a substring in an ID as this shows: + + ```bash + $ docker network ls --filter id=95e74588f40d + NETWORK ID NAME DRIVER SCOPE + 95e74588f40d foo bridge local + + $ docker network ls --filter id=95e + NETWORK ID NAME DRIVER SCOPE + 95e74588f40d foo bridge local + ``` + + #### Label + + The `label` filter matches networks based on the presence of a `label` alone or a `label` and a + value. + + The following filter matches networks with the `usage` label regardless of its value. + + ```bash + $ docker network ls -f "label=usage" + NETWORK ID NAME DRIVER SCOPE + db9db329f835 test1 bridge local + f6e212da9dfd test2 bridge local + ``` + + The following filter matches networks with the `usage` label with the `prod` value. + + ```bash + $ docker network ls -f "label=usage=prod" + NETWORK ID NAME DRIVER SCOPE + f6e212da9dfd test2 bridge local + ``` + + #### Name + + The `name` filter matches on all or part of a network's name. + + The following filter matches all networks with a name containing the `foobar` string. + + ```bash + $ docker network ls --filter name=foobar + NETWORK ID NAME DRIVER SCOPE + 06e7eef0a170 foobar bridge local + ``` + + You can also filter for a substring in a name as this shows: + + ```bash + $ docker network ls --filter name=foo + NETWORK ID NAME DRIVER SCOPE + 95e74588f40d foo bridge local + 06e7eef0a170 foobar bridge local + ``` + + #### Scope + + The `scope` filter matches networks based on their scope. + + The following example matches networks with the `swarm` scope: + + ```bash + $ docker network ls --filter scope=swarm + NETWORK ID NAME DRIVER SCOPE + xbtm0v4f1lfh ingress overlay swarm + ic6r88twuu92 swarmnet overlay swarm + ``` + + The following example matches networks with the `local` scope: + + ```bash + $ docker network ls --filter scope=local + NETWORK ID NAME DRIVER SCOPE + e85227439ac7 bridge bridge local + 0ca0e19443ed host host local + ca13cc149a36 localnet bridge local + f9e115d2de35 none null local + ``` + + #### Type + + The `type` filter supports two values; `builtin` displays predefined networks + (`bridge`, `none`, `host`), whereas `custom` displays user defined networks. + + The following filter matches all user defined networks: + + ```bash + $ docker network ls --filter type=custom + NETWORK ID NAME DRIVER SCOPE + 95e74588f40d foo bridge local + 63d1ff1f77b0 dev bridge local + ``` + + By having this flag it allows for batch cleanup. For example, use this filter + to delete all user defined networks: + + ```bash + $ docker network rm `docker network ls --filter type=custom -q` + ``` + + A warning will be issued when trying to remove a network that has containers + attached. + + ### Formatting + + The formatting options (`--format`) pretty-prints networks output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + -------------|------------------------------------------------------------------------------------------ + `.ID` | Network ID + `.Name` | Network name + `.Driver` | Network driver + `.Scope` | Network scope (local, global) + `.IPv6` | Whether IPv6 is enabled on the network or not. + `.Internal` | Whether the network is internal or not. + `.Labels` | All labels assigned to the network. + `.Label` | Value of a specific label for this network. For example `{{.Label "project.version"}}` + `.CreatedAt` | Time when the network was created + + When using the `--format` option, the `network ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `ID` and `Driver` entries separated by a colon (`:`) for all networks: + + ```bash + $ docker network ls --format "{{.ID}}: {{.Driver}}" + afaaab448eb2: bridge + d1584f8dc718: host + 391df270dc66: null + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_prune.yaml b/_data/engine-cli/docker_network_prune.yaml new file mode 100644 index 0000000..19d0424 --- /dev/null +++ b/_data/engine-cli/docker_network_prune.yaml @@ -0,0 +1,98 @@ +command: docker network prune +short: Remove all unused networks +long: |- + Remove all unused networks. Unused networks are those which are not referenced + by any containers. +usage: docker network prune [OPTIONS] +pname: docker network +plink: docker_network.yaml +options: +- option: filter + value_type: filter + description: Provide filter values (e.g. 'until=') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker network prune + + WARNING! This will remove all custom networks not used by at least one container. + Are you sure you want to continue? [y/N] y + Deleted Networks: + n1 + n2 + ``` + + ### Filtering + + The filtering flag (`--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * until (``) - only remove networks created before given timestamp + * label (`label=`, `label==`, `label!=`, or `label!==`) - only remove networks with (or without, in case `label!=...` is used) the specified labels. + + The `until` filter can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the daemon machine’s time. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the daemon will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), + which removes networks with the specified labels. The other + format is the `label!=...` (`label!=` or `label!==`), which removes + networks without the specified labels. + + The following removes networks created more than 5 minutes ago. Note that + system networks such as `bridge`, `host`, and `none` will never be pruned: + + ```bash + $ docker network ls + + NETWORK ID NAME DRIVER SCOPE + 7430df902d7a bridge bridge local + ea92373fd499 foo-1-day-ago bridge local + ab53663ed3c7 foo-1-min-ago bridge local + 97b91972bc3b host host local + f949d337b1f5 none null local + + $ docker network prune --force --filter until=5m + + Deleted Networks: + foo-1-day-ago + + $ docker network ls + + NETWORK ID NAME DRIVER SCOPE + 7430df902d7a bridge bridge local + ab53663ed3c7 foo-1-min-ago bridge local + 97b91972bc3b host host local + f949d337b1f5 none null local + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_network_rm.yaml b/_data/engine-cli/docker_network_rm.yaml new file mode 100644 index 0000000..39a8775 --- /dev/null +++ b/_data/engine-cli/docker_network_rm.yaml @@ -0,0 +1,39 @@ +command: docker network rm +aliases: remove +short: Remove one or more networks +long: |- + Removes one or more networks by name or identifier. To remove a network, + you must first disconnect any containers connected to it. +usage: docker network rm NETWORK [NETWORK...] +pname: docker network +plink: docker_network.yaml +examples: |- + ### Remove a network + + To remove the network named 'my-network': + + ```bash + $ docker network rm my-network + ``` + + ### Remove multiple networks + + To delete multiple networks in a single `docker network rm` command, provide + multiple network names or ids. The following example deletes a network with id + `3695c422697f` and a network named `my-network`: + + ```bash + $ docker network rm 3695c422697f my-network + ``` + + When you specify multiple networks, the command attempts to delete each in turn. + If the deletion of one network fails, the command continues to the next on the + list and tries to delete that. The command reports success or failure for each + deletion. +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_node.yaml b/_data/engine-cli/docker_node.yaml new file mode 100644 index 0000000..ca3e52b --- /dev/null +++ b/_data/engine-cli/docker_node.yaml @@ -0,0 +1,29 @@ +command: docker node +short: Manage Swarm nodes +long: Manage nodes. +usage: docker node +pname: docker +plink: docker.yaml +cname: +- docker node demote +- docker node inspect +- docker node ls +- docker node promote +- docker node ps +- docker node rm +- docker node update +clink: +- docker_node_demote.yaml +- docker_node_inspect.yaml +- docker_node_ls.yaml +- docker_node_promote.yaml +- docker_node_ps.yaml +- docker_node_rm.yaml +- docker_node_update.yaml +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_demote.yaml b/_data/engine-cli/docker_node_demote.yaml new file mode 100644 index 0000000..defa899 --- /dev/null +++ b/_data/engine-cli/docker_node_demote.yaml @@ -0,0 +1,24 @@ +command: docker node demote +short: Demote one or more nodes from manager in the swarm +long: |- + Demotes an existing manager so that it is no longer a manager. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the [Swarm mode + > section](https://docs.docker.com/engine/swarm/) in the documentation. +usage: docker node demote NODE [NODE...] +pname: docker node +plink: docker_node.yaml +examples: |- + ```bash + $ docker node demote + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_inspect.yaml b/_data/engine-cli/docker_node_inspect.yaml new file mode 100644 index 0000000..641e729 --- /dev/null +++ b/_data/engine-cli/docker_node_inspect.yaml @@ -0,0 +1,172 @@ +command: docker node inspect +short: Display detailed information on one or more nodes +long: |- + Returns information about a node. By default, this command renders all results + in a JSON array. You can specify an alternate format to execute a + given template for each result. Go's + [text/template](http://golang.org/pkg/text/template/) package describes all the + details of the format. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node inspect [OPTIONS] self|NODE [NODE...] +pname: docker node +plink: docker_node.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pretty + value_type: bool + default_value: "false" + description: Print the information in a human friendly format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Inspect a node + + ```bash + $ docker node inspect swarm-manager + ``` + + ```json + [ + { + "ID": "e216jshn25ckzbvmwlnh5jr3g", + "Version": { + "Index": 10 + }, + "CreatedAt": "2017-05-16T22:52:44.9910662Z", + "UpdatedAt": "2017-05-16T22:52:45.230878043Z", + "Spec": { + "Role": "manager", + "Availability": "active" + }, + "Description": { + "Hostname": "swarm-manager", + "Platform": { + "Architecture": "x86_64", + "OS": "linux" + }, + "Resources": { + "NanoCPUs": 1000000000, + "MemoryBytes": 1039843328 + }, + "Engine": { + "EngineVersion": "17.06.0-ce", + "Plugins": [ + { + "Type": "Volume", + "Name": "local" + }, + { + "Type": "Network", + "Name": "overlay" + }, + { + "Type": "Network", + "Name": "null" + }, + { + "Type": "Network", + "Name": "host" + }, + { + "Type": "Network", + "Name": "bridge" + }, + { + "Type": "Network", + "Name": "overlay" + } + ] + }, + "TLSInfo": { + "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy\nNDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g\nAh8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO\nPQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3\nzONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ==\n-----END CERTIFICATE-----\n", + "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh", + "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ==" + } + }, + "Status": { + "State": "ready", + "Addr": "168.0.32.137" + }, + "ManagerStatus": { + "Leader": true, + "Reachability": "reachable", + "Addr": "168.0.32.137:2377" + } + } + ] + ``` + + ### Specify an output format + + ```bash + $ docker node inspect --format '{{ .ManagerStatus.Leader }}' self + + false + ``` + + Use `--format=pretty` or the `--pretty` shorthand to pretty-print the output: + + ```bash + $ docker node inspect --format=pretty self + + ID: e216jshn25ckzbvmwlnh5jr3g + Hostname: swarm-manager + Joined at: 2017-05-16 22:52:44.9910662 +0000 utc + Status: + State: Ready + Availability: Active + Address: 172.17.0.2 + Manager Status: + Address: 172.17.0.2:2377 + Raft Status: Reachable + Leader: Yes + Platform: + Operating System: linux + Architecture: x86_64 + Resources: + CPUs: 4 + Memory: 7.704 GiB + Plugins: + Network: overlay, bridge, null, host, overlay + Volume: local + Engine Version: 17.06.0-ce + TLS Info: + TrustRoot: + -----BEGIN CERTIFICATE----- + MIIBazCCARCgAwIBAgIUOzgqU4tA2q5Yv1HnkzhSIwGyIBswCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAyMDAyNDAwWhcNMzcwNDI3MDAy + NDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABMbiAmET+HZyve35ujrnL2kOLBEQhFDZ5MhxAuYs96n796sFlfxTxC1lM/2g + Ah8DI34pm3JmHgZxeBPKUURJHKWjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBS3sjTJOcXdkls6WSY2rTx1KIJueTAKBggqhkjO + PQQDAgNJADBGAiEAoeVWkaXgSUAucQmZ3Yhmx22N/cq1EPBgYHOBZmHt0NkCIQC3 + zONcJ/+WA21OXtb+vcijpUOXtNjyHfcox0N8wsLDqQ== + -----END CERTIFICATE----- + + Issuer Public Key: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExuICYRP4dnK97fm6OucvaQ4sERCEUNnkyHEC5iz3qfv3qwWV/FPELWUz/aACHwMjfimbcmYeBnF4E8pRREkcpQ== + Issuer Subject: MBMxETAPBgNVBAMTCHN3YXJtLWNh + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_ls.yaml b/_data/engine-cli/docker_node_ls.yaml new file mode 100644 index 0000000..76376e3 --- /dev/null +++ b/_data/engine-cli/docker_node_ls.yaml @@ -0,0 +1,177 @@ +command: docker node ls +aliases: list +short: List nodes in the swarm +long: |- + Lists all the nodes that the Docker Swarm manager knows about. You can filter + using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section + for more information about available filter options. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node ls [OPTIONS] +pname: docker node +plink: docker_node.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print nodes using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker node ls + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Ready Active + 38ciaotwjuritcdtn9npbnkuz swarm-worker1 Ready Active + e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader + ``` + > **Note** + > + > In the above example output, there is a hidden column of `.Self` that indicates + > if the node is the same node as the current docker daemon. A `*` (e.g., + > `e216jshn25ckzbvmwlnh5jr3g *`) means this node is the current docker daemon. + + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * [id](#id) + * [label](#label) + * [membership](#membership) + * [name](#name) + * [role](#role) + + #### id + + The `id` filter matches all or part of a node's id. + + ```bash + $ docker node ls -f id=1 + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Ready Active + ``` + + #### label + + The `label` filter matches nodes based on engine labels and on the presence of a `label` alone or a `label` and a value. Node labels are currently not used for filtering. + + The following filter matches nodes with the `foo` label regardless of its value. + + ```bash + $ docker node ls -f "label=foo" + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Ready Active + ``` + + #### membership + + The `membership` filter matches nodes based on the presence of a `membership` and a value + `accepted` or `pending`. + + The following filter matches nodes with the `membership` of `accepted`. + + ```bash + $ docker node ls -f "membership=accepted" + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 1bcef6utixb0l0ca7gxuivsj0 swarm-worker2 Ready Active + 38ciaotwjuritcdtn9npbnkuz swarm-worker1 Ready Active + ``` + + #### name + + The `name` filter matches on all or part of a node hostname. + + The following filter matches the nodes with a name equal to `swarm-master` string. + + ```bash + $ docker node ls -f name=swarm-manager1 + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader + ``` + + #### role + + The `role` filter matches nodes based on the presence of a `role` and a value `worker` or `manager`. + + The following filter matches nodes with the `manager` role. + + ```bash + $ docker node ls -f "role=manager" + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + e216jshn25ckzbvmwlnh5jr3g * swarm-manager1 Ready Active Leader + ``` + + ### Formatting + + The formatting options (`--format`) pretty-prints nodes output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + -----------------|------------------------------------------------------------------------------------------ + `.ID` | Node ID + `.Self` | Node of the daemon (`true/false`, `true`indicates that the node is the same as current docker daemon) + `.Hostname` | Node hostname + `.Status` | Node status + `.Availability` | Node availability ("active", "pause", or "drain") + `.ManagerStatus` | Manager status of the node + `.TLSStatus` | TLS status of the node ("Ready", or "Needs Rotation" has TLS certificate signed by an old CA) + `.EngineVersion` | Engine version + + When using the `--format` option, the `node ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `ID`, `Hostname`, and `TLS Status` entries separated by a colon (`:`) for all + nodes: + + ```bash + $ docker node ls --format "{{.ID}}: {{.Hostname}} {{.TLSStatus}}" + e216jshn25ckzbvmwlnh5jr3g: swarm-manager1 Ready + 35o6tiywb700jesrt3dmllaza: swarm-worker1 Needs Rotation + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_promote.yaml b/_data/engine-cli/docker_node_promote.yaml new file mode 100644 index 0000000..dc72a13 --- /dev/null +++ b/_data/engine-cli/docker_node_promote.yaml @@ -0,0 +1,25 @@ +command: docker node promote +short: Promote one or more nodes to manager in the swarm +long: |- + Promotes a node to manager. This command can only be executed on a manager node. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node promote NODE [NODE...] +pname: docker node +plink: docker_node.yaml +examples: |- + ```bash + $ docker node promote + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_ps.yaml b/_data/engine-cli/docker_node_ps.yaml new file mode 100644 index 0000000..d6ff364 --- /dev/null +++ b/_data/engine-cli/docker_node_ps.yaml @@ -0,0 +1,172 @@ +command: docker node ps +short: List tasks running on one or more nodes, defaults to current node +long: |- + Lists all the tasks on a Node that Docker knows about. You can filter using the + `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more + information about available filter options. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node ps [OPTIONS] [NODE...] +pname: docker node +plink: docker_node.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print tasks using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-resolve + value_type: bool + default_value: "false" + description: Do not map IDs to Names + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display task IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker node ps swarm-manager1 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours + redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * [name](#name) + * [id](#id) + * [label](#label) + * [desired-state](#desired-state) + + #### name + + The `name` filter matches on all or part of a task's name. + + The following filter matches all tasks with a name containing the `redis` string. + + ```bash + $ docker node ps -f name=redis swarm-manager1 + + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours + redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds + ``` + + #### id + + The `id` filter matches a task's id. + + ```bash + $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1 + + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds + ``` + + #### label + + The `label` filter matches tasks based on the presence of a `label` alone or a `label` and a + value. + + The following filter matches tasks with the `usage` label regardless of its value. + + ```bash + $ docker node ps -f "label=usage" + + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes + ``` + + + #### desired-state + + The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`. + + + ### Formatting + + The formatting options (`--format`) pretty-prints tasks output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ----------------|------------------------------------------------------------------------------------------ + `.ID` | Task ID + `.Name` | Task name + `.Image` | Task image + `.Node` | Node ID + `.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`) + `.CurrentState` | Current state of the task + `.Error` | Error + `.Ports` | Task published ports + + When using the `--format` option, the `node ps` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Name` and `Image` entries separated by a colon (`:`) for all tasks: + + ```bash + $ docker node ps --format "{{.Name}}: {{.Image}}" + top.1: busybox + top.2: busybox + top.3: busybox + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_rm.yaml b/_data/engine-cli/docker_node_rm.yaml new file mode 100644 index 0000000..99a72eb --- /dev/null +++ b/_data/engine-cli/docker_node_rm.yaml @@ -0,0 +1,68 @@ +command: docker node rm +aliases: remove +short: Remove one or more nodes from the swarm +long: |- + Removes the specified nodes from a swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node rm [OPTIONS] NODE [NODE...] +pname: docker node +plink: docker_node.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force remove a node from the swarm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Remove a stopped node from the swarm + + ```bash + $ docker node rm swarm-node-02 + + Node swarm-node-02 removed from swarm + ``` + ### Attempt to remove a running node from a swarm + + Removes the specified nodes from the swarm, but only if the nodes are in the + down state. If you attempt to remove an active node you will receive an error: + + ```non + $ docker node rm swarm-node-03 + + Error response from daemon: rpc error: code = 9 desc = node swarm-node-03 is not + down and can't be removed + ``` + + ### Forcibly remove an inaccessible node from a swarm + + If you lose access to a worker node or need to shut it down because it has been + compromised or is not behaving as expected, you can use the `--force` option. + This may cause transient errors or interruptions, depending on the type of task + being run on the node. + + ```bash + $ docker node rm --force swarm-node-03 + + Node swarm-node-03 removed from swarm + ``` + + A manager node must be demoted to a worker node (using `docker node demote`) + before you can remove it from the swarm. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_node_update.yaml b/_data/engine-cli/docker_node_update.yaml new file mode 100644 index 0000000..0cd0a5b --- /dev/null +++ b/_data/engine-cli/docker_node_update.yaml @@ -0,0 +1,87 @@ +command: docker node update +short: Update a node +long: |- + Update metadata about a node, such as its availability, labels, or roles. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker node update [OPTIONS] NODE +pname: docker node +plink: docker_node.yaml +options: +- option: availability + value_type: string + description: Availability of the node ("active"|"pause"|"drain") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-add + value_type: list + description: Add or update a node label (key=value) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-rm + value_type: list + description: Remove a node label if exists + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: role + value_type: string + description: Role of the node ("worker"|"manager") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Add label metadata to a node + + Add metadata to a swarm node using node labels. You can specify a node label as + a key with an empty value: + + ``` bash + $ docker node update --label-add foo worker1 + ``` + + To add multiple labels to a node, pass the `--label-add` flag for each label: + + ```bash + $ docker node update --label-add foo --label-add bar worker1 + ``` + + When you [create a service](service_create.md), + you can use node labels as a constraint. A constraint limits the nodes where the + scheduler deploys tasks for a service. + + For example, to add a `type` label to identify nodes where the scheduler should + deploy message queue service tasks: + + ``` bash + $ docker node update --label-add type=queue worker1 + ``` + + The labels you set for nodes using `docker node update` apply only to the node + entity within the swarm. Do not confuse them with the docker daemon labels for + [dockerd](dockerd.md). + + For more information about labels, refer to [apply custom + metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/). +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_pause.yaml b/_data/engine-cli/docker_pause.yaml new file mode 100644 index 0000000..b99213c --- /dev/null +++ b/_data/engine-cli/docker_pause.yaml @@ -0,0 +1,26 @@ +command: docker pause +short: Pause all processes within one or more containers +long: |- + The `docker pause` command suspends all processes in the specified containers. + On Linux, this uses the freezer cgroup. 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. On Windows, only Hyper-V + containers can be paused. + + See the + [freezer cgroup documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) + for further details. +usage: docker pause CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +examples: |- + ```bash + $ docker pause my_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin.yaml b/_data/engine-cli/docker_plugin.yaml new file mode 100644 index 0000000..23b9087 --- /dev/null +++ b/_data/engine-cli/docker_plugin.yaml @@ -0,0 +1,35 @@ +command: docker plugin +short: Manage plugins +long: Manage plugins. +usage: docker plugin +pname: docker +plink: docker.yaml +cname: +- docker plugin create +- docker plugin disable +- docker plugin enable +- docker plugin inspect +- docker plugin install +- docker plugin ls +- docker plugin push +- docker plugin rm +- docker plugin set +- docker plugin upgrade +clink: +- docker_plugin_create.yaml +- docker_plugin_disable.yaml +- docker_plugin_enable.yaml +- docker_plugin_inspect.yaml +- docker_plugin_install.yaml +- docker_plugin_ls.yaml +- docker_plugin_push.yaml +- docker_plugin_rm.yaml +- docker_plugin_set.yaml +- docker_plugin_upgrade.yaml +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_create.yaml b/_data/engine-cli/docker_plugin_create.yaml new file mode 100644 index 0000000..c97419c --- /dev/null +++ b/_data/engine-cli/docker_plugin_create.yaml @@ -0,0 +1,47 @@ +command: docker plugin create +short: Create a plugin from a rootfs and configuration. Plugin data directory must + contain config.json and rootfs directory. +long: |- + Creates a plugin. Before creating the plugin, prepare the plugin's root filesystem as well as + [the config.json](../../extend/config.md) +usage: docker plugin create [OPTIONS] PLUGIN PLUGIN-DATA-DIR +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: compress + value_type: bool + default_value: "false" + description: Compress the context using gzip + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example shows how to create a sample `plugin`. + + ```bash + $ ls -ls /home/pluginDir + + total 4 + 4 -rw-r--r-- 1 root root 431 Nov 7 01:40 config.json + 0 drwxr-xr-x 19 root root 420 Nov 7 01:40 rootfs + + $ docker plugin create plugin /home/pluginDir + + plugin + + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 672d8144ec02 plugin:latest A sample plugin for Docker false + ``` + + The plugin can subsequently be enabled for local use or pushed to the public registry. +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_disable.yaml b/_data/engine-cli/docker_plugin_disable.yaml new file mode 100644 index 0000000..ddc2416 --- /dev/null +++ b/_data/engine-cli/docker_plugin_disable.yaml @@ -0,0 +1,50 @@ +command: docker plugin disable +short: Disable a plugin +long: |- + Disables a plugin. The plugin must be installed before it can be disabled, + see [`docker plugin install`](plugin_install.md). Without the `-f` option, + a plugin that has references (e.g., volumes, networks) cannot be disabled. +usage: docker plugin disable [OPTIONS] PLUGIN +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the disable of an active plugin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example shows that the `sample-volume-plugin` plugin is installed + and enabled: + + ```bash + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true + ``` + + To disable the plugin, use the following command: + + ```bash + $ docker plugin disable tiborvass/sample-volume-plugin + + tiborvass/sample-volume-plugin + + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker false + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_enable.yaml b/_data/engine-cli/docker_plugin_enable.yaml new file mode 100644 index 0000000..4bc4b49 --- /dev/null +++ b/_data/engine-cli/docker_plugin_enable.yaml @@ -0,0 +1,48 @@ +command: docker plugin enable +short: Enable a plugin +long: |- + Enables a plugin. The plugin must be installed before it can be enabled, + see [`docker plugin install`](plugin_install.md). +usage: docker plugin enable [OPTIONS] PLUGIN +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: timeout + value_type: int + default_value: "30" + description: HTTP client timeout (in seconds) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example shows that the `sample-volume-plugin` plugin is installed, + but disabled: + + ```bash + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker false + ``` + + To enable the plugin, use the following command: + + ```bash + $ docker plugin enable tiborvass/sample-volume-plugin + + tiborvass/sample-volume-plugin + + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_inspect.yaml b/_data/engine-cli/docker_plugin_inspect.yaml new file mode 100644 index 0000000..ed55427 --- /dev/null +++ b/_data/engine-cli/docker_plugin_inspect.yaml @@ -0,0 +1,152 @@ +command: docker plugin inspect +short: Display detailed information on one or more plugins +long: |- + Returns information about a plugin. By default, this command renders all results + in a JSON array. +usage: docker plugin inspect [OPTIONS] PLUGIN [PLUGIN...] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Inspect a plugin + + The following example example inspects the `tiborvass/sample-volume-plugin` plugin: + + ```bash + $ docker plugin inspect tiborvass/sample-volume-plugin:latest + ``` + + Output is in JSON format (output below is formatted for readability): + + ```json + { + "Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21", + "Name": "tiborvass/sample-volume-plugin:latest", + "PluginReference": "tiborvas/sample-volume-plugin:latest", + "Enabled": true, + "Config": { + "Mounts": [ + { + "Name": "", + "Description": "", + "Settable": null, + "Source": "/data", + "Destination": "/data", + "Type": "bind", + "Options": [ + "shared", + "rbind" + ] + }, + { + "Name": "", + "Description": "", + "Settable": null, + "Source": null, + "Destination": "/foobar", + "Type": "tmpfs", + "Options": null + } + ], + "Env": [ + "DEBUG=1" + ], + "Args": null, + "Devices": null + }, + "Manifest": { + "ManifestVersion": "v0", + "Description": "A test plugin for Docker", + "Documentation": "https://docs.docker.com/engine/extend/plugins/", + "Interface": { + "Types": [ + "docker.volumedriver/1.0" + ], + "Socket": "plugins.sock" + }, + "Entrypoint": [ + "plugin-sample-volume-plugin", + "/data" + ], + "Workdir": "", + "User": { + }, + "Network": { + "Type": "host" + }, + "Capabilities": null, + "Mounts": [ + { + "Name": "", + "Description": "", + "Settable": null, + "Source": "/data", + "Destination": "/data", + "Type": "bind", + "Options": [ + "shared", + "rbind" + ] + }, + { + "Name": "", + "Description": "", + "Settable": null, + "Source": null, + "Destination": "/foobar", + "Type": "tmpfs", + "Options": null + } + ], + "Devices": [ + { + "Name": "device", + "Description": "a host device to mount", + "Settable": null, + "Path": "/dev/cpu_dma_latency" + } + ], + "Env": [ + { + "Name": "DEBUG", + "Description": "If set, prints debug messages", + "Settable": null, + "Value": "1" + } + ], + "Args": { + "Name": "args", + "Description": "command line arguments", + "Settable": null, + "Value": [ + + ] + } + } + } + ``` + + + ### Formatting the output + + ```bash + $ docker plugin inspect -f '{{.Id}}' tiborvass/sample-volume-plugin:latest + + 8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21 + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_install.yaml b/_data/engine-cli/docker_plugin_install.yaml new file mode 100644 index 0000000..9699638 --- /dev/null +++ b/_data/engine-cli/docker_plugin_install.yaml @@ -0,0 +1,78 @@ +command: docker plugin install +short: Install a plugin +long: |- + Installs and enables a plugin. Docker looks first for the plugin on your Docker + host. If the plugin does not exist locally, then the plugin is pulled from + the registry. Note that the minimum required registry version to distribute + plugins is 2.3.0 +usage: docker plugin install [OPTIONS] PLUGIN [KEY=VALUE...] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: alias + value_type: string + description: Local name for plugin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable + value_type: bool + default_value: "false" + description: Do not enable the plugin on install + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: grant-all-permissions + value_type: bool + default_value: "false" + description: Grant all permissions necessary to run the plugin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example installs `vieus/sshfs` plugin and [sets](plugin_set.md) its + `DEBUG` environment variable to `1`. To install, `pull` the plugin from Docker + Hub and prompt the user to accept the list of privileges that the plugin needs, + set the plugin's parameters and enable the plugin. + + ```bash + $ docker plugin install vieux/sshfs DEBUG=1 + + Plugin "vieux/sshfs" is requesting the following privileges: + - network: [host] + - device: [/dev/fuse] + - capabilities: [CAP_SYS_ADMIN] + Do you grant the above permissions? [y/N] y + vieux/sshfs + ``` + + After the plugin is installed, it appears in the list of plugins: + + ```bash + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 vieux/sshfs:latest sshFS plugin for Docker true + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_ls.yaml b/_data/engine-cli/docker_plugin_ls.yaml new file mode 100644 index 0000000..442abb4 --- /dev/null +++ b/_data/engine-cli/docker_plugin_ls.yaml @@ -0,0 +1,120 @@ +command: docker plugin ls +aliases: list +short: List plugins +long: |- + Lists all the plugins that are currently installed. You can install plugins + using the [`docker plugin install`](plugin_install.md) command. + You can also filter using the `-f` or `--filter` flag. + Refer to the [filtering](#filtering) section for more information about available filter options. +usage: docker plugin ls [OPTIONS] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Provide filter values (e.g. 'enabled=true') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print plugins using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display plugin IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d123 tiborvass/sample-volume-plugin:latest A test plugin for Docker true + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * enabled (boolean - true or false, 0 or 1) + * capability (string - currently `volumedriver`, `networkdriver`, `ipamdriver`, `logdriver`, `metricscollector`, or `authz`) + + #### enabled + + The `enabled` filter matches on plugins enabled or disabled. + + #### capability + + The `capability` filter matches on plugin capabilities. One plugin + might have multiple capabilities. Currently `volumedriver`, `networkdriver`, + `ipamdriver`, `logdriver`, `metricscollector`, and `authz` are supported capabilities. + + ```bash + $ docker plugin install --disable vieux/sshfs + + Installed plugin vieux/sshfs + + $ docker plugin ls --filter enabled=true + + ID NAME DESCRIPTION ENABLED + ``` + + ### Formatting + + The formatting options (`--format`) pretty-prints plugins output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + -------------------|------------------------------------------------------------ + `.ID` | Plugin ID + `.Name` | Plugin name and tag + `.Description` | Plugin description + `.Enabled` | Whether plugin is enabled or not + `.PluginReference` | The reference used to push/pull from a registry + + When using the `--format` option, the `plugin ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `ID` and `Name` entries separated by a colon (`:`) for all plugins: + + ```bash + $ docker plugin ls --format "{{.ID}}: {{.Name}}" + + 4be01827a72e: vieux/sshfs:latest + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_push.yaml b/_data/engine-cli/docker_plugin_push.yaml new file mode 100644 index 0000000..c190fe7 --- /dev/null +++ b/_data/engine-cli/docker_plugin_push.yaml @@ -0,0 +1,39 @@ +command: docker plugin push +short: Push a plugin to a registry +long: |- + After you have created a plugin using `docker plugin create` and the plugin is + ready for distribution, use `docker plugin push` to share your images to Docker + Hub or a self-hosted registry. + + Registry credentials are managed by [docker login](login.md). +usage: docker plugin push [OPTIONS] PLUGIN[:TAG] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image signing + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example shows how to push a sample `user/plugin`. + + ```bash + $ docker plugin ls + + ID NAME DESCRIPTION ENABLED + 69553ca1d456 user/plugin:latest A sample plugin for Docker false + + $ docker plugin push user/plugin + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_rm.yaml b/_data/engine-cli/docker_plugin_rm.yaml new file mode 100644 index 0000000..e6222f4 --- /dev/null +++ b/_data/engine-cli/docker_plugin_rm.yaml @@ -0,0 +1,42 @@ +command: docker plugin rm +aliases: remove +short: Remove one or more plugins +long: |- + Removes a plugin. You cannot remove a plugin if it is enabled, you must disable + a plugin using the [`docker plugin disable`](plugin_disable.md) before removing + it (or use --force, use of force is not recommended, since it can affect + functioning of running containers using the plugin). +usage: docker plugin rm [OPTIONS] PLUGIN [PLUGIN...] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the removal of an active plugin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example disables and removes the `sample-volume-plugin:latest` + plugin: + + ```bash + $ docker plugin disable tiborvass/sample-volume-plugin + + tiborvass/sample-volume-plugin + + $ docker plugin rm tiborvass/sample-volume-plugin:latest + + tiborvass/sample-volume-plugin + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_set.yaml b/_data/engine-cli/docker_plugin_set.yaml new file mode 100644 index 0000000..4c40541 --- /dev/null +++ b/_data/engine-cli/docker_plugin_set.yaml @@ -0,0 +1,92 @@ +command: docker plugin set +short: Change settings for a plugin +long: |- + Change settings for a plugin. The plugin must be disabled. + + The settings currently supported are: + * env variables + * source of mounts + * path of devices + * args +usage: docker plugin set PLUGIN KEY=VALUE [KEY=VALUE...] +pname: docker plugin +plink: docker_plugin.yaml +examples: |- + ### Change an environment variable + + The following example change the env variable `DEBUG` on the + `sample-volume-plugin` plugin. + + ```bash + $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin + [DEBUG=0] + + $ docker plugin set tiborvass/sample-volume-plugin DEBUG=1 + + $ docker plugin inspect -f {{.Settings.Env}} tiborvass/sample-volume-plugin + [DEBUG=1] + ``` + + ### Change the source of a mount + + The following example change the source of the `mymount` mount on + the `myplugin` plugin. + + ```bash + $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin + /foo + + $ docker plugins set myplugin mymount.source=/bar + + $ docker plugin inspect -f '{{with $mount := index .Settings.Mounts 0}}{{$mount.Source}}{{end}}' myplugin + /bar + ``` + + > **Note** + > + > Since only `source` is settable in `mymount`, + > `docker plugins set mymount=/bar myplugin` would work too. + + ### Change a device path + + The following example change the path of the `mydevice` device on + the `myplugin` plugin. + + ```bash + $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin + + /dev/foo + + $ docker plugins set myplugin mydevice.path=/dev/bar + + $ docker plugin inspect -f '{{with $device := index .Settings.Devices 0}}{{$device.Path}}{{end}}' myplugin + + /dev/bar + ``` + + > **Note** + > Since only `path` is settable in `mydevice`, + > `docker plugins set mydevice=/dev/bar myplugin` would work too. + + ### Change the source of the arguments + + The following example change the value of the args on the `myplugin` plugin. + + ```bash + $ docker plugin inspect -f '{{.Settings.Args}}' myplugin + + ["foo", "bar"] + + $ docker plugins set myplugin myargs="foo bar baz" + + $ docker plugin inspect -f '{{.Settings.Args}}' myplugin + + ["foo", "bar", "baz"] + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_plugin_upgrade.yaml b/_data/engine-cli/docker_plugin_upgrade.yaml new file mode 100644 index 0000000..7a5baff --- /dev/null +++ b/_data/engine-cli/docker_plugin_upgrade.yaml @@ -0,0 +1,97 @@ +command: docker plugin upgrade +short: Upgrade an existing plugin +long: |- + Upgrades an existing plugin to the specified remote plugin image. If no remote + is specified, Docker will re-pull the current image and use the updated version. + All existing references to the plugin will continue to work. + The plugin must be disabled before running the upgrade. +usage: docker plugin upgrade [OPTIONS] PLUGIN [REMOTE] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: grant-all-permissions + value_type: bool + default_value: "false" + description: Grant all permissions necessary to run the plugin + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: skip-remote-check + value_type: bool + default_value: "false" + description: | + Do not check if specified remote plugin matches existing plugin image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following example installs `vieus/sshfs` plugin, uses it to create and use + a volume, then upgrades the plugin. + + ```bash + $ docker plugin install vieux/sshfs DEBUG=1 + + Plugin "vieux/sshfs:next" is requesting the following privileges: + - network: [host] + - device: [/dev/fuse] + - capabilities: [CAP_SYS_ADMIN] + Do you grant the above permissions? [y/N] y + vieux/sshfs:next + + $ docker volume create -d vieux/sshfs:next -o sshcmd=root@1.2.3.4:/tmp/shared -o password=XXX sshvolume + + sshvolume + + $ docker run -it -v sshvolume:/data alpine sh -c "touch /data/hello" + + $ docker plugin disable -f vieux/sshfs:next + + viex/sshfs:next + + # Here docker volume ls doesn't show 'sshfsvolume', since the plugin is disabled + $ docker volume ls + + DRIVER VOLUME NAME + + $ docker plugin upgrade vieux/sshfs:next vieux/sshfs:next + + Plugin "vieux/sshfs:next" is requesting the following privileges: + - network: [host] + - device: [/dev/fuse] + - capabilities: [CAP_SYS_ADMIN] + Do you grant the above permissions? [y/N] y + Upgrade plugin vieux/sshfs:next to vieux/sshfs:next + + $ docker plugin enable vieux/sshfs:next + + viex/sshfs:next + + $ docker volume ls + + DRIVER VOLUME NAME + viuex/sshfs:next sshvolume + + $ docker run -it -v sshvolume:/data alpine sh -c "ls /data" + + hello + ``` +deprecated: false +min_api_version: "1.26" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_port.yaml b/_data/engine-cli/docker_port.yaml new file mode 100644 index 0000000..72eea32 --- /dev/null +++ b/_data/engine-cli/docker_port.yaml @@ -0,0 +1,41 @@ +command: docker port +short: List port mappings or a specific mapping for the container +long: List port mappings or a specific mapping for the container +usage: docker port CONTAINER [PRIVATE_PORT[/PROTO]] +pname: docker +plink: docker.yaml +examples: |- + ### Show all mapped ports + + You can find out all the ports mapped by not specifying a `PRIVATE_PORT`, or + just a specific mapping: + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + b650456536c7 busybox:latest top 54 minutes ago Up 54 minutes 0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp test + + $ docker port test + + 7890/tcp -> 0.0.0.0:4321 + 9876/tcp -> 0.0.0.0:1234 + + $ docker port test 7890/tcp + + 0.0.0.0:4321 + + $ docker port test 7890/udp + + 2014/06/24 11:53:36 Error: No public port '7890/udp' published for test + + $ docker port test 7890 + + 0.0.0.0:4321 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_ps.yaml b/_data/engine-cli/docker_ps.yaml new file mode 100644 index 0000000..9d751f4 --- /dev/null +++ b/_data/engine-cli/docker_ps.yaml @@ -0,0 +1,491 @@ +command: docker ps +short: List containers +long: List containers +usage: docker ps [OPTIONS] +pname: docker +plink: docker.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all containers (default shows just running) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print containers using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: last + shorthand: "n" + value_type: int + default_value: "-1" + description: Show n last created containers (includes all states) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: latest + shorthand: l + value_type: bool + default_value: "false" + description: Show the latest created container (includes all states) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display numeric IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: size + shorthand: s + value_type: bool + default_value: "false" + description: Display total file sizes + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Prevent truncating output + + Running `docker ps --no-trunc` showing 2 linked containers. + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 4c01db0b339c ubuntu:12.04 bash 17 seconds ago Up 16 seconds 3300-3310/tcp webapp + d7886598dbe2 crosbymichael/redis:latest /redis-server --dir 33 minutes ago Up 33 minutes 6379/tcp redis,webapp/db + ``` + + ### Show both running and stopped containers + + The `docker ps` command only shows running containers by default. To see all + containers, use the `-a` (or `--all`) flag: + + ```bash + $ docker ps -a + ``` + + `docker ps` groups exposed ports into a single range if possible. E.g., a + container that exposes TCP ports `100, 101, 102` displays `100-102/tcp` in + the `PORTS` column. + + ### Show disk usage by container + + The `docker ps -s` command displays two different on-disk-sizes for each container: + + ```bash + $ docker ps -s + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE SIZE + e90b8831a4b8 nginx "/bin/bash -c 'mkdir " 11 weeks ago Up 4 hours my_nginx 35.58 kB (virtual 109.2 MB) + 00c6131c5e30 telegraf:1.5 "/entrypoint.sh" 11 weeks ago Up 11 weeks my_telegraf 0 B (virtual 209.5 MB) + ``` + * The "size" information shows the amount of data (on disk) that is used for the _writable_ layer of each container + * The "virtual size" is the total amount of disk-space used for the read-only _image_ data used by the container and the writable layer. + + For more information, refer to the [container size on disk](https://docs.docker.com/storage/storagedriver/#container-size-on-disk) section. + + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more + than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + | Filter | Description | + |:----------------------|:-------------------------------------------------------------------------------------------------------------------------------------| + | `id` | Container's ID | + | `name` | Container's name | + | `label` | An arbitrary string representing either a key or a key-value pair. Expressed as `` or `=` | + | `exited` | An integer representing the container's exit code. Only useful with `--all`. | + | `status` | One of `created`, `restarting`, `running`, `removing`, `paused`, `exited`, or `dead` | + | `ancestor` | Filters containers which share a given image as an ancestor. Expressed as `[:]`, ``, or `` | + | `before` or `since` | Filters containers created before or after a given container ID or name | + | `volume` | Filters running containers which have mounted a given volume or bind mount. | + | `network` | Filters running containers connected to a given network. | + | `publish` or `expose` | Filters containers which publish or expose a given port. Expressed as `[/]` or `/[]` | + | `health` | Filters containers based on their healthcheck status. One of `starting`, `healthy`, `unhealthy` or `none`. | + | `isolation` | Windows daemon only. One of `default`, `process`, or `hyperv`. | + | `is-task` | Filters containers that are a "task" for a service. Boolean option (`true` or `false`) | + + + #### label + + The `label` filter matches containers based on the presence of a `label` alone or a `label` and a + value. + + The following filter matches containers with the `color` label regardless of its value. + + ```bash + $ docker ps --filter "label=color" + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 673394ef1d4c busybox "top" 47 seconds ago Up 45 seconds nostalgic_shockley + d85756f57265 busybox "top" 52 seconds ago Up 51 seconds high_albattani + ``` + + The following filter matches containers with the `color` label with the `blue` value. + + ```bash + $ docker ps --filter "label=color=blue" + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + d85756f57265 busybox "top" About a minute ago Up About a minute high_albattani + ``` + + #### name + + The `name` filter matches on all or part of a container's name. + + The following filter matches all containers with a name containing the `nostalgic_stallman` string. + + ```bash + $ docker ps --filter "name=nostalgic_stallman" + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9b6247364a03 busybox "top" 2 minutes ago Up 2 minutes nostalgic_stallman + ``` + + You can also filter for a substring in a name as this shows: + + ```bash + $ docker ps --filter "name=nostalgic" + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 715ebfcee040 busybox "top" 3 seconds ago Up 1 second i_am_nostalgic + 9b6247364a03 busybox "top" 7 minutes ago Up 7 minutes nostalgic_stallman + 673394ef1d4c busybox "top" 38 minutes ago Up 38 minutes nostalgic_shockley + ``` + + #### exited + + The `exited` filter matches containers by exist status code. For example, to + filter for containers that have exited successfully: + + ```bash + $ docker ps -a --filter 'exited=0' + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + ea09c3c82f6e registry:latest /srv/run.sh 2 weeks ago Exited (0) 2 weeks ago 127.0.0.1:5000->5000/tcp desperate_leakey + 106ea823fe4e fedora:latest /bin/sh -c 'bash -l' 2 weeks ago Exited (0) 2 weeks ago determined_albattani + 48ee228c9464 fedora:20 bash 2 weeks ago Exited (0) 2 weeks ago tender_torvalds + ``` + + #### Filter by exit signal + + You can use a filter to locate containers that exited with status of `137` + meaning a `SIGKILL(9)` killed them. + + ```bash + $ docker ps -a --filter 'exited=137' + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + b3e1c0ed5bfe ubuntu:latest "sleep 1000" 12 seconds ago Exited (137) 5 seconds ago grave_kowalevski + a2eb5558d669 redis:latest "/entrypoint.sh redi 2 hours ago Exited (137) 2 hours ago sharp_lalande + ``` + + Any of these events result in a `137` status: + + * the `init` process of the container is killed manually + * `docker kill` kills the container + * Docker daemon restarts which kills all running containers + + #### status + + The `status` filter matches containers by status. You can filter using + `created`, `restarting`, `running`, `removing`, `paused`, `exited` and `dead`. For example, + to filter for `running` containers: + + ```bash + $ docker ps --filter status=running + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 715ebfcee040 busybox "top" 16 minutes ago Up 16 minutes i_am_nostalgic + d5c976d3c462 busybox "top" 23 minutes ago Up 23 minutes top + 9b6247364a03 busybox "top" 24 minutes ago Up 24 minutes nostalgic_stallman + ``` + + To filter for `paused` containers: + + ```bash + $ docker ps --filter status=paused + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 673394ef1d4c busybox "top" About an hour ago Up About an hour (Paused) nostalgic_shockley + ``` + + #### ancestor + + The `ancestor` filter matches containers based on its image or a descendant of + it. The filter supports the following image representation: + + - `image` + - `image:tag` + - `image:tag@digest` + - `short-id` + - `full-id` + + If you don't specify a `tag`, the `latest` tag is used. For example, to filter + for containers that use the latest `ubuntu` image: + + ```bash + $ docker ps --filter ancestor=ubuntu + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 919e1179bdb8 ubuntu-c1 "top" About a minute ago Up About a minute admiring_lovelace + 5d1e4a540723 ubuntu-c2 "top" About a minute ago Up About a minute admiring_sammet + 82a598284012 ubuntu "top" 3 minutes ago Up 3 minutes sleepy_bose + bab2a34ba363 ubuntu "top" 3 minutes ago Up 3 minutes focused_yonath + ``` + + Match containers based on the `ubuntu-c1` image which, in this case, is a child + of `ubuntu`: + + ```bash + $ docker ps --filter ancestor=ubuntu-c1 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 919e1179bdb8 ubuntu-c1 "top" About a minute ago Up About a minute admiring_lovelace + ``` + + Match containers based on the `ubuntu` version `12.04.5` image: + + ```bash + $ docker ps --filter ancestor=ubuntu:12.04.5 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 82a598284012 ubuntu:12.04.5 "top" 3 minutes ago Up 3 minutes sleepy_bose + ``` + + The following matches containers based on the layer `d0e008c6cf02` or an image + that have this layer in its layer stack. + + ```bash + $ docker ps --filter ancestor=d0e008c6cf02 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 82a598284012 ubuntu:12.04.5 "top" 3 minutes ago Up 3 minutes sleepy_bose + ``` + + #### Create time + + ##### before + + The `before` filter shows only containers created before the container with + given id or name. For example, having these containers created: + + ```bash + $ docker ps + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9c3527ed70ce busybox "top" 14 seconds ago Up 15 seconds desperate_dubinsky + 4aace5031105 busybox "top" 48 seconds ago Up 49 seconds focused_hamilton + 6e63f6ff38b0 busybox "top" About a minute ago Up About a minute distracted_fermat + ``` + + Filtering with `before` would give: + + ```bash + $ docker ps -f before=9c3527ed70ce + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 4aace5031105 busybox "top" About a minute ago Up About a minute focused_hamilton + 6e63f6ff38b0 busybox "top" About a minute ago Up About a minute distracted_fermat + ``` + + ##### since + + The `since` filter shows only containers created since the container with given + id or name. For example, with the same containers as in `before` filter: + + ```bash + $ docker ps -f since=6e63f6ff38b0 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9c3527ed70ce busybox "top" 10 minutes ago Up 10 minutes desperate_dubinsky + 4aace5031105 busybox "top" 10 minutes ago Up 10 minutes focused_hamilton + ``` + + #### volume + + The `volume` filter shows only containers that mount a specific volume or have + a volume mounted in a specific path: + + ```bash + $ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}" + + CONTAINER ID MOUNTS + 9c3527ed70ce remote-volume + + $ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}" + + CONTAINER ID MOUNTS + 9c3527ed70ce remote-volume + ``` + + #### network + + The `network` filter shows only containers that are connected to a network with + a given name or id. + + The following filter matches all containers that are connected to a network + with a name containing `net1`. + + ```bash + $ docker run -d --net=net1 --name=test1 ubuntu top + $ docker run -d --net=net2 --name=test2 ubuntu top + + $ docker ps --filter network=net1 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9d4893ed80fe ubuntu "top" 10 minutes ago Up 10 minutes test1 + ``` + + The network filter matches on both the network's name and id. The following + example shows all containers that are attached to the `net1` network, using + the network id as a filter; + + ```bash + $ docker network inspect --format "{{.ID}}" net1 + + 8c0b4110ae930dbe26b258de9bc34a03f98056ed6f27f991d32919bfe401d7c5 + + $ docker ps --filter network=8c0b4110ae930dbe26b258de9bc34a03f98056ed6f27f991d32919bfe401d7c5 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9d4893ed80fe ubuntu "top" 10 minutes ago Up 10 minutes test1 + ``` + + #### publish and expose + + The `publish` and `expose` filters show only containers that have published or exposed port with a given port + number, port range, and/or protocol. The default protocol is `tcp` when not specified. + + The following filter matches all containers that have published port of 80: + + ```bash + $ docker run -d --publish=80 busybox top + $ docker run -d --expose=8080 busybox top + + $ docker ps -a + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9833437217a5 busybox "top" 5 seconds ago Up 4 seconds 8080/tcp dreamy_mccarthy + fc7e477723b7 busybox "top" 50 seconds ago Up 50 seconds 0.0.0.0:32768->80/tcp admiring_roentgen + + $ docker ps --filter publish=80 + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + fc7e477723b7 busybox "top" About a minute ago Up About a minute 0.0.0.0:32768->80/tcp admiring_roentgen + ``` + + The following filter matches all containers that have exposed TCP port in the range of `8000-8080`: + ```bash + $ docker ps --filter expose=8000-8080/tcp + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 9833437217a5 busybox "top" 21 seconds ago Up 19 seconds 8080/tcp dreamy_mccarthy + ``` + + The following filter matches all containers that have exposed UDP port `80`: + ```bash + $ docker ps --filter publish=80/udp + + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + ``` + + ### Formatting + + The formatting option (`--format`) pretty-prints container output using a Go + template. + + Valid placeholders for the Go template are listed below: + + | Placeholder | Description | + |:--------------|:------------------------------------------------------------------------------------------------| + | `.ID` | Container ID | + | `.Image` | Image ID | + | `.Command` | Quoted command | + | `.CreatedAt` | Time when the container was created. | + | `.RunningFor` | Elapsed time since the container was started. | + | `.Ports` | Exposed ports. | + | `.Status` | Container status. | + | `.Size` | Container disk size. | + | `.Names` | Container names. | + | `.Labels` | All labels assigned to the container. | + | `.Label` | Value of a specific label for this container. For example `'{{.Label "com.docker.swarm.cpu"}}'` | + | `.Mounts` | Names of the volumes mounted in this container. | + | `.Networks` | Names of the networks attached to this container. | + + When using the `--format` option, the `ps` command will either output the data + exactly as the template declares or, when using the `table` directive, includes + column headers as well. + + The following example uses a template without headers and outputs the `ID` and + `Command` entries separated by a colon (`:`) for all running containers: + + ```bash + $ docker ps --format "{{.ID}}: {{.Command}}" + + a87ecb4f327c: /bin/sh -c #(nop) MA + 01946d9d34d8: /bin/sh -c #(nop) MA + c1d3b0166030: /bin/sh -c yum -y up + 41d50ecd2f57: /bin/sh -c #(nop) MA + ``` + + To list all running containers with their labels in a table format you can use: + + ```bash + $ docker ps --format "table {{.ID}}\t{{.Labels}}" + + CONTAINER ID LABELS + a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd + 01946d9d34d8 + c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6 + 41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_pull.yaml b/_data/engine-cli/docker_pull.yaml new file mode 100644 index 0000000..b06db05 --- /dev/null +++ b/_data/engine-cli/docker_pull.yaml @@ -0,0 +1,277 @@ +command: docker pull +short: Pull an image or a repository from a registry +long: |- + Most of your images will be created on top of a base image from the + [Docker Hub](https://hub.docker.com) registry. + + [Docker Hub](https://hub.docker.com) contains many pre-built images that you + can `pull` and try without needing to define and configure your own. + + To download a particular image, or set of images (i.e., a repository), + use `docker pull`. + + ### Proxy configuration + + If you are behind an HTTP proxy server, for example in corporate settings, + before open a connect to registry, you may need to configure the Docker + daemon's proxy settings, using the `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` + environment variables. To set these environment variables on a host using + `systemd`, refer to the [control and configure Docker with systemd](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy) + for variables configuration. + + ### Concurrent downloads + + By default the Docker daemon will pull three layers of an image at a time. + If you are on a low bandwidth connection this may cause timeout issues and you may want to lower + this via the `--max-concurrent-downloads` daemon option. See the + [daemon documentation](dockerd.md) for more details. +usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST] +pname: docker +plink: docker.yaml +options: +- option: all-tags + shorthand: a + value_type: bool + default_value: "false" + description: Download all tagged images in the repository + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress verbose output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Pull an image from Docker Hub + + To download a particular image, or set of images (i.e., a repository), use + `docker pull`. If no tag is provided, Docker Engine uses the `:latest` tag as a + default. This command pulls the `debian:latest` image: + + ```bash + $ docker pull debian + + Using default tag: latest + latest: Pulling from library/debian + fdd5d7827f33: Pull complete + a3ed95caeb02: Pull complete + Digest: sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa + Status: Downloaded newer image for debian:latest + ``` + + Docker images can consist of multiple layers. In the example above, the image + consists of two layers; `fdd5d7827f33` and `a3ed95caeb02`. + + Layers can be reused by images. For example, the `debian:jessie` image shares + both layers with `debian:latest`. Pulling the `debian:jessie` image therefore + only pulls its metadata, but not its layers, because all layers are already + present locally: + + ```bash + $ docker pull debian:jessie + + jessie: Pulling from library/debian + fdd5d7827f33: Already exists + a3ed95caeb02: Already exists + Digest: sha256:a9c958be96d7d40df920e7041608f2f017af81800ca5ad23e327bc402626b58e + Status: Downloaded newer image for debian:jessie + ``` + + To see which images are present locally, use the [`docker images`](images.md) + command: + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + debian jessie f50f9524513f 5 days ago 125.1 MB + debian latest f50f9524513f 5 days ago 125.1 MB + ``` + + Docker uses a content-addressable image store, and the image ID is a SHA256 + digest covering the image's configuration and layers. In the example above, + `debian:jessie` and `debian:latest` have the same image ID because they are + actually the *same* image tagged with different names. Because they are the + same image, their layers are stored only once and do not consume extra disk + space. + + For more information about images, layers, and the content-addressable store, + refer to [understand images, containers, and storage drivers](https://docs.docker.com/storage/storagedriver/). + + + ### Pull an image by digest (immutable identifier) + + So far, you've pulled images by their name (and "tag"). Using names and tags is + a convenient way to work with images. When using tags, you can `docker pull` an + image again to make sure you have the most up-to-date version of that image. + For example, `docker pull ubuntu:14.04` pulls the latest version of the Ubuntu + 14.04 image. + + In some cases you don't want images to be updated to newer versions, but prefer + to use a fixed version of an image. Docker enables you to pull an image by its + *digest*. When pulling an image by digest, you specify *exactly* which version + of an image to pull. Doing so, allows you to "pin" an image to that version, + and guarantee that the image you're using is always the same. + + To know the digest of an image, pull the image first. Let's pull the latest + `ubuntu:14.04` image from Docker Hub: + + ```bash + $ docker pull ubuntu:14.04 + + 14.04: Pulling from library/ubuntu + 5a132a7e7af1: Pull complete + fd2731e4c50c: Pull complete + 28a2f68d1120: Pull complete + a3ed95caeb02: Pull complete + Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + Status: Downloaded newer image for ubuntu:14.04 + ``` + + Docker prints the digest of the image after the pull has finished. In the example + above, the digest of the image is: + + sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + + Docker also prints the digest of an image when *pushing* to a registry. This + may be useful if you want to pin to a version of the image you just pushed. + + A digest takes the place of the tag when pulling an image, for example, to + pull the above image by digest, run the following command: + + ```bash + $ docker pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + + sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2: Pulling from library/ubuntu + 5a132a7e7af1: Already exists + fd2731e4c50c: Already exists + 28a2f68d1120: Already exists + a3ed95caeb02: Already exists + Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + Status: Downloaded newer image for ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + ``` + + Digest can also be used in the `FROM` of a Dockerfile, for example: + + ```dockerfile + FROM ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2 + MAINTAINER some maintainer + ``` + + > **Note** + > + > Using this feature "pins" an image to a specific version in time. + > Docker will therefore not pull updated versions of an image, which may include + > security updates. If you want to pull an updated image, you need to change the + > digest accordingly. + + + ### Pull from a different registry + + By default, `docker pull` pulls images from [Docker Hub](https://hub.docker.com). It is also possible to + manually specify the path of a registry to pull from. For example, if you have + set up a local registry, you can specify its path to pull from it. A registry + path is similar to a URL, but does not contain a protocol specifier (`https://`). + + The following command pulls the `testing/test-image` image from a local registry + listening on port 5000 (`myregistry.local:5000`): + + ```bash + $ docker pull myregistry.local:5000/testing/test-image + ``` + + Registry credentials are managed by [docker login](login.md). + + Docker uses the `https://` protocol to communicate with a registry, unless the + registry is allowed to be accessed over an insecure connection. Refer to the + [insecure registries](dockerd.md#insecure-registries) section for more information. + + + ### Pull a repository with multiple images + + By default, `docker pull` pulls a *single* image from the registry. A repository + can contain multiple images. To pull all images from a repository, provide the + `-a` (or `--all-tags`) option when using `docker pull`. + + This command pulls all images from the `fedora` repository: + + ```bash + $ docker pull --all-tags fedora + + Pulling repository fedora + ad57ef8d78d7: Download complete + 105182bb5e8b: Download complete + 511136ea3c5a: Download complete + 73bd853d2ea5: Download complete + .... + + Status: Downloaded newer image for fedora + ``` + + After the pull has completed use the `docker images` command to see the + images that were pulled. The example below shows all the `fedora` images + that are present locally: + + ```bash + $ docker images fedora + + REPOSITORY TAG IMAGE ID CREATED SIZE + fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB + fedora 20 105182bb5e8b 5 days ago 372.7 MB + fedora heisenbug 105182bb5e8b 5 days ago 372.7 MB + fedora latest 105182bb5e8b 5 days ago 372.7 MB + ``` + + ### Cancel a pull + + Killing the `docker pull` process, for example by pressing `CTRL-c` while it is + running in a terminal, will terminate the pull operation. + + ```bash + $ docker pull fedora + + Using default tag: latest + latest: Pulling from library/fedora + a3ed95caeb02: Pulling fs layer + 236608c7b546: Pulling fs layer + ^C + ``` + + > **Note** + > + > The Engine terminates a pull operation when the connection between the Docker + > Engine daemon and the Docker Engine client initiating the pull is lost. If the + > connection with the Engine daemon is lost for other reasons than a manual + > interaction, the pull is also aborted. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_push.yaml b/_data/engine-cli/docker_push.yaml new file mode 100644 index 0000000..e911e02 --- /dev/null +++ b/_data/engine-cli/docker_push.yaml @@ -0,0 +1,73 @@ +command: docker push +short: Push an image or a repository to a registry +long: |- + Use `docker push` to share your images to the [Docker Hub](https://hub.docker.com) + registry or to a self-hosted one. + + Refer to the [`docker tag`](tag.md) reference for more information about valid + image and tag names. + + Killing the `docker push` process, for example by pressing `CTRL-c` while it is + running in a terminal, terminates the push operation. + + Progress bars are shown during docker push, which show the uncompressed size. + The actual amount of data that's pushed will be compressed before sending, so + the uploaded size will not be reflected by the progress bar. + + Registry credentials are managed by [docker login](login.md). + + ### Concurrent uploads + + By default the Docker daemon will push five layers of an image at a time. + If you are on a low bandwidth connection this may cause timeout issues and you may want to lower + this via the `--max-concurrent-uploads` daemon option. See the + [daemon documentation](dockerd.md) for more details. +usage: docker push [OPTIONS] NAME[:TAG] +pname: docker +plink: docker.yaml +options: +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image signing + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Push a new image to a registry + + First save the new image by finding the container ID (using [`docker ps`](ps.md)) + and then committing it to a new image name. Note that only `a-z0-9-_.` are + allowed when naming images: + + ```bash + $ docker commit c16378f943fe rhel-httpd + ``` + + Now, push the image to the registry using the image ID. In this example the + registry is on host named `registry-host` and listening on port `5000`. To do + this, tag the image with the host name or IP address, and the port of the + registry: + + ```bash + $ docker tag rhel-httpd registry-host:5000/myadmin/rhel-httpd + + $ docker push registry-host:5000/myadmin/rhel-httpd + ``` + + Check that this worked by running: + + ```bash + $ docker images + ``` + + You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` + listed. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_rename.yaml b/_data/engine-cli/docker_rename.yaml new file mode 100644 index 0000000..c57ea4b --- /dev/null +++ b/_data/engine-cli/docker_rename.yaml @@ -0,0 +1,16 @@ +command: docker rename +short: Rename a container +long: The `docker rename` command renames a container. +usage: docker rename CONTAINER NEW_NAME +pname: docker +plink: docker.yaml +examples: |- + ```bash + $ docker rename my_container my_new_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_restart.yaml b/_data/engine-cli/docker_restart.yaml new file mode 100644 index 0000000..90ff107 --- /dev/null +++ b/_data/engine-cli/docker_restart.yaml @@ -0,0 +1,27 @@ +command: docker restart +short: Restart one or more containers +long: Restart one or more containers +usage: docker restart [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: time + shorthand: t + value_type: int + default_value: "10" + description: Seconds to wait for stop before killing the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker restart my_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_rm.yaml b/_data/engine-cli/docker_rm.yaml new file mode 100644 index 0000000..10294bb --- /dev/null +++ b/_data/engine-cli/docker_rm.yaml @@ -0,0 +1,112 @@ +command: docker rm +short: Remove one or more containers +long: Remove one or more containers +usage: docker rm [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force the removal of a running container (uses SIGKILL) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + shorthand: l + value_type: bool + default_value: "false" + description: Remove the specified link + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes + shorthand: v + value_type: bool + default_value: "false" + description: Remove anonymous volumes associated with the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Remove a container + + This removes the container referenced under the link `/redis`. + + ```bash + $ docker rm /redis + + /redis + ``` + + ### Remove a link specified with `--link` on the default bridge network + + This removes the underlying link between `/webapp` and the `/redis` + containers on the default bridge network, removing all network communication + between the two containers. This does not apply when `--link` is used with + user-specified networks. + + ```bash + $ docker rm --link /webapp/redis + + /webapp/redis + ``` + + ### Force-remove a running container + + This command force-removes a running container. + + ```bash + $ docker rm --force redis + + redis + ``` + + The main process inside the container referenced under the link `redis` will receive + `SIGKILL`, then the container will be removed. + + ### Remove all stopped containers + + ```bash + $ docker rm $(docker ps -a -q) + ``` + + This command deletes all stopped containers. The command + `docker ps -a -q` above returns all existing container IDs and passes them to + the `rm` command which deletes them. Running containers are not deleted. + + ### Remove a container and its volumes + + ```bash + $ docker rm -v redis + redis + ``` + + This command removes the container and any volumes associated with it. + Note that if a volume was specified with a name, it will not be removed. + + ### Remove a container and selectively remove volumes + + ```bash + $ docker create -v awesome:/foo -v /bar --name hello redis + hello + + $ docker rm -v hello + ``` + + In this example, the volume for `/foo` remains intact, but the volume for + `/bar` is removed. The same behavior holds for volumes inherited with + `--volumes-from`. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_rmi.yaml b/_data/engine-cli/docker_rmi.yaml new file mode 100644 index 0000000..7cb0a84 --- /dev/null +++ b/_data/engine-cli/docker_rmi.yaml @@ -0,0 +1,116 @@ +command: docker rmi +short: Remove one or more images +long: |- + Removes (and un-tags) one or more images from the host node. If an image has + multiple tags, using this command with the tag as a parameter only removes the + tag. If the tag is the only one for the image, both the image and the tag are + removed. + + This does not remove images from a registry. You cannot remove an image of a + running container unless you use the `-f` option. To see all images on a host + use the [`docker image ls`](images.md) command. +usage: docker rmi [OPTIONS] IMAGE [IMAGE...] +pname: docker +plink: docker.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force removal of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-prune + value_type: bool + default_value: "false" + description: Do not delete untagged parents + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + You can remove an image using its short or long ID, its tag, or its digest. If + an image has one or more tags referencing it, you must remove all of them before + the image is removed. Digest references are removed automatically when an image + is removed by tag. + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + test1 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + test2 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + + $ docker rmi fd484f19954f + + Error: Conflict, cannot delete image fd484f19954f because it is tagged in multiple repositories, use -f to force + 2013/12/11 05:47:16 Error: failed to remove one or more images + + $ docker rmi test1:latest + + Untagged: test1:latest + + $ docker rmi test2:latest + + Untagged: test2:latest + + + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + + $ docker rmi test:latest + + Untagged: test:latest + Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 + ``` + + If you use the `-f` flag and specify the image's short or long ID, then this + command untags and removes all images that match the specified ID. + + ```bash + $ docker images + + REPOSITORY TAG IMAGE ID CREATED SIZE + test1 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + test latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + test2 latest fd484f19954f 23 seconds ago 7 B (virtual 4.964 MB) + + $ docker rmi -f fd484f19954f + + Untagged: test1:latest + Untagged: test:latest + Untagged: test2:latest + Deleted: fd484f19954f4920da7ff372b5067f5b7ddb2fd3830cecd17b96ea9e286ba5b8 + ``` + + An image pulled by digest has no tag associated with it: + + ```bash + $ docker images --digests + + REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE + localhost:5000/test/busybox sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf 4986bf8c1536 9 weeks ago 2.43 MB + ``` + + To remove an image using its digest: + + ```bash + $ docker rmi localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf + Untagged: localhost:5000/test/busybox@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf + Deleted: 4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125 + Deleted: ea13149945cb6b1e746bf28032f02e9b5a793523481a0a18645fc77ad53c4ea2 + Deleted: df7546f9f060a2268024c8a230d8639878585defcc1bc6f79d2728a13957871b + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_run.yaml b/_data/engine-cli/docker_run.yaml new file mode 100644 index 0000000..9051b68 --- /dev/null +++ b/_data/engine-cli/docker_run.yaml @@ -0,0 +1,1620 @@ +command: docker run +short: Run a command in a new container +long: |- + The `docker run` command first `creates` a writeable container layer over the + specified image, and then `starts` it using the specified command. That is, + `docker run` is equivalent to the API `/containers/create` then + `/containers/(id)/start`. A stopped container can be restarted with all its + previous changes intact using `docker start`. See `docker ps -a` to view a list + of all containers. + + The `docker run` command can be used in combination with `docker commit` to + [*change the command that a container runs*](commit.md). There is additional detailed information about `docker run` in the [Docker run reference](../run.md). + + For information on connecting a container to a network, see the ["*Docker network overview*"](https://docs.docker.com/network/). +usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] +pname: docker +plink: docker.yaml +options: +- option: add-host + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: attach + shorthand: a + value_type: list + description: Attach to STDIN, STDOUT or STDERR + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: blkio-weight-device + value_type: list + default_value: '[]' + description: Block IO weight (relative device weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-add + value_type: list + description: Add Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cap-drop + value_type: list + description: Drop Linux capabilities + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cgroup-parent + value_type: string + description: Optional parent cgroup for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cidfile + value_type: string + description: Write the container ID to the file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-count + value_type: int64 + default_value: "0" + description: CPU count (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-percent + value_type: int64 + default_value: "0" + description: CPU percent (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: Run container in background and print container ID + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device + value_type: list + description: Add a host device to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-cgroup-rule + value_type: list + description: Add a rule to the cgroup allowed devices list + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-bps + value_type: list + default_value: '[]' + description: Limit read rate (bytes per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-read-iops + value_type: list + default_value: '[]' + description: Limit read rate (IO per second) from a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-bps + value_type: list + default_value: '[]' + description: Limit write rate (bytes per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: device-write-iops + value_type: list + default_value: '[]' + description: Limit write rate (IO per second) to a device + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: disable-content-trust + value_type: bool + default_value: "true" + description: Skip image verification + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns + value_type: list + description: Set custom DNS servers + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-opt + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option + value_type: list + description: Set DNS options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search + value_type: list + description: Set custom DNS search domains + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: domainname + value_type: string + description: Container NIS domain name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: string + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-file + value_type: list + description: Read in a file of environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: expose + value_type: list + description: Expose a port or a range of ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: gpus + value_type: gpu-request + description: GPU devices to add to the container ('all' to pass all GPUs) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-add + value_type: list + description: Add additional groups to join + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + default_value: 0s + description: Time between running the check (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + default_value: 0s + description: | + Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + default_value: 0s + description: | + Maximum time to allow one check to run (ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: help + value_type: bool + default_value: "false" + description: Print usage + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + shorthand: h + value_type: string + description: Container host name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Run an init inside the container that forwards signals and reaps processes + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Keep STDIN open even if not attached + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: io-maxbandwidth + value_type: bytes + default_value: "0" + description: | + Maximum IO bandwidth limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: io-maxiops + value_type: uint64 + default_value: "0" + description: Maximum IOps limit for the system drive (Windows only) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false + os_type: windows +- option: ip + value_type: string + description: IPv4 address (e.g., 172.30.100.104) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ip6 + value_type: string + description: IPv6 address (e.g., 2001:db8::33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ipc + value_type: string + description: IPC mode to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Container isolation technology + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Set meta data on a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-file + value_type: list + description: Read in a line delimited file of labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link + value_type: list + description: Add link to another container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: link-local-ip + value_type: list + description: Container IPv4/IPv6 link-local addresses + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Log driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mac-address + value_type: string + description: Container MAC address (e.g., 92:d0:c6:0a:29:33) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swappiness + value_type: int64 + default_value: "-1" + description: Tune container memory swappiness (0 to 100) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount + value_type: mount + description: Attach a filesystem mount to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Assign a name to the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: net-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: network + description: Connect a container to a network + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-alias + value_type: list + description: Add network-scoped alias for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-kill-disable + value_type: bool + default_value: "false" + description: Disable OOM Killer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: oom-score-adj + value_type: int + default_value: "0" + description: Tune host's OOM preferences (-1000 to 1000) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pid + value_type: string + description: PID namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: platform + value_type: string + description: Set platform if server is multi-platform capable + deprecated: false + min_api_version: "1.32" + experimental: true + experimentalcli: false + kubernetes: false + swarm: false +- option: privileged + value_type: bool + default_value: "false" + description: Give extended privileges to this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish + shorthand: p + value_type: list + description: Publish a container's port(s) to the host + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-all + shorthand: P + value_type: bool + default_value: "false" + description: Publish all exposed ports to random ports + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + default_value: "no" + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rm + value_type: bool + default_value: "false" + description: Automatically remove the container when it exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: runtime + value_type: string + description: Runtime to use for this container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: security-opt + value_type: list + description: Security Options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: shm-size + value_type: bytes + default_value: "0" + description: Size of /dev/shm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sig-proxy + value_type: bool + default_value: "true" + description: Proxy received signals to the process + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + default_value: SIGTERM + description: Signal to stop a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-timeout + value_type: int + default_value: "0" + description: Timeout (in seconds) to stop a container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: storage-opt + value_type: list + description: Storage driver options for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl + value_type: map + default_value: map[] + description: Sysctl options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tmpfs + value_type: list + description: Mount a tmpfs directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ulimit + value_type: ulimit + default_value: '[]' + description: Ulimit options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: userns + value_type: string + description: User namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: uts + value_type: string + description: UTS namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume + shorthand: v + value_type: list + description: Bind mount a volume + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volume-driver + value_type: string + description: Optional volume driver for the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes-from + value_type: list + description: Mount volumes from the specified container(s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Assign name and allocate pseudo-TTY (--name, -it) + + ```bash + $ docker run --name test -it debian + + root@d6c0fe130dba:/# exit 13 + $ echo $? + 13 + $ docker ps -a | grep test + d6c0fe130dba debian:7 "/bin/bash" 26 seconds ago Exited (13) 17 seconds ago test + ``` + + This example runs a container named `test` using the `debian:latest` + image. The `-it` instructs Docker to allocate a pseudo-TTY connected to + the container's stdin; creating an interactive `bash` shell in the container. + In the example, the `bash` shell is quit by entering + `exit 13`. This exit code is passed on to the caller of + `docker run`, and is recorded in the `test` container's metadata. + + ### Capture container ID (--cidfile) + + ```bash + $ docker run --cidfile /tmp/docker_test.cid ubuntu echo "test" + ``` + + This will create a container and print `test` to the console. The `cidfile` + flag makes Docker attempt to create a new file and write the container ID to it. + If the file exists already, Docker will return an error. Docker will close this + file when `docker run` exits. + + ### Full container capabilities (--privileged) + + ```bash + $ docker run -t -i --rm ubuntu bash + root@bc338942ef20:/# mount -t tmpfs none /mnt + mount: permission denied + ``` + + This will *not* work, because by default, most potentially dangerous kernel + capabilities are dropped; including `cap_sys_admin` (which is required to mount + filesystems). However, the `--privileged` flag will allow it to run: + + ```bash + $ docker run -t -i --privileged ubuntu bash + root@50e3f57e16e6:/# mount -t tmpfs none /mnt + root@50e3f57e16e6:/# df -h + Filesystem Size Used Avail Use% Mounted on + none 1.9G 0 1.9G 0% /mnt + ``` + + The `--privileged` flag gives *all* capabilities to the container, and it also + lifts all the limitations enforced by the `device` cgroup controller. In other + words, the container can then do almost everything that the host can do. This + flag exists to allow special use-cases, like running Docker within Docker. + + ### Set working directory (-w) + + ```bash + $ docker run -w /path/to/dir/ -i -t ubuntu pwd + ``` + + The `-w` lets the command being executed inside directory given, here + `/path/to/dir/`. If the path does not exist it is created inside the container. + + ### Set storage driver options per container + + ```bash + $ docker run -it --storage-opt size=120G fedora /bin/bash + ``` + + This (size) will allow to set the container rootfs size to 120G at creation time. + This option is only available for the `devicemapper`, `btrfs`, `overlay2`, + `windowsfilter` and `zfs` graph drivers. + For the `devicemapper`, `btrfs`, `windowsfilter` and `zfs` graph drivers, + user cannot pass a size less than the Default BaseFS Size. + For the `overlay2` storage driver, the size option is only available if the + backing fs is `xfs` and mounted with the `pquota` mount option. + Under these conditions, user can pass any size less than the backing fs size. + + ### Mount tmpfs (--tmpfs) + + ```bash + $ docker run -d --tmpfs /run:rw,noexec,nosuid,size=65536k my_image + ``` + + The `--tmpfs` flag mounts an empty tmpfs into the container with the `rw`, + `noexec`, `nosuid`, `size=65536k` options. + + ### Mount volume (-v, --read-only) + + ```bash + $ docker run -v `pwd`:`pwd` -w `pwd` -i -t ubuntu pwd + ``` + + The `-v` flag mounts the current working directory into the container. The `-w` + lets the command being executed inside the current working directory, by + changing into the directory to the value returned by `pwd`. So this + combination executes the command using the container, but inside the + current working directory. + + ```bash + $ docker run -v /doesnt/exist:/foo -w /foo -i -t ubuntu bash + ``` + + When the host directory of a bind-mounted volume doesn't exist, Docker + will automatically create this directory on the host for you. In the + example above, Docker will create the `/doesnt/exist` + folder before starting your container. + + ```bash + $ docker run --read-only -v /icanwrite busybox touch /icanwrite/here + ``` + + Volumes can be used in combination with `--read-only` to control where + a container writes files. The `--read-only` flag mounts the container's root + filesystem as read only prohibiting writes to locations other than the + specified volumes for the container. + + ```bash + $ docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock -v /path/to/static-docker-binary:/usr/bin/docker busybox sh + ``` + + By bind-mounting the docker unix socket and statically linked docker + binary (refer to [get the linux binary](https://docs.docker.com/engine/install/binaries/#install-static-binaries)), + you give the container the full access to create and manipulate the host's + Docker daemon. + + On Windows, the paths must be specified using Windows-style semantics. + + ```powershell + PS C:\> docker run -v c:\foo:c:\dest microsoft/nanoserver cmd /s /c type c:\dest\somefile.txt + Contents of file + + PS C:\> docker run -v c:\foo:d: microsoft/nanoserver cmd /s /c type d:\somefile.txt + Contents of file + ``` + + The following examples will fail when using Windows-based containers, as the + destination of a volume or bind mount inside the container must be one of: + a non-existing or empty directory; or a drive other than C:. Further, the source + of a bind mount must be a local directory, not a file. + + ```powershell + net use z: \\remotemachine\share + docker run -v z:\foo:c:\dest ... + docker run -v \\uncpath\to\directory:c:\dest ... + docker run -v c:\foo\somefile.txt:c:\dest ... + docker run -v c:\foo:c: ... + docker run -v c:\foo:c:\existing-directory-with-contents ... + ``` + + For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/storage/volumes/) + + + ### Add bind mounts or volumes using the --mount flag + + The `--mount` flag allows you to mount volumes, host-directories and `tmpfs` + mounts in a container. + + The `--mount` flag supports most options that are supported by the `-v` or the + `--volume` flag, but uses a different syntax. For in-depth information on the + `--mount` flag, and a comparison between `--volume` and `--mount`, refer to + the [service create command reference](service_create.md#add-bind-mounts-volumes-or-memory-filesystems). + + Even though there is no plan to deprecate `--volume`, usage of `--mount` is recommended. + + Examples: + + ```bash + $ docker run --read-only --mount type=volume,target=/icanwrite busybox touch /icanwrite/here + ``` + + ```bash + $ docker run -t -i --mount type=bind,src=/data,dst=/data busybox sh + ``` + + ### Publish or expose port (-p, --expose) + + ```bash + $ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash + ``` + + This binds port `8080` of the container to TCP port `80` on `127.0.0.1` of the host + machine. You can also specify `udp` and `sctp` ports. + The [Docker User Guide](https://docs.docker.com/network/links/) + explains in detail how to manipulate ports in Docker. + + Note that ports which are not bound to the host (i.e., `-p 80:80` instead of + `-p 127.0.0.1:80:80`) will be accessible from the outside. This also applies if + you configured UFW to block this specific port, as Docker manages his + own iptables rules. [Read more](https://docs.docker.com/network/iptables/) + + ```bash + $ docker run --expose 80 ubuntu bash + ``` + + This exposes port `80` of the container without publishing the port to the host + system's interfaces. + + ### Set environment variables (-e, --env, --env-file) + + ```bash + $ docker run -e MYVAR1 --env MYVAR2=foo --env-file ./env.list ubuntu bash + ``` + + Use the `-e`, `--env`, and `--env-file` flags to set simple (non-array) + environment variables in the container you're running, or overwrite variables + that are defined in the Dockerfile of the image you're running. + + You can define the variable and its value when running the container: + + ```bash + $ docker run --env VAR1=value1 --env VAR2=value2 ubuntu env | grep VAR + VAR1=value1 + VAR2=value2 + ``` + + You can also use variables that you've exported to your local environment: + + ```bash + export VAR1=value1 + export VAR2=value2 + + $ docker run --env VAR1 --env VAR2 ubuntu env | grep VAR + VAR1=value1 + VAR2=value2 + ``` + + When running the command, the Docker CLI client checks the value the variable + has in your local environment and passes it to the container. + If no `=` is provided and that variable is not exported in your local + environment, the variable won't be set in the container. + + You can also load the environment variables from a file. This file should use + the syntax `=value` (which sets the variable to the given value) or + `` (which takes the value from the local environment), and `#` for comments. + + ```bash + $ cat env.list + # This is a comment + VAR1=value1 + VAR2=value2 + USER + + $ docker run --env-file env.list ubuntu env | grep VAR + VAR1=value1 + VAR2=value2 + USER=denis + ``` + + ### Set metadata on container (-l, --label, --label-file) + + A label is a `key=value` pair that applies metadata to a container. To label a container with two labels: + + ```bash + $ docker run -l my-label --label com.example.foo=bar ubuntu bash + ``` + + The `my-label` key doesn't specify a value so the label defaults to an empty + string (`""`). To add multiple labels, repeat the label flag (`-l` or `--label`). + + The `key=value` must be unique to avoid overwriting the label value. If you + specify labels with identical keys but different values, each subsequent value + overwrites the previous. Docker uses the last `key=value` you supply. + + Use the `--label-file` flag to load multiple labels from a file. Delimit each + label in the file with an EOL mark. The example below loads labels from a + labels file in the current directory: + + ```bash + $ docker run --label-file ./labels ubuntu bash + ``` + + The label-file format is similar to the format for loading environment + variables. (Unlike environment variables, labels are not visible to processes + running inside a container.) The following example illustrates a label-file + format: + + ```console + com.example.label1="a label" + + # this is a comment + com.example.label2=another\ label + com.example.label3 + ``` + + You can load multiple label-files by supplying multiple `--label-file` flags. + + For additional information on working with labels, see [*Labels - custom + metadata in Docker*](https://docs.docker.com/config/labels-custom-metadata/) in + the Docker User Guide. + + ### Connect a container to a network (--network) + + When you start a container use the `--network` flag to connect it to a network. + This adds the `busybox` container to the `my-net` network. + + ```bash + $ docker run -itd --network=my-net busybox + ``` + + You can also choose the IP addresses for the container with `--ip` and `--ip6` + flags when you start the container on a user-defined network. + + ```bash + $ docker run -itd --network=my-net --ip=10.10.9.75 busybox + ``` + + If you want to add a running container to a network use the `docker network connect` subcommand. + + You can connect multiple containers to the same network. Once connected, the + containers can communicate easily need only another container's IP address + or name. For `overlay` networks or custom plugins that support multi-host + connectivity, containers connected to the same multi-host network but launched + from different Engines can also communicate in this way. + + > **Note** + > + > Service discovery is unavailable on the default bridge network. Containers can + > communicate via their IP addresses by default. To communicate by name, they + > must be linked. + + You can disconnect a container from a network using the `docker network + disconnect` command. + + ### Mount volumes from container (--volumes-from) + + ```bash + $ docker run --volumes-from 777f7dc92da7 --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd + ``` + + The `--volumes-from` flag mounts all the defined volumes from the referenced + containers. Containers can be specified by repetitions of the `--volumes-from` + argument. The container ID may be optionally suffixed with `:ro` or `:rw` to + mount the volumes in read-only or read-write mode, respectively. By default, + the volumes are mounted in the same mode (read write or read only) as + the reference container. + + Labeling systems like SELinux require that proper labels are placed on volume + content mounted into a container. Without a label, the security system might + prevent the processes running inside the container from using the content. By + default, Docker does not change the labels set by the OS. + + To change the label in the container context, you can add either of two suffixes + `:z` or `:Z` to the volume mount. These suffixes tell Docker to relabel file + objects on the shared volumes. The `z` option tells Docker that two containers + share the volume content. As a result, Docker labels the content with a shared + content label. Shared volume labels allow all containers to read/write content. + The `Z` option tells Docker to label the content with a private unshared label. + Only the current container can use a private volume. + + ### Attach to STDIN/STDOUT/STDERR (-a) + + The `-a` flag tells `docker run` to bind to the container's `STDIN`, `STDOUT` + or `STDERR`. This makes it possible to manipulate the output and input as + needed. + + ```bash + $ echo "test" | docker run -i -a stdin ubuntu cat - + ``` + + This pipes data into a container and prints the container's ID by attaching + only to the container's `STDIN`. + + ```bash + $ docker run -a stderr ubuntu echo test + ``` + + This isn't going to print anything unless there's an error because we've + only attached to the `STDERR` of the container. The container's logs + still store what's been written to `STDERR` and `STDOUT`. + + ```bash + $ cat somefile | docker run -i -a stdin mybuilder dobuild + ``` + + This is how piping a file into a container could be done for a build. + The container's ID will be printed after the build is done and the build + logs could be retrieved using `docker logs`. This is + useful if you need to pipe a file or something else into a container and + retrieve the container's ID once the container has finished running. + + ### Add host device to container (--device) + + ```bash + $ docker run --device=/dev/sdc:/dev/xvdc \ + --device=/dev/sdd --device=/dev/zero:/dev/nulo \ + -i -t \ + ubuntu ls -l /dev/{xvdc,sdd,nulo} + + brw-rw---- 1 root disk 8, 2 Feb 9 16:05 /dev/xvdc + brw-rw---- 1 root disk 8, 3 Feb 9 16:05 /dev/sdd + crw-rw-rw- 1 root root 1, 5 Feb 9 16:05 /dev/nulo + ``` + + It is often necessary to directly expose devices to a container. The `--device` + option enables that. For example, a specific block storage device or loop + device or audio device can be added to an otherwise unprivileged container + (without the `--privileged` flag) and have the application directly access it. + + By default, the container will be able to `read`, `write` and `mknod` these devices. + This can be overridden using a third `:rwm` set of options to each `--device` + flag: + + ```bash + $ docker run --device=/dev/sda:/dev/xvdc --rm -it ubuntu fdisk /dev/xvdc + + Command (m for help): q + $ docker run --device=/dev/sda:/dev/xvdc:r --rm -it ubuntu fdisk /dev/xvdc + You will not be able to write the partition table. + + Command (m for help): q + + $ docker run --device=/dev/sda:/dev/xvdc:rw --rm -it ubuntu fdisk /dev/xvdc + + Command (m for help): q + + $ docker run --device=/dev/sda:/dev/xvdc:m --rm -it ubuntu fdisk /dev/xvdc + fdisk: unable to open /dev/xvdc: Operation not permitted + ``` + + > **Note** + > + > The `--device` option cannot be safely used with ephemeral devices. Block devices + > that may be removed should not be added to untrusted containers with `--device`. + + For Windows, the format of the string passed to the `--device` option is in + the form of `--device=/`. Beginning with Windows Server 2019 + and Windows 10 October 2018 Update, Windows only supports an IdType of + `class` and the Id as a [device interface class + GUID](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/overview-of-device-interface-classes). + Refer to the table defined in the [Windows container + docs](https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/hardware-devices-in-containers) + for a list of container-supported device interface class GUIDs. + + If this option is specified for a process-isolated Windows container, _all_ + devices that implement the requested device interface class GUID are made + available in the container. For example, the command below makes all COM + ports on the host visible in the container. + + ```powershell + PS C:\> docker run --device=class/86E0D1E0-8089-11D0-9CE4-08003E301F73 mcr.microsoft.com/windows/servercore:ltsc2019 + ``` + + > **Note** + > + > The `--device` option is only supported on process-isolated Windows containers. + > This option fails if the container isolation is `hyperv` or when running Linux + > Containers on Windows (LCOW). + + ### Access an NVIDIA GPU + + The `--gpus­` flag allows you to access NVIDIA GPU resources. First you need to + install [nvidia-container-runtime](https://nvidia.github.io/nvidia-container-runtime/). + Visit [Specify a container's resources](https://docs.docker.com/config/containers/resource_constraints/) + for more information. + + To use `--gpus`, specify which GPUs (or all) to use. If no value is provied, all + available GPUs are used. The example below exposes all available GPUs. + + ```bash + $ docker run -it --rm --gpus all ubuntu nvidia-smi + ``` + + Use the `device` option to specify GPUs. The example below exposes a specific + GPU. + + ```bash + $ docker run -it --rm --gpus device=GPU-3a23c669-1f69-c64e-cf85-44e9b07e7a2a ubuntu nvidia-smi + ``` + + The example below exposes the first and third GPUs. + + ```bash + $ docker run -it --rm --gpus device=0,2 nvidia-smi + ``` + + ### Restart policies (--restart) + + Use Docker's `--restart` to specify a container's *restart policy*. A restart + policy controls whether the Docker daemon restarts a container after exit. + Docker supports the following restart policies: + + | Policy | Result | + |:---------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `no` | Do not automatically restart the container when it exits. This is the default. | + | `on-failure[:max-retries]` | Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts. | + | `unless-stopped` | Restart the container unless it is explicitly stopped or Docker itself is stopped or restarted. | + | `always` | Always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container indefinitely. The container will also always start on daemon startup, regardless of the current state of the container. | + + ```bash + $ docker run --restart=always redis + ``` + + This will run the `redis` container with a restart policy of **always** + so that if the container exits, Docker will restart it. + + More detailed information on restart policies can be found in the + [Restart Policies (--restart)](../run.md#restart-policies---restart) + section of the Docker run reference page. + + ### Add entries to container hosts file (--add-host) + + You can add other hosts into a container's `/etc/hosts` file by using one or + more `--add-host` flags. This example adds a static address for a host named + `docker`: + + ```bash + $ docker run --add-host=docker:10.180.0.1 --rm -it debian + + root@f38c87f2a42d:/# ping docker + PING docker (10.180.0.1): 48 data bytes + 56 bytes from 10.180.0.1: icmp_seq=0 ttl=254 time=7.600 ms + 56 bytes from 10.180.0.1: icmp_seq=1 ttl=254 time=30.705 ms + ^C--- docker ping statistics --- + 2 packets transmitted, 2 packets received, 0% packet loss + round-trip min/avg/max/stddev = 7.600/19.152/30.705/11.553 ms + ``` + + Sometimes you need to connect to the Docker host from within your + container. To enable this, pass the Docker host's IP address to + the container using the `--add-host` flag. To find the host's address, + use the `ip addr show` command. + + The flags you pass to `ip addr show` depend on whether you are + using IPv4 or IPv6 networking in your containers. Use the following + flags for IPv4 address retrieval for a network device named `eth0`: + + ```bash + $ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print $2}' | cut -d / -f 1 | sed -n 1p` + $ docker run --add-host=docker:${HOSTIP} --rm -it debian + ``` + + For IPv6 use the `-6` flag instead of the `-4` flag. For other network + devices, replace `eth0` with the correct device name (for example `docker0` + for the bridge device). + + ### Set ulimits in container (--ulimit) + + Since setting `ulimit` settings in a container requires extra privileges not + available in the default container, you can set these using the `--ulimit` flag. + `--ulimit` is specified with a soft and hard limit as such: + `=[:]`, for example: + + ```bash + $ docker run --ulimit nofile=1024:1024 --rm debian sh -c "ulimit -n" + 1024 + ``` + + > **Note** + > + > If you do not provide a `hard limit`, the `soft limit` is used + > for both values. If no `ulimits` are set, they are inherited from + > the default `ulimits` set on the daemon. The `as` option is disabled now. + > In other words, the following script is not supported: + > + > ```bash + > $ docker run -it --ulimit as=1024 fedora /bin/bash` + > ``` + + The values are sent to the appropriate `syscall` as they are set. + Docker doesn't perform any byte conversion. Take this into account when setting the values. + + #### For `nproc` usage + + Be careful setting `nproc` with the `ulimit` flag as `nproc` is designed by Linux to set the + maximum number of processes available to a user, not to a container. For example, start four + containers with `daemon` user: + + ```bash + $ docker run -d -u daemon --ulimit nproc=3 busybox top + + $ docker run -d -u daemon --ulimit nproc=3 busybox top + + $ docker run -d -u daemon --ulimit nproc=3 busybox top + + $ docker run -d -u daemon --ulimit nproc=3 busybox top + ``` + + The 4th container fails and reports "[8] System error: resource temporarily unavailable" error. + This fails because the caller set `nproc=3` resulting in the first three containers using up + the three processes quota set for the `daemon` user. + + ### Stop container with signal (--stop-signal) + + The `--stop-signal` flag sets the system call signal that will be sent to the container to exit. + This signal can be a valid unsigned number that matches a position in the kernel's syscall table, for instance 9, + or a signal name in the format SIGNAME, for instance SIGKILL. + + ### Optional security options (--security-opt) + + On Windows, this flag can be used to specify the `credentialspec` option. + The `credentialspec` must be in the format `file://spec.txt` or `registry://keyname`. + + ### Stop container with timeout (--stop-timeout) + + The `--stop-timeout` flag sets the timeout (in seconds) that a pre-defined (see `--stop-signal`) system call + signal that will be sent to the container to exit. After timeout elapses the container will be killed with SIGKILL. + + ### Specify isolation technology for container (--isolation) + + This option is useful in situations where you are running Docker containers on + Windows. The `--isolation ` option sets a container's isolation technology. + On Linux, the only supported is the `default` option which uses + Linux namespaces. These two commands are equivalent on Linux: + + ```bash + $ docker run -d busybox top + $ docker run -d --isolation default busybox top + ``` + + On Windows, `--isolation` can take one of these values: + + + | Value | Description | + |:----------|:------------------------------------------------------------------------------------------------------------------| + | `default` | Use the value specified by the Docker daemon's `--exec-opt` or system default (see below). | + | `process` | Shared-kernel namespace isolation (not supported on Windows client operating systems older than Windows 10 1809). | + | `hyperv` | Hyper-V hypervisor partition-based isolation. | + + The default isolation on Windows server operating systems is `process`. The default + isolation on Windows client operating systems is `hyperv`. An attempt to start a container on a client + operating system older than Windows 10 1809 with `--isolation process` will fail. + + On Windows server, assuming the default configuration, these commands are equivalent + and result in `process` isolation: + + ```powershell + PS C:\> docker run -d microsoft/nanoserver powershell echo process + PS C:\> docker run -d --isolation default microsoft/nanoserver powershell echo process + PS C:\> docker run -d --isolation process microsoft/nanoserver powershell echo process + ``` + + If you have set the `--exec-opt isolation=hyperv` option on the Docker `daemon`, or + are running against a Windows client-based daemon, these commands are equivalent and + result in `hyperv` isolation: + + ```powershell + PS C:\> docker run -d microsoft/nanoserver powershell echo hyperv + PS C:\> docker run -d --isolation default microsoft/nanoserver powershell echo hyperv + PS C:\> docker run -d --isolation hyperv microsoft/nanoserver powershell echo hyperv + ``` + + ### Specify hard limits on memory available to containers (-m, --memory) + + These parameters always set an upper limit on the memory available to the container. On Linux, this + is set on the cgroup and applications in a container can query it at `/sys/fs/cgroup/memory/memory.limit_in_bytes`. + + On Windows, this will affect containers differently depending on what type of isolation is used. + + - With `process` isolation, Windows will report the full memory of the host system, not the limit to applications running inside the container + + ```powershell + PS C:\> docker run -it -m 2GB --isolation=process microsoft/nanoserver powershell Get-ComputerInfo *memory* + + CsTotalPhysicalMemory : 17064509440 + CsPhyicallyInstalledMemory : 16777216 + OsTotalVisibleMemorySize : 16664560 + OsFreePhysicalMemory : 14646720 + OsTotalVirtualMemorySize : 19154928 + OsFreeVirtualMemory : 17197440 + OsInUseVirtualMemory : 1957488 + OsMaxProcessMemorySize : 137438953344 + ``` + + - With `hyperv` isolation, Windows will create a utility VM that is big enough to hold the memory limit, plus the minimal OS needed to host the container. That size is reported as "Total Physical Memory." + + ```powershell + PS C:\> docker run -it -m 2GB --isolation=hyperv microsoft/nanoserver powershell Get-ComputerInfo *memory* + + CsTotalPhysicalMemory : 2683355136 + CsPhyicallyInstalledMemory : + OsTotalVisibleMemorySize : 2620464 + OsFreePhysicalMemory : 2306552 + OsTotalVirtualMemorySize : 2620464 + OsFreeVirtualMemory : 2356692 + OsInUseVirtualMemory : 263772 + OsMaxProcessMemorySize : 137438953344 + ``` + + + ### Configure namespaced kernel parameters (sysctls) at runtime + + The `--sysctl` sets namespaced kernel parameters (sysctls) in the + container. For example, to turn on IP forwarding in the containers + network namespace, run this command: + + ```bash + $ docker run --sysctl net.ipv4.ip_forward=1 someimage + ``` + + > **Note** + > + > Not all sysctls are namespaced. Docker does not support changing sysctls + > inside of a container that also modify the host system. As the kernel + > evolves we expect to see more sysctls become namespaced. + + #### Currently supported sysctls + + IPC Namespace: + + - `kernel.msgmax`, `kernel.msgmnb`, `kernel.msgmni`, `kernel.sem`, + `kernel.shmall`, `kernel.shmmax`, `kernel.shmmni`, `kernel.shm_rmid_forced`. + - Sysctls beginning with `fs.mqueue.*` + - If you use the `--ipc=host` option these sysctls are not allowed. + + Network Namespace: + + - Sysctls beginning with `net.*` + - If you use the `--network=host` option using these sysctls are not allowed. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_save.yaml b/_data/engine-cli/docker_save.yaml new file mode 100644 index 0000000..d494fe3 --- /dev/null +++ b/_data/engine-cli/docker_save.yaml @@ -0,0 +1,61 @@ +command: docker save +short: Save one or more images to a tar archive (streamed to STDOUT by default) +long: |- + Produces a tarred repository to the standard output stream. + Contains all parent layers, and all tags + versions, or specified `repo:tag`, for + each argument provided. +usage: docker save [OPTIONS] IMAGE [IMAGE...] +pname: docker +plink: docker.yaml +options: +- option: output + shorthand: o + value_type: string + description: Write to a file, instead of STDOUT + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create a backup that can then be used with `docker load`. + + ```bash + $ docker save busybox > busybox.tar + + $ ls -sh busybox.tar + + 2.7M busybox.tar + + $ docker save --output busybox.tar busybox + + $ ls -sh busybox.tar + + 2.7M busybox.tar + + $ docker save -o fedora-all.tar fedora + + $ docker save -o fedora-latest.tar fedora:latest + ``` + + ### Save an image to a tar.gz file using gzip + + You can use gzip to save the image file and make the backup smaller. + + ```bash + docker save myimage:latest | gzip > myimage_latest.tar.gz + ``` + + ### Cherry-pick particular tags + + You can even cherry-pick particular tags of an image repository. + + ```bash + $ docker save -o ubuntu.tar ubuntu:lucid ubuntu:saucy + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_search.yaml b/_data/engine-cli/docker_search.yaml new file mode 100644 index 0000000..e28cf27 --- /dev/null +++ b/_data/engine-cli/docker_search.yaml @@ -0,0 +1,222 @@ +command: docker search +short: Search the Docker Hub for images +long: Search [Docker Hub](https://hub.docker.com) for images +usage: docker search [OPTIONS] TERM +pname: docker +plink: docker.yaml +options: +- option: automated + value_type: bool + default_value: "false" + description: Only show automated builds + deprecated: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print search using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: limit + value_type: int + default_value: "25" + description: Max number of search results + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Don't truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stars + shorthand: s + value_type: uint + default_value: "0" + description: Only displays with at least x stars + deprecated: true + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Search images by name + + This example displays images with a name containing 'busybox': + + ```bash + $ docker search busybox + + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + busybox Busybox base image. 316 [OK] + progrium/busybox 50 [OK] + radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] + odise/busybox-python 2 [OK] + azukiapp/busybox This image is meant to be used as the base... 2 [OK] + ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1 [OK] + shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1 [OK] + odise/busybox-curl 1 [OK] + ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1 [OK] + peelsky/zulu-openjdk-busybox 1 [OK] + skomma/busybox-data Docker image suitable for data volume cont... 1 [OK] + elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1 [OK] + socketplane/busybox 1 [OK] + oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0 [OK] + ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0 [OK] + nikfoundas/busybox-confd Minimal busybox based distribution of confd 0 [OK] + openshift/busybox-http-app 0 [OK] + jllopis/busybox 0 [OK] + swyckoff/busybox 0 [OK] + powellquiring/busybox 0 [OK] + williamyeh/busybox-sh Docker image for BusyBox's sh 0 [OK] + simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0 [OK] + fhisamoto/busybox-java Busybox java 0 [OK] + scottabernethy/busybox 0 [OK] + marclop/busybox-solr + ``` + + ### Display non-truncated description (--no-trunc) + + This example displays images with a name containing 'busybox', + at least 3 stars and the description isn't truncated in the output: + + ```bash + $ docker search --filter=stars=3 --no-trunc busybox + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + busybox Busybox base image. 325 [OK] + progrium/busybox 50 [OK] + radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK] + ``` + + ### Limit search results (--limit) + + The flag `--limit` is the maximum number of results returned by a search. This value could + be in the range between 1 and 100. The default value of `--limit` is 25. + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more + than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`) + + The currently supported filters are: + + - stars (int - number of stars the image has) + - is-automated (boolean - true or false) - is the image automated or not + - is-official (boolean - true or false) - is the image official or not + + #### stars + + This example displays images with a name containing 'busybox' and at + least 3 stars: + + ```bash + $ docker search --filter stars=3 busybox + + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + busybox Busybox base image. 325 [OK] + progrium/busybox 50 [OK] + radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] + ``` + + #### is-automated + + This example displays images with a name containing 'busybox' + and are automated builds: + + ```bash + $ docker search --filter is-automated=true busybox + + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + progrium/busybox 50 [OK] + radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] + ``` + + #### is-official + + This example displays images with a name containing 'busybox', at least + 3 stars and are official builds: + + ```bash + $ docker search --filter is-official=true --filter stars=3 busybox + + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + progrium/busybox 50 [OK] + radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK] + ``` + + ### Format the output + + The formatting option (`--format`) pretty-prints search output + using a Go template. + + Valid placeholders for the Go template are: + + | Placeholder | Description | + | -------------- | --------------------------------- | + | `.Name` | Image Name | + | `.Description` | Image description | + | `.StarCount` | Number of stars for the image | + | `.IsOfficial` | "OK" if image is official | + | `.IsAutomated` | "OK" if image build was automated | + + When you use the `--format` option, the `search` command will + output the data exactly as the template declares. If you use the + `table` directive, column headers are included as well. + + The following example uses a template without headers and outputs the + `Name` and `StarCount` entries separated by a colon (`:`) for all images: + + ```bash + $ docker search --format "{{.Name}}: {{.StarCount}}" nginx + + nginx: 5441 + jwilder/nginx-proxy: 953 + richarvey/nginx-php-fpm: 353 + million12/nginx-php: 75 + webdevops/php-nginx: 70 + h3nrik/nginx-ldap: 35 + bitnami/nginx: 23 + evild/alpine-nginx: 14 + million12/nginx: 9 + maxexcloo/nginx: 7 + ``` + + This example outputs a table format: + + ```bash + $ docker search --format "table {{.Name}}\t{{.IsAutomated}}\t{{.IsOfficial}}" nginx + + NAME AUTOMATED OFFICIAL + nginx [OK] + jwilder/nginx-proxy [OK] + richarvey/nginx-php-fpm [OK] + jrcs/letsencrypt-nginx-proxy-companion [OK] + million12/nginx-php [OK] + webdevops/php-nginx [OK] + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_secret.yaml b/_data/engine-cli/docker_secret.yaml new file mode 100644 index 0000000..9ec8a70 --- /dev/null +++ b/_data/engine-cli/docker_secret.yaml @@ -0,0 +1,23 @@ +command: docker secret +short: Manage Docker secrets +long: Manage secrets. +usage: docker secret +pname: docker +plink: docker.yaml +cname: +- docker secret create +- docker secret inspect +- docker secret ls +- docker secret rm +clink: +- docker_secret_create.yaml +- docker_secret_inspect.yaml +- docker_secret_ls.yaml +- docker_secret_rm.yaml +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_secret_create.yaml b/_data/engine-cli/docker_secret_create.yaml new file mode 100644 index 0000000..b5f7b4f --- /dev/null +++ b/_data/engine-cli/docker_secret_create.yaml @@ -0,0 +1,110 @@ +command: docker secret create +short: Create a secret from a file or STDIN as content +long: |- + Creates a secret using standard input or from a file for the secret content. + + For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/). + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker secret create [OPTIONS] SECRET [file|-] +pname: docker secret +plink: docker_secret.yaml +options: +- option: driver + shorthand: d + value_type: string + description: Secret driver + deprecated: false + min_api_version: "1.31" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Secret labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: template-driver + value_type: string + description: Template driver + deprecated: false + min_api_version: "1.37" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create a secret + + ```bash + $ printf | docker secret create my_secret - + + onakdyv307se2tl7nl20anokv + + $ docker secret ls + + ID NAME CREATED UPDATED + onakdyv307se2tl7nl20anokv my_secret 6 seconds ago 6 seconds ago + ``` + + ### Create a secret with a file + + ```bash + $ docker secret create my_secret ./secret.json + + dg426haahpi5ezmkkj5kyl3sn + + $ docker secret ls + + ID NAME CREATED UPDATED + dg426haahpi5ezmkkj5kyl3sn my_secret 7 seconds ago 7 seconds ago + ``` + + ### Create a secret with labels + + ```bash + $ docker secret create --label env=dev \ + --label rev=20170324 \ + my_secret ./secret.json + + eo7jnzguqgtpdah3cm5srfb97 + ``` + + ```bash + $ docker secret inspect my_secret + + [ + { + "ID": "eo7jnzguqgtpdah3cm5srfb97", + "Version": { + "Index": 17 + }, + "CreatedAt": "2017-03-24T08:15:09.735271783Z", + "UpdatedAt": "2017-03-24T08:15:09.735271783Z", + "Spec": { + "Name": "my_secret", + "Labels": { + "env": "dev", + "rev": "20170324" + } + } + } + ] + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_secret_inspect.yaml b/_data/engine-cli/docker_secret_inspect.yaml new file mode 100644 index 0000000..9fe872c --- /dev/null +++ b/_data/engine-cli/docker_secret_inspect.yaml @@ -0,0 +1,99 @@ +command: docker secret inspect +short: Display detailed information on one or more secrets +long: |- + Inspects the specified secret. + + By default, this renders all results in a JSON array. If a format is specified, + the given template will be executed for each result. + + Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. + + For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/). + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker secret inspect [OPTIONS] SECRET [SECRET...] +pname: docker secret +plink: docker_secret.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pretty + value_type: bool + default_value: "false" + description: Print the information in a human friendly format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Inspect a secret by name or ID + + You can inspect a secret, either by its *name*, or *ID* + + For example, given the following secret: + + ```bash + $ docker secret ls + + ID NAME CREATED UPDATED + eo7jnzguqgtpdah3cm5srfb97 my_secret 3 minutes ago 3 minutes ago + ``` + + ```bash + $ docker secret inspect secret.json + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "ID": "eo7jnzguqgtpdah3cm5srfb97", + "Version": { + "Index": 17 + }, + "CreatedAt": "2017-03-24T08:15:09.735271783Z", + "UpdatedAt": "2017-03-24T08:15:09.735271783Z", + "Spec": { + "Name": "my_secret", + "Labels": { + "env": "dev", + "rev": "20170324" + } + } + } + ] + ``` + + ### Formatting + + You can use the --format option to obtain specific information about a + secret. The following example command outputs the creation time of the + secret. + + ```bash + $ docker secret inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97 + + 2017-03-24 08:15:09.735271783 +0000 UTC + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_secret_ls.yaml b/_data/engine-cli/docker_secret_ls.yaml new file mode 100644 index 0000000..e9e1ef8 --- /dev/null +++ b/_data/engine-cli/docker_secret_ls.yaml @@ -0,0 +1,164 @@ +command: docker secret ls +aliases: list +short: List secrets +long: |- + Run this command on a manager node to list the secrets in the swarm. + + For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/). + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker secret ls [OPTIONS] +pname: docker secret +plink: docker_secret.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print secrets using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker secret ls + + ID NAME CREATED UPDATED + 6697bflskwj1998km1gnnjr38 q5s5570vtvnimefos1fyeo2u2 6 weeks ago 6 weeks ago + 9u9hk4br2ej0wgngkga6rp4hq my_secret 5 weeks ago 5 weeks ago + mem02h8n73mybpgqjf0kfi1n0 test_secret 3 seconds ago 3 seconds ago + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + - [id](#id) (secret's ID) + - [label](#label) (`label=` or `label==`) + - [name](#name) (secret's name) + + #### id + + The `id` filter matches all or prefix of a secret's id. + + ```bash + $ docker secret ls -f "id=6697bflskwj1998km1gnnjr38" + + ID NAME CREATED UPDATED + 6697bflskwj1998km1gnnjr38 q5s5570vtvnimefos1fyeo2u2 6 weeks ago 6 weeks ago + ``` + + #### label + + The `label` filter matches secrets based on the presence of a `label` alone or + a `label` and a value. + + The following filter matches all secrets with a `project` label regardless of + its value: + + ```bash + $ docker secret ls --filter label=project + + ID NAME CREATED UPDATED + mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago + ``` + + The following filter matches only services with the `project` label with the + `project-a` value. + + ```bash + $ docker service ls --filter label=project=test + + ID NAME CREATED UPDATED + mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago + ``` + + #### name + + The `name` filter matches on all or prefix of a secret's name. + + The following filter matches secret with a name containing a prefix of `test`. + + ```bash + $ docker secret ls --filter name=test_secret + + ID NAME CREATED UPDATED + mem02h8n73mybpgqjf0kfi1n0 test_secret About an hour ago About an hour ago + ``` + + ### Format the output + + The formatting option (`--format`) pretty prints secrets output + using a Go template. + + Valid placeholders for the Go template are listed below: + + | Placeholder | Description | + | ------------ | ------------------------------------------------------------------------------------ | + | `.ID` | Secret ID | + | `.Name` | Secret name | + | `.CreatedAt` | Time when the secret was created | + | `.UpdatedAt` | Time when the secret was updated | + | `.Labels` | All labels assigned to the secret | + | `.Label` | Value of a specific label for this secret. For example `{{.Label "secret.ssh.key"}}` | + + When using the `--format` option, the `secret ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, will include column headers as well. + + The following example uses a template without headers and outputs the + `ID` and `Name` entries separated by a colon (`:`) for all images: + + ```bash + $ docker secret ls --format "{{.ID}}: {{.Name}}" + + 77af4d6b9913: secret-1 + b6fa739cedf5: secret-2 + 78a85c484f71: secret-3 + ``` + + To list all secrets with their name and created date in a table format you + can use: + + ```bash + $ docker secret ls --format "table {{.ID}}\t{{.Name}}\t{{.CreatedAt}}" + + ID NAME CREATED + 77af4d6b9913 secret-1 5 minutes ago + b6fa739cedf5 secret-2 3 hours ago + 78a85c484f71 secret-3 10 days ago + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_secret_rm.yaml b/_data/engine-cli/docker_secret_rm.yaml new file mode 100644 index 0000000..34ee897 --- /dev/null +++ b/_data/engine-cli/docker_secret_rm.yaml @@ -0,0 +1,36 @@ +command: docker secret rm +aliases: remove +short: Remove one or more secrets +long: |- + Removes the specified secrets from the swarm. + + For detailed information about using secrets, refer to [manage sensitive data with Docker secrets](https://docs.docker.com/engine/swarm/secrets/). + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker secret rm SECRET [SECRET...] +pname: docker secret +plink: docker_secret.yaml +examples: |- + This example removes a secret: + + ```bash + $ docker secret rm secret.json + sapth4csdo5b6wz2p5uimh5xg + ``` + + > **Warning** + > + > Unlike `docker rm`, this command does not ask for confirmation before removing + > a secret. +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service.yaml b/_data/engine-cli/docker_service.yaml new file mode 100644 index 0000000..8a3e62c --- /dev/null +++ b/_data/engine-cli/docker_service.yaml @@ -0,0 +1,41 @@ +command: docker service +short: Manage services +long: |- + Manage services. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service +pname: docker +plink: docker.yaml +cname: +- docker service create +- docker service inspect +- docker service logs +- docker service ls +- docker service ps +- docker service rm +- docker service rollback +- docker service scale +- docker service update +clink: +- docker_service_create.yaml +- docker_service_inspect.yaml +- docker_service_logs.yaml +- docker_service_ls.yaml +- docker_service_ps.yaml +- docker_service_rm.yaml +- docker_service_rollback.yaml +- docker_service_scale.yaml +- docker_service_update.yaml +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_create.yaml b/_data/engine-cli/docker_service_create.yaml new file mode 100644 index 0000000..ed0bcd3 --- /dev/null +++ b/_data/engine-cli/docker_service_create.yaml @@ -0,0 +1,1649 @@ +command: docker service create +short: Create a new service +long: |- + Creates a service as described by the specified parameters. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service create [OPTIONS] IMAGE [COMMAND] [ARG...] +pname: docker service +plink: docker_service.yaml +options: +- option: config + value_type: config + description: Specify configurations to expose to the service + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: constraint + value_type: list + description: Placement constraints + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: container-label + value_type: list + description: Container labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: credential-spec + value_type: credential-spec + description: Credential spec for managed service account (Windows only) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: | + Exit immediately instead of waiting for the service to converge + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns + value_type: list + description: Set custom DNS servers + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option + value_type: list + description: Set DNS options + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search + value_type: list + description: Set custom DNS search domains + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: endpoint-mode + value_type: string + default_value: vip + description: Endpoint mode (vip or dnsrr) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: command + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env + shorthand: e + value_type: list + description: Set environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-file + value_type: list + description: Read in a file of environment variables + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: generic-resource + value_type: list + description: User defined resources + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group + value_type: list + description: Set one or more supplementary user groups for the container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + description: Time between running the check (ms|s|m|h) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + description: | + Start period for the container to initialize before counting retries towards unstable (ms|s|m|h) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + description: Maximum time to allow one check to run (ms|s|m|h) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: host + value_type: list + description: Set one or more custom host-to-IP mappings (host:ip) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + value_type: string + description: Container hostname + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Use an init inside each service container to forward signals and reap processes + deprecated: false + min_api_version: "1.37" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Service container isolation mode + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + shorthand: l + value_type: list + description: Service labels + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: limit-cpu + value_type: decimal + description: Limit CPUs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: limit-memory + value_type: bytes + default_value: "0" + description: Limit Memory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for service + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Logging driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mode + value_type: string + default_value: replicated + description: Service mode (replicated or global) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount + value_type: mount + description: Attach a filesystem mount to the service + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Service name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network + value_type: network + description: Network attachments + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-resolve-image + value_type: bool + default_value: "false" + description: | + Do not query the registry to resolve image digest and supported platforms + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: placement-pref + value_type: pref + description: Add a placement preference + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish + shorthand: p + value_type: port + description: Publish a port as a node port + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress progress output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: replicas + value_type: uint + description: Number of tasks + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: replicas-max-per-node + value_type: uint64 + default_value: "0" + description: Maximum number of tasks per node (default 0 = unlimited) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: reserve-cpu + value_type: decimal + description: Reserve CPUs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: reserve-memory + value_type: bytes + default_value: "0" + description: Reserve Memory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-condition + value_type: string + description: | + Restart when condition is met ("none"|"on-failure"|"any") (default "any") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-delay + value_type: duration + description: Delay between restart attempts (ns|us|ms|s|m|h) (default 5s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-max-attempts + value_type: uint + description: Maximum number of restarts before giving up + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-window + value_type: duration + description: Window used to evaluate the restart policy (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-delay + value_type: duration + default_value: 0s + description: Delay between task rollbacks (ns|us|ms|s|m|h) (default 0s) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-failure-action + value_type: string + description: | + Action on rollback failure ("pause"|"continue") (default "pause") + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-max-failure-ratio + value_type: float + default_value: "0" + description: Failure rate to tolerate during a rollback (default 0) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-monitor + value_type: duration + default_value: 0s + description: | + Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 5s) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-order + value_type: string + description: | + Rollback order ("start-first"|"stop-first") (default "stop-first") + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-parallelism + value_type: uint64 + default_value: "1" + description: | + Maximum number of tasks rolled back simultaneously (0 to roll back all at once) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret + value_type: secret + description: Specify secrets to expose to the service + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-grace-period + value_type: duration + description: | + Time to wait before force killing a container (ns|us|ms|s|m|h) (default 10s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + description: Signal to stop the container + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl + value_type: list + description: Sysctl options + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-delay + value_type: duration + default_value: 0s + description: Delay between updates (ns|us|ms|s|m|h) (default 0s) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-failure-action + value_type: string + description: | + Action on update failure ("pause"|"continue"|"rollback") (default "pause") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-max-failure-ratio + value_type: float + default_value: "0" + description: Failure rate to tolerate during an update (default 0) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-monitor + value_type: duration + default_value: 0s + description: | + Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 5s) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-order + value_type: string + description: | + Update order ("start-first"|"stop-first") (default "stop-first") + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-parallelism + value_type: uint64 + default_value: "1" + description: | + Maximum number of tasks updated simultaneously (0 to update all at once) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Send registry authentication details to swarm agents + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create a service + + ```bash + $ docker service create --name redis redis:3.0.6 + + dmu1ept4cxcfe8k8lhtux3ro3 + + $ docker service create --mode global --name redis2 redis:3.0.6 + + a8q9dasaafudfs8q8w32udass + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + dmu1ept4cxcf redis replicated 1/1 redis:3.0.6 + a8q9dasaafud redis2 global 1/1 redis:3.0.6 + ``` + + #### Create a service using an image on a private registry + + If your image is available on a private registry which requires login, use the + `--with-registry-auth` flag with `docker service create`, after logging in. If + your image is stored on `registry.example.com`, which is a private registry, use + a command like the following: + + ```bash + $ docker login registry.example.com + + $ docker service create \ + --with-registry-auth \ + --name my_service \ + registry.example.com/acme/my_image:latest + ``` + + This passes the login token from your local client to the swarm nodes where the + service is deployed, using the encrypted WAL logs. With this information, the + nodes are able to log into the registry and pull the image. + + ### Create a service with 5 replica tasks (--replicas) + + Use the `--replicas` flag to set the number of replica tasks for a replicated + service. The following command creates a `redis` service with `5` replica tasks: + + ```bash + $ docker service create --name redis --replicas=5 redis:3.0.6 + + 4cdgfyky7ozwh3htjfw0d12qv + ``` + + The above command sets the *desired* number of tasks for the service. Even + though the command returns immediately, actual scaling of the service may take + some time. The `REPLICAS` column shows both the *actual* and *desired* number + of replica tasks for the service. + + In the following example the desired state is `5` replicas, but the current + number of `RUNNING` tasks is `3`: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 4cdgfyky7ozw redis replicated 3/5 redis:3.0.7 + ``` + + Once all the tasks are created and `RUNNING`, the actual number of tasks is + equal to the desired number: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 4cdgfyky7ozw redis replicated 5/5 redis:3.0.7 + ``` + + ### Create a service with secrets + + Use the `--secret` flag to give a container access to a + [secret](secret_create.md). + + Create a service specifying a secret: + + ```bash + $ docker service create --name redis --secret secret.json redis:3.0.6 + + 4cdgfyky7ozwh3htjfw0d12qv + ``` + + Create a service specifying the secret, target, user/group ID, and mode: + + ```bash + $ docker service create --name redis \ + --secret source=ssh-key,target=ssh \ + --secret source=app-key,target=app,uid=1000,gid=1001,mode=0400 \ + redis:3.0.6 + + 4cdgfyky7ozwh3htjfw0d12qv + ``` + + To grant a service access to multiple secrets, use multiple `--secret` flags. + + Secrets are located in `/run/secrets` in the container if no target is specified. + If no target is specified, the name of the secret is used as the in memory file + in the container. If a target is specified, that is used as the filename. In the + example above, two files are created: `/run/secrets/ssh` and + `/run/secrets/app` for each of the secret targets specified. + + ### Create a service with configs + + Use the `--config` flag to give a container access to a + [config](config_create.md). + + Create a service with a config. The config will be mounted into `redis-config`, + be owned by the user who runs the command inside the container (often `root`), + and have file mode `0444` or world-readable. You can specify the `uid` and `gid` + as numerical IDs or names. When using names, the provided group/user names must + pre-exist in the container. The `mode` is specified as a 4-number sequence such + as `0755`. + + ```bash + $ docker service create --name=redis --config redis-conf redis:3.0.6 + ``` + + Create a service with a config and specify the target location and file mode: + + ```bash + $ docker service create --name redis \ + --config source=redis-conf,target=/etc/redis/redis.conf,mode=0400 redis:3.0.6 + ``` + + To grant a service access to multiple configs, use multiple `--config` flags. + + Configs are located in `/` in the container if no target is specified. If no + target is specified, the name of the config is used as the name of the file in + the container. If a target is specified, that is used as the filename. + + ### Create a service with a rolling update policy + + ```bash + $ docker service create \ + --replicas 10 \ + --name redis \ + --update-delay 10s \ + --update-parallelism 2 \ + redis:3.0.6 + ``` + + When you run a [service update](service_update.md), the scheduler updates a + maximum of 2 tasks at a time, with `10s` between updates. For more information, + refer to the [rolling updates + tutorial](https://docs.docker.com/engine/swarm/swarm-tutorial/rolling-update/). + + ### Set environment variables (-e, --env) + + This sets an environment variable for all tasks in a service. For example: + + ```bash + $ docker service create \ + --name redis_2 \ + --replicas 5 \ + --env MYVAR=foo \ + redis:3.0.6 + ``` + + To specify multiple environment variables, specify multiple `--env` flags, each + with a separate key-value pair. + + ```bash + $ docker service create \ + --name redis_2 \ + --replicas 5 \ + --env MYVAR=foo \ + --env MYVAR2=bar \ + redis:3.0.6 + ``` + + ### Create a service with specific hostname (--hostname) + + This option sets the docker service containers hostname to a specific string. + For example: + + ```bash + $ docker service create --name redis --hostname myredis redis:3.0.6 + ``` + + ### Set metadata on a service (-l, --label) + + A label is a `key=value` pair that applies metadata to a service. To label a + service with two labels: + + ```bash + $ docker service create \ + --name redis_2 \ + --label com.example.foo="bar" + --label bar=baz \ + redis:3.0.6 + ``` + + For more information about labels, refer to [apply custom + metadata](https://docs.docker.com/config/labels-custom-metadata/). + + ### Add bind mounts, volumes or memory filesystems + + Docker supports three different kinds of mounts, which allow containers to read + from or write to files or directories, either on the host operating system, or + on memory filesystems. These types are _data volumes_ (often referred to simply + as volumes), _bind mounts_, _tmpfs_, and _named pipes_. + + A **bind mount** makes a file or directory on the host available to the + container it is mounted within. A bind mount may be either read-only or + read-write. For example, a container might share its host's DNS information by + means of a bind mount of the host's `/etc/resolv.conf` or a container might + write logs to its host's `/var/log/myContainerLogs` directory. If you use + bind mounts and your host and containers have different notions of permissions, + access controls, or other such details, you will run into portability issues. + + A **named volume** is a mechanism for decoupling persistent data needed by your + container from the image used to create the container and from the host machine. + Named volumes are created and managed by Docker, and a named volume persists + even when no container is currently using it. Data in named volumes can be + shared between a container and the host machine, as well as between multiple + containers. Docker uses a _volume driver_ to create, manage, and mount volumes. + You can back up or restore volumes using Docker commands. + + A **tmpfs** mounts a tmpfs inside a container for volatile data. + + A **npipe** mounts a named pipe from the host into the container. + + Consider a situation where your image starts a lightweight web server. You could + use that image as a base image, copy in your website's HTML files, and package + that into another image. Each time your website changed, you'd need to update + the new image and redeploy all of the containers serving your website. A better + solution is to store the website in a named volume which is attached to each of + your web server containers when they start. To update the website, you just + update the named volume. + + For more information about named volumes, see + [Data Volumes](https://docs.docker.com/storage/volumes/). + + The following table describes options which apply to both bind mounts and named + volumes in a service: + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionRequiredDescription
type +

The type of mount, can be either volume, bind, tmpfs, or npipe. Defaults to volume if no type is specified.

+
    +
  • volume: mounts a managed volume + into the container.
  • bind: + bind-mounts a directory or file from the host into the container.
  • +
  • tmpfs: mount a tmpfs in the container
  • +
  • npipe: mounts named pipe from the host into the container (Windows containers only).
  • +
+
src or sourcefor type=bind and type=npipe +
    +
  • + type=volume: src is an optional way to specify the name of the volume (for example, src=my-volume). + If the named volume does not exist, it is automatically created. If no src is specified, the volume is + assigned a random name which is guaranteed to be unique on the host, but may not be unique cluster-wide. + A randomly-named volume has the same lifecycle as its container and is destroyed when the container + is destroyed (which is upon service update, or when scaling or re-balancing the service) +
  • +
  • + type=bind: src is required, and specifies an absolute path to the file or directory to bind-mount + (for example, src=/path/on/host/). An error is produced if the file or directory does not exist. +
  • +
  • + type=tmpfs: src is not supported. +
  • +
+

dst or destination or target

yes +

Mount path inside the container, for example /some/path/in/container/. + If the path does not exist in the container's filesystem, the Engine creates + a directory at the specified location before mounting the volume or bind mount.

+

readonly or ro

+

The Engine mounts binds and volumes read-write unless readonly option + is given when mounting the bind or volume. Note that setting readonly for a + bind-mount does not make its submounts readonly on the current Linux implementation. See also bind-nonrecursive.

+
    +
  • true or 1 or no value: Mounts the bind or volume read-only.
  • +
  • false or 0: Mounts the bind or volume read-write.
  • +
+
+ + #### Options for Bind Mounts + + The following options can only be used for bind mounts (`type=bind`): + + + + + + + + + + + + + + + + + + + +
OptionDescription
bind-propagation +

See the bind propagation section.

+
consistency +

The consistency requirements for the mount; one of

+
    +
  • default: Equivalent to consistent.
  • +
  • consistent: Full consistency. The container runtime and the host maintain an identical view of the mount at all times.
  • +
  • cached: The host's view of the mount is authoritative. There may be delays before updates made on the host are visible within a container.
  • +
  • delegated: The container runtime's view of the mount is authoritative. There may be delays before updates made in a container are visible on the host.
  • +
+
bind-nonrecursive + By default, submounts are recursively bind-mounted as well. However, this behavior can be confusing when a + bind mount is configured with readonly option, because submounts are not mounted as read-only. + Set bind-nonrecursive to disable recursive bind-mount.
+
+ A value is optional:
+
+
    +
  • true or 1: Disables recursive bind-mount.
  • +
  • false or 0: Default if you do not provide a value. Enables recursive bind-mount.
  • +
+
+ + ##### Bind propagation + + Bind propagation refers to whether or not mounts created within a given + bind mount or named volume can be propagated to replicas of that mount. Consider + a mount point `/mnt`, which is also mounted on `/tmp`. The propagation settings + control whether a mount on `/tmp/a` would also be available on `/mnt/a`. Each + propagation setting has a recursive counterpoint. In the case of recursion, + consider that `/tmp/a` is also mounted as `/foo`. The propagation settings + control whether `/mnt/a` and/or `/tmp/a` would exist. + + The `bind-propagation` option defaults to `rprivate` for both bind mounts and + volume mounts, and is only configurable for bind mounts. In other words, named + volumes do not support bind propagation. + + - **`shared`**: Sub-mounts of the original mount are exposed to replica mounts, + and sub-mounts of replica mounts are also propagated to the + original mount. + - **`slave`**: similar to a shared mount, but only in one direction. If the + original mount exposes a sub-mount, the replica mount can see it. + However, if the replica mount exposes a sub-mount, the original + mount cannot see it. + - **`private`**: The mount is private. Sub-mounts within it are not exposed to + replica mounts, and sub-mounts of replica mounts are not + exposed to the original mount. + - **`rshared`**: The same as shared, but the propagation also extends to and from + mount points nested within any of the original or replica mount + points. + - **`rslave`**: The same as `slave`, but the propagation also extends to and from + mount points nested within any of the original or replica mount + points. + - **`rprivate`**: The default. The same as `private`, meaning that no mount points + anywhere within the original or replica mount points propagate + in either direction. + + For more information about bind propagation, see the + [Linux kernel documentation for shared subtree](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). + + #### Options for named volumes + + The following options can only be used for named volumes (`type=volume`): + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescription
volume-driver +

Name of the volume-driver plugin to use for the volume. Defaults to + "local", to use the local volume driver to create the volume if the + volume does not exist.

+
volume-label + One or more custom metadata ("labels") to apply to the volume upon + creation. For example, + volume-label=mylabel=hello-world,my-other-label=hello-mars. For more + information about labels, refer to + apply custom metadata. +
volume-nocopy + By default, if you attach an empty volume to a container, and files or + directories already existed at the mount-path in the container (dst), + the Engine copies those files and directories into the volume, allowing + the host to access them. Set volume-nocopy to disable copying files + from the container's filesystem to the volume and mount the empty volume.
+
+ A value is optional:
+
+
    +
  • true or 1: Default if you do not provide a value. Disables copying.
  • +
  • false or 0: Enables copying.
  • +
+
volume-opt + Options specific to a given volume driver, which will be passed to the + driver when creating the volume. Options are provided as a comma-separated + list of key/value pairs, for example, + volume-opt=some-option=some-value,volume-opt=some-other-option=some-other-value. + For available options for a given driver, refer to that driver's + documentation. +
+ + + #### Options for tmpfs + + The following options can only be used for tmpfs mounts (`type=tmpfs`); + + + + + + + + + + + + + + + +
OptionDescription
tmpfs-sizeSize of the tmpfs mount in bytes. Unlimited by default in Linux.
tmpfs-modeFile mode of the tmpfs in octal. (e.g. "700" or "0700".) Defaults to "1777" in Linux.
+ + + #### Differences between "--mount" and "--volume" + + The `--mount` flag supports most options that are supported by the `-v` + or `--volume` flag for `docker run`, with some important exceptions: + + - The `--mount` flag allows you to specify a volume driver and volume driver + options *per volume*, without creating the volumes in advance. In contrast, + `docker run` allows you to specify a single volume driver which is shared + by all volumes, using the `--volume-driver` flag. + + - The `--mount` flag allows you to specify custom metadata ("labels") for a volume, + before the volume is created. + + - When you use `--mount` with `type=bind`, the host-path must refer to an *existing* + path on the host. The path will not be created for you and the service will fail + with an error if the path does not exist. + + - The `--mount` flag does not allow you to relabel a volume with `Z` or `z` flags, + which are used for `selinux` labeling. + + #### Create a service using a named volume + + The following example creates a service that uses a named volume: + + ```bash + $ docker service create \ + --name my-service \ + --replicas 3 \ + --mount type=volume,source=my-volume,destination=/path/in/container,volume-label="color=red",volume-label="shape=round" \ + nginx:alpine + ``` + + For each replica of the service, the engine requests a volume named "my-volume" + from the default ("local") volume driver where the task is deployed. If the + volume does not exist, the engine creates a new volume and applies the "color" + and "shape" labels. + + When the task is started, the volume is mounted on `/path/in/container/` inside + the container. + + Be aware that the default ("local") volume is a locally scoped volume driver. + This means that depending on where a task is deployed, either that task gets a + *new* volume named "my-volume", or shares the same "my-volume" with other tasks + of the same service. Multiple containers writing to a single shared volume can + cause data corruption if the software running inside the container is not + designed to handle concurrent processes writing to the same location. Also take + into account that containers can be re-scheduled by the Swarm orchestrator and + be deployed on a different node. + + #### Create a service that uses an anonymous volume + + The following command creates a service with three replicas with an anonymous + volume on `/path/in/container`: + + ```bash + $ docker service create \ + --name my-service \ + --replicas 3 \ + --mount type=volume,destination=/path/in/container \ + nginx:alpine + ``` + + In this example, no name (`source`) is specified for the volume, so a new volume + is created for each task. This guarantees that each task gets its own volume, + and volumes are not shared between tasks. Anonymous volumes are removed after + the task using them is complete. + + #### Create a service that uses a bind-mounted host directory + + The following example bind-mounts a host directory at `/path/in/container` in + the containers backing the service: + + ```bash + $ docker service create \ + --name my-service \ + --mount type=bind,source=/path/on/host,destination=/path/in/container \ + nginx:alpine + ``` + + ### Set service mode (--mode) + + The service mode determines whether this is a _replicated_ service or a _global_ + service. A replicated service runs as many tasks as specified, while a global + service runs on each active node in the swarm. + + The following command creates a global service: + + ```bash + $ docker service create \ + --name redis_2 \ + --mode global \ + redis:3.0.6 + ``` + + ### Specify service constraints (--constraint) + + You can limit the set of nodes where a task can be scheduled by defining + constraint expressions. 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-14.04` + + + `engine.labels` apply to Docker Engine labels like operating system, drivers, + etc. Swarm administrators add `node.labels` for operational purposes by using + the [`docker node update`](node_update.md) command. + + For example, the following limits tasks for the redis service to nodes where the + node type label equals queue: + + ```bash + $ docker service create \ + --name redis_2 \ + --constraint node.platform.os==linux \ + --constraint node.labels.type==queue \ + redis:3.0.6 + ``` + + If the service constraints exclude all nodes in the cluster, a message is printed + that no suitable node is found, but the scheduler will start a reconciliation + loop and deploy the service once a suitable node becomes available. + + In the example below, no node satisfying the constraint was found, causing the + service to not reconcile with the desired state: + + ```bash + $ docker service create \ + --name web \ + --constraint node.labels.region==east \ + nginx:alpine + + lx1wrhhpmbbu0wuk0ybws30bc + overall progress: 0 out of 1 tasks + 1/1: no suitable node (scheduling constraints not satisfied on 5 nodes) + + $ docker service ls + ID NAME MODE REPLICAS IMAGE PORTS + b6lww17hrr4e web replicated 0/1 nginx:alpine + ``` + + After adding the `region=east` label to a node in the cluster, the service + reconciles, and the desired number of replicas are deployed: + + ```bash + $ docker node update --label-add region=east yswe2dm4c5fdgtsrli1e8ya5l + yswe2dm4c5fdgtsrli1e8ya5l + + $ docker service ls + ID NAME MODE REPLICAS IMAGE PORTS + b6lww17hrr4e web replicated 1/1 nginx:alpine + ``` + + ### Specify service placement preferences (--placement-pref) + + You can set up the service to divide tasks evenly over different categories of + nodes. One example of where this can be useful is to balance tasks over a set + of datacenters or availability zones. The example below illustrates this: + + ```bash + $ docker service create \ + --replicas 9 \ + --name redis_2 \ + --placement-pref spread=node.labels.datacenter \ + redis:3.0.6 + ``` + + This uses `--placement-pref` with a `spread` strategy (currently the only + supported strategy) to spread tasks evenly over the values of the `datacenter` + node label. In this example, we assume that every node has a `datacenter` node + label attached to it. If there are three different values of this label among + nodes in the swarm, one third of the tasks will be placed on the nodes + associated with each value. This is true even if there are more nodes with one + value than another. For example, consider the following set of nodes: + + - Three nodes with `node.labels.datacenter=east` + - Two nodes with `node.labels.datacenter=south` + - One node with `node.labels.datacenter=west` + + Since we are spreading over the values of the `datacenter` label and the + service has 9 replicas, 3 replicas will end up in each datacenter. There are + three nodes associated with the value `east`, so each one will get one of the + three replicas reserved for this value. There are two nodes with the value + `south`, and the three replicas for this value will be divided between them, + with one receiving two replicas and another receiving just one. Finally, `west` + has a single node that will get all three replicas reserved for `west`. + + If the nodes in one category (for example, those with + `node.labels.datacenter=south`) can't handle their fair share of tasks due to + constraints or resource limitations, the extra tasks will be assigned to other + nodes instead, if possible. + + Both engine labels and node labels are supported by placement preferences. The + example above uses a node label, because the label is referenced with + `node.labels.datacenter`. To spread over the values of an engine label, use + `--placement-pref spread=engine.labels.`. + + It is possible to add multiple placement preferences to a service. This + establishes a hierarchy of preferences, so that tasks are first divided over + one category, and then further divided over additional categories. One example + of where this may be useful is dividing tasks fairly between datacenters, and + then splitting the tasks within each datacenter over a choice of racks. To add + multiple placement preferences, specify the `--placement-pref` flag multiple + times. The order is significant, and the placement preferences will be applied + in the order given when making scheduling decisions. + + The following example sets up a service with multiple placement preferences. + Tasks are spread first over the various datacenters, and then over racks + (as indicated by the respective labels): + + ```bash + $ docker service create \ + --replicas 9 \ + --name redis_2 \ + --placement-pref 'spread=node.labels.datacenter' \ + --placement-pref 'spread=node.labels.rack' \ + redis:3.0.6 + ``` + + When updating a service with `docker service update`, `--placement-pref-add` + appends a new placement preference after all existing placement preferences. + `--placement-pref-rm` removes an existing placement preference that matches the + argument. + + ### Specify memory requirements and constraints for a service (--reserve-memory and --limit-memory) + + If your service needs a minimum amount of memory in order to run correctly, + you can use `--reserve-memory` to specify that the service should only be + scheduled on a node with this much memory available to reserve. If no node is + available that meets the criteria, the task is not scheduled, but remains in a + pending state. + + The following example requires that 4GB of memory be available and reservable + on a given node before scheduling the service to run on that node. + + ```bash + $ docker service create --reserve-memory=4GB --name=too-big nginx:alpine + ``` + + The managers won't schedule a set of containers on a single node whose combined + reservations exceed the memory available on that node. + + After a task is scheduled and running, `--reserve-memory` does not enforce a + memory limit. Use `--limit-memory` to ensure that a task uses no more than a + given amount of memory on a node. This example limits the amount of memory used + by the task to 4GB. The task will be scheduled even if each of your nodes has + only 2GB of memory, because `--limit-memory` is an upper limit. + + ```bash + $ docker service create --limit-memory=4GB --name=too-big nginx:alpine + ``` + + Using `--reserve-memory` and `--limit-memory` does not guarantee that Docker + will not use more memory on your host than you want. For instance, you could + create many services, the sum of whose memory usage could exhaust the available + memory. + + You can prevent this scenario from exhausting the available memory by taking + into account other (non-containerized) software running on the host as well. If + `--reserve-memory` is greater than or equal to `--limit-memory`, Docker won't + schedule a service on a host that doesn't have enough memory. `--limit-memory` + will limit the service's memory to stay within that limit, so if every service + has a memory-reservation and limit set, Docker services will be less likely to + saturate the host. Other non-service containers or applications running directly + on the Docker host could still exhaust memory. + + There is a downside to this approach. Reserving memory also means that you may + not make optimum use of the memory available on the node. Consider a service + that under normal circumstances uses 100MB of memory, but depending on load can + "peak" at 500MB. Reserving 500MB for that service (to guarantee can have 500MB + for those "peaks") results in 400MB of memory being wasted most of the time. + + In short, you can take a more conservative or more flexible approach: + + - **Conservative**: reserve 500MB, and limit to 500MB. Basically you're now + treating the service containers as VMs, and you may be losing a big advantage + containers, which is greater density of services per host. + + - **Flexible**: limit to 500MB in the assumption that if the service requires + more than 500MB, it is malfunctioning. Reserve something between the 100MB + "normal" requirement and the 500MB "peak" requirement". This assumes that when + this service is at "peak", other services or non-container workloads probably + won't be. + + The approach you take depends heavily on the memory-usage patterns of your + workloads. You should test under normal and peak conditions before settling + on an approach. + + On Linux, you can also limit a service's overall memory footprint on a given + host at the level of the host operating system, using `cgroups` or other + relevant operating system tools. + + ### Specify maximum replicas per node (--replicas-max-per-node) + + Use the `--replicas-max-per-node` flag to set the maximum number of replica tasks that can run on a node. + The following command creates a nginx service with 2 replica tasks but only one replica task per node. + + One example where this can be useful is to balance tasks over a set of data centers together with `--placement-pref` + and let `--replicas-max-per-node` setting make sure that replicas are not migrated to another datacenter during + maintenance or datacenter failure. + + The example below illustrates this: + + ```bash + $ docker service create \ + --name nginx \ + --replicas 2 \ + --replicas-max-per-node 1 \ + --placement-pref 'spread=node.labels.datacenter' \ + nginx + ``` + + ### Attach a service to an existing network (--network) + + You can use overlay networks to connect one or more services within the swarm. + + First, create an overlay network on a manager node the docker network create + command: + + ```bash + $ docker network create --driver overlay my-network + + etjpu59cykrptrgw0z0hk5snf + ``` + + After you create an overlay network in swarm mode, all manager nodes have + access to the network. + + When you create a service and pass the `--network` flag to attach the service to + the overlay network: + + ```bash + $ docker service create \ + --replicas 3 \ + --network my-network \ + --name my-web \ + nginx + + 716thylsndqma81j6kkkb5aus + ``` + + The swarm extends my-network to each node running the service. + + Containers on the same network can access each other using + [service discovery](https://docs.docker.com/network/overlay/#container-discovery). + + Long form syntax of `--network` allows to specify list of aliases and driver options: + `--network name=my-network,alias=web1,driver-opt=field1=value1` + + ### Publish service ports externally to the swarm (-p, --publish) + + You can publish service ports to make them available externally to the swarm + using the `--publish` flag. The `--publish` flag can take two different styles + of arguments. The short version is positional, and allows you to specify the + published port and target port separated by a colon (`:`). + + ```bash + $ docker service create --name my_web --replicas 3 --publish 8080:80 nginx + ``` + + There is also a long format, which is easier to read and allows you to specify + more options. The long format is preferred. You cannot specify the service's + mode when using the short format. Here is an example of using the long format + for the same service as above: + + ```bash + $ docker service create --name my_web --replicas 3 --publish published=8080,target=80 nginx + ``` + + The options you can specify are: + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionShort syntaxLong syntaxDescription
published and target port--publish 8080:80--publish published=8080,target=80

+ The target port within the container and the port to map it to on the + nodes, using the routing mesh (ingress) or host-level networking. + More options are available, later in this table. The key-value syntax is + preferred, because it is somewhat self-documenting. +

modeNot possible to set using short syntax.--publish published=8080,target=80,mode=host

+ The mode to use for binding the port, either ingress or host. + Defaults to ingress to use the routing mesh. +

protocol--publish 8080:80/tcp--publish published=8080,target=80,protocol=tcp

+ The protocol to use, tcp , udp, or sctp. Defaults to + tcp. To bind a port for both protocols, specify the -p or + --publish flag twice. +

+ + When you publish a service port using `ingress` mode, the swarm routing mesh + makes the service accessible at the published port on every node regardless if + there is a task for the service running on the node. If you use `host` mode, + the port is only bound on nodes where the service is running, and a given port + on a node can only be bound once. You can only set the publication mode using + the long syntax. For more information refer to + [Use swarm mode routing mesh](https://docs.docker.com/engine/swarm/ingress/). + + ### Provide credential specs for managed service accounts (Windows only) + + This option is only used for services using Windows containers. The + `--credential-spec` must be in the format `file://` or + `registry://`. + + When using the `file://` format, the referenced file must be + present in the `CredentialSpecs` subdirectory in the docker data directory, + which defaults to `C:\ProgramData\Docker\` on Windows. For example, + specifying `file://spec.json` loads `C:\ProgramData\Docker\CredentialSpecs\spec.json`. + + When using the `registry://` format, the credential spec is + read from the Windows registry on the daemon's host. The specified + registry value must be located in: + + HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization\Containers\CredentialSpecs + + + ### Create services using templates + + You can use templates for some flags of `service create`, using the syntax + provided by the Go's [text/template](http://golang.org/pkg/text/template/) package. + + The supported flags are the following : + + - `--hostname` + - `--mount` + - `--env` + + Valid placeholders for the Go template are listed below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlaceholderDescription
.Service.IDService ID
.Service.NameService name
.Service.LabelsService labels
.Node.IDNode ID
.Node.HostnameNode Hostname
.Task.IDTask ID
.Task.NameTask name
.Task.SlotTask slot
+ + + #### Template example + + In this example, we are going to set the template of the created containers based on the + service's name, the node's ID and hostname where it sits. + + ```bash + $ docker service create \ + --name hosttempl \ + --hostname="{{.Node.Hostname}}-{{.Node.ID}}-{{.Service.Name}}"\ + busybox top + + va8ew30grofhjoychbr6iot8c + + $ docker service ps va8ew30grofhjoychbr6iot8c + + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + wo41w8hg8qan hosttempl.1 busybox:latest@sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912 2e7a8a9c4da2 Running Running about a minute ago + + $ docker inspect --format="{{.Config.Hostname}}" 2e7a8a9c4da2-wo41w8hg8qanxwjwsg4kxpprj-hosttempl + + x3ti0erg11rjpg64m75kej2mz-hosttempl + ``` + + ### Specify isolation mode (Windows) + + By default, tasks scheduled on Windows nodes are run using the default isolation mode + configured for this particular node. To force a specific isolation mode, you can use + the `--isolation` flag: + + ```bash + $ docker service create --name myservice --isolation=process microsoft/nanoserver + ``` + + Supported isolation modes on Windows are: + - `default`: use default settings specified on the node running the task + - `process`: use process isolation (Windows server only) + - `hyperv`: use Hyper-V isolation + + ### Create services requesting Generic Resources + + You can narrow the kind of nodes your task can land on through the using the + `--generic-resource` flag (if the nodes advertise these resources): + + ```bash + $ docker service create \ + --name cuda \ + --generic-resource "NVIDIA-GPU=2" \ + --generic-resource "SSD=1" \ + nvidia/cuda + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_inspect.yaml b/_data/engine-cli/docker_service_inspect.yaml new file mode 100644 index 0000000..6e77d2e --- /dev/null +++ b/_data/engine-cli/docker_service_inspect.yaml @@ -0,0 +1,169 @@ +command: docker service inspect +short: Display detailed information on one or more services +long: |- + Inspects the specified service. + + By default, this renders all results in a JSON array. If a format is specified, + the given template will be executed for each result. + + Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service inspect [OPTIONS] SERVICE [SERVICE...] +pname: docker service +plink: docker_service.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pretty + value_type: bool + default_value: "false" + description: Print the information in a human friendly format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Inspect a service by name or ID + + You can inspect a service, either by its *name*, or *ID* + + For example, given the following service; + + ```bash + $ docker service ls + ID NAME MODE REPLICAS IMAGE + dmu1ept4cxcf redis replicated 3/3 redis:3.0.6 + ``` + + Both `docker service inspect redis`, and `docker service inspect dmu1ept4cxcf` + produce the same result: + + ```bash + $ docker service inspect redis + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "ID": "dmu1ept4cxcfe8k8lhtux3ro3", + "Version": { + "Index": 12 + }, + "CreatedAt": "2016-06-17T18:44:02.558012087Z", + "UpdatedAt": "2016-06-17T18:44:02.558012087Z", + "Spec": { + "Name": "redis", + "TaskTemplate": { + "ContainerSpec": { + "Image": "redis:3.0.6" + }, + "Resources": { + "Limits": {}, + "Reservations": {} + }, + "RestartPolicy": { + "Condition": "any", + "MaxAttempts": 0 + }, + "Placement": {} + }, + "Mode": { + "Replicated": { + "Replicas": 1 + } + }, + "UpdateConfig": {}, + "EndpointSpec": { + "Mode": "vip" + } + }, + "Endpoint": { + "Spec": {} + } + } + ] + ``` + + ```bash + $ docker service inspect dmu1ept4cxcf + + [ + { + "ID": "dmu1ept4cxcfe8k8lhtux3ro3", + "Version": { + "Index": 12 + }, + ... + } + ] + ``` + + ### Formatting + + You can print the inspect output in a human-readable format instead of the default + JSON output, by using the `--pretty` option: + + ```bash + $ docker service inspect --pretty frontend + + ID: c8wgl7q4ndfd52ni6qftkvnnp + Name: frontend + Labels: + - org.example.projectname=demo-app + Service Mode: REPLICATED + Replicas: 5 + Placement: + UpdateConfig: + Parallelism: 0 + On failure: pause + Max failure ratio: 0 + ContainerSpec: + Image: nginx:alpine + Resources: + Networks: net1 + Endpoint Mode: vip + Ports: + PublishedPort = 4443 + Protocol = tcp + TargetPort = 443 + PublishMode = ingress + ``` + + You can also use `--format pretty` for the same effect. + + + #### Find the number of tasks running as part of a service + + The `--format` option can be used to obtain specific information about a + service. For example, the following command outputs the number of replicas + of the "redis" service. + + ```bash + $ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis + + 10 + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_logs.yaml b/_data/engine-cli/docker_service_logs.yaml new file mode 100644 index 0000000..859e375 --- /dev/null +++ b/_data/engine-cli/docker_service_logs.yaml @@ -0,0 +1,148 @@ +command: docker service logs +short: Fetch the logs of a service or task +long: |- + The `docker service logs` command batch-retrieves logs present at the time of execution. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. + + The `docker service logs` command can be used with either the name or ID of a + service, or with the ID of a task. If a service is passed, it will display logs + for all of the containers in that service. If a task is passed, it will only + display logs from that particular task. + + > **Note** + > + > This command is only functional for services that are started with + > the `json-file` or `journald` logging driver. + + For more information about selecting and configuring logging drivers, refer to + [Configure logging drivers](https://docs.docker.com/config/containers/logging/configure/). + + The `docker service logs --follow` command will continue streaming the new output from + the service's `STDOUT` and `STDERR`. + + Passing a negative number or a non-integer to `--tail` is invalid and the + value is set to `all` in that case. + + The `docker service logs --timestamps` command will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants) + , for example `2014-09-16T06:17:46.000000000Z`, to each + log entry. To ensure that the timestamps are aligned the + nano-second part of the timestamp will be padded with zero when necessary. + + The `docker service logs --details` command will add on extra attributes, such as + environment variables and labels, provided to `--log-opt` when creating the + service. + + The `--since` option shows only the service logs generated after + a given date. You can specify the date as an RFC 3339 date, a UNIX + timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Besides RFC3339 date + format you may also use RFC3339Nano, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the client will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. You can combine the + `--since` option with either or both of the `--follow` or `--tail` options. +usage: docker service logs [OPTIONS] SERVICE|TASK +pname: docker service +plink: docker_service.yaml +options: +- option: details + value_type: bool + default_value: "false" + description: Show extra details provided to logs + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: follow + shorthand: f + value_type: bool + default_value: "false" + description: Follow log output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-resolve + value_type: bool + default_value: "false" + description: Do not map IDs to Names in output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-task-ids + value_type: bool + default_value: "false" + description: Do not include task IDs in output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: raw + value_type: bool + default_value: "false" + description: Do not neatly format logs + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: since + value_type: string + description: | + Show logs since timestamp (e.g. 2013-01-02T13:23:37) or relative (e.g. 42m for 42 minutes) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tail + value_type: string + default_value: all + description: Number of lines to show from the end of the logs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: timestamps + shorthand: t + value_type: bool + default_value: "false" + description: Show timestamps + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.29" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_ls.yaml b/_data/engine-cli/docker_service_ls.yaml new file mode 100644 index 0000000..d10b982 --- /dev/null +++ b/_data/engine-cli/docker_service_ls.yaml @@ -0,0 +1,166 @@ +command: docker service ls +aliases: list +short: List services +long: |- + This command lists services are running in the swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service ls [OPTIONS] +pname: docker service +plink: docker_service.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print services using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + On a manager node: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + c8wgl7q4ndfd frontend replicated 5/5 nginx:alpine + dmu1ept4cxcf redis replicated 3/3 redis:3.0.6 + iwe3278osahj mongo global 7/7 mongo:3.3 + ``` + + The `REPLICAS` column shows both the *actual* and *desired* number of tasks for + the service. + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * [id](service_ls.md#id) + * [label](service_ls.md#label) + * [mode](service_ls.md#mode) + * [name](service_ls.md#name) + + #### id + + The `id` filter matches all or part of a service's id. + + ```bash + $ docker service ls -f "id=0bcjw" + ID NAME MODE REPLICAS IMAGE + 0bcjwfh8ychr redis replicated 1/1 redis:3.0.6 + ``` + + #### label + + The `label` filter matches services based on the presence of a `label` alone or + a `label` and a value. + + The following filter matches all services with a `project` label regardless of + its value: + + ```bash + $ docker service ls --filter label=project + ID NAME MODE REPLICAS IMAGE + 01sl1rp6nj5u frontend2 replicated 1/1 nginx:alpine + 36xvvwwauej0 frontend replicated 5/5 nginx:alpine + 74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 + ``` + + The following filter matches only services with the `project` label with the + `project-a` value. + + ```bash + $ docker service ls --filter label=project=project-a + ID NAME MODE REPLICAS IMAGE + 36xvvwwauej0 frontend replicated 5/5 nginx:alpine + 74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 + ``` + + #### mode + + The `mode` filter matches on the mode (either `replicated` or `global`) of a service. + + The following filter matches only `global` services. + + ```bash + $ docker service ls --filter mode=global + ID NAME MODE REPLICAS IMAGE + w7y0v2yrn620 top global 1/1 busybox + ``` + + #### name + + The `name` filter matches on all or part of a service's name. + + The following filter matches services with a name containing `redis`. + + ```bash + $ docker service ls --filter name=redis + ID NAME MODE REPLICAS IMAGE + 0bcjwfh8ychr redis replicated 1/1 redis:3.0.6 + ``` + + ### Formatting + + The formatting options (`--format`) pretty-prints services output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ------------|------------------------------------------------------------------------------------------ + `.ID` | Service ID + `.Name` | Service name + `.Mode` | Service mode (replicated, global) + `.Replicas` | Service replicas + `.Image` | Service image + `.Ports` | Service ports published in ingress mode + + When using the `--format` option, the `service ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `ID`, `Mode`, and `Replicas` entries separated by a colon (`:`) for all services: + + ```bash + $ docker service ls --format "{{.ID}}: {{.Mode}} {{.Replicas}}" + + 0zmvwuiu3vue: replicated 10/10 + fm6uf97exkul: global 5/5 + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_ps.yaml b/_data/engine-cli/docker_service_ps.yaml new file mode 100644 index 0000000..3c77d1f --- /dev/null +++ b/_data/engine-cli/docker_service_ps.yaml @@ -0,0 +1,213 @@ +command: docker service ps +short: List the tasks of one or more services +long: |- + Lists the tasks that are running as part of the specified services. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service ps [OPTIONS] SERVICE [SERVICE...] +pname: docker service +plink: docker_service.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print tasks using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-resolve + value_type: bool + default_value: "false" + description: Do not map IDs to Names + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display task IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### List the tasks that are part of a service + + The following command shows all the tasks that are part of the `redis` service: + + ```bash + $ docker service ps redis + + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + 0qihejybwf1x redis.1 redis:3.0.5 manager1 Running Running 8 seconds + bk658fpbex0d redis.2 redis:3.0.5 worker2 Running Running 9 seconds + 5ls5s5fldaqg redis.3 redis:3.0.5 worker1 Running Running 9 seconds + 8ryt076polmc redis.4 redis:3.0.5 worker1 Running Running 9 seconds + 1x0v8yomsncd redis.5 redis:3.0.5 manager1 Running Running 8 seconds + 71v7je3el7rr redis.6 redis:3.0.5 worker2 Running Running 9 seconds + 4l3zm9b7tfr7 redis.7 redis:3.0.5 worker2 Running Running 9 seconds + 9tfpyixiy2i7 redis.8 redis:3.0.5 worker1 Running Running 9 seconds + 3w1wu13yupln redis.9 redis:3.0.5 manager1 Running Running 8 seconds + 8eaxrb2fqpbn redis.10 redis:3.0.5 manager1 Running Running 8 seconds + ``` + + In addition to _running_ tasks, the output also shows the task history. For + example, after updating the service to use the `redis:3.0.6` image, the output + may look like this: + + ```bash + $ docker service ps redis + + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + 50qe8lfnxaxk redis.1 redis:3.0.6 manager1 Running Running 6 seconds ago + ky2re9oz86r9 \_ redis.1 redis:3.0.5 manager1 Shutdown Shutdown 8 seconds ago + 3s46te2nzl4i redis.2 redis:3.0.6 worker2 Running Running less than a second ago + nvjljf7rmor4 \_ redis.2 redis:3.0.6 worker2 Shutdown Rejected 23 seconds ago "No such image: redis@sha256:6…" + vtiuz2fpc0yb \_ redis.2 redis:3.0.5 worker2 Shutdown Shutdown 1 second ago + jnarweeha8x4 redis.3 redis:3.0.6 worker1 Running Running 3 seconds ago + vs448yca2nz4 \_ redis.3 redis:3.0.5 worker1 Shutdown Shutdown 4 seconds ago + jf1i992619ir redis.4 redis:3.0.6 worker1 Running Running 10 seconds ago + blkttv7zs8ee \_ redis.4 redis:3.0.5 worker1 Shutdown Shutdown 11 seconds ago + ``` + + The number of items in the task history is determined by the + `--task-history-limit` option that was set when initializing the swarm. You can + change the task history retention limit using the + [`docker swarm update`](swarm_update.md) command. + + When deploying a service, docker resolves the digest for the service's + image, and pins the service to that digest. The digest is not shown by + default, but is printed if `--no-trunc` is used. The `--no-trunc` option + also shows the non-truncated task ID, and error-messages, as can be seen below; + + ```bash + $ docker service ps --no-trunc redis + + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + 50qe8lfnxaxksi9w2a704wkp7 redis.1 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 manager1 Running Running 5 minutes ago + ky2re9oz86r9556i2szb8a8af \_ redis.1 redis:3.0.5@sha256:f8829e00d95672c48c60f468329d6693c4bdd28d1f057e755f8ba8b40008682e worker2 Shutdown Shutdown 5 minutes ago + bk658fpbex0d57cqcwoe3jthu redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Running Running 5 seconds + nvjljf7rmor4htv7l8rwcx7i7 \_ redis.2 redis:3.0.6@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842 worker2 Shutdown Rejected 5 minutes ago "No such image: redis@sha256:6a692a76c2081888b589e26e6ec835743119fe453d67ecf03df7de5b73d69842" + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there + is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). + Multiple filter flags are combined as an `OR` filter. For example, + `-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks. + + The currently supported filters are: + + * [id](#id) + * [name](#name) + * [node](#node) + * [desired-state](#desired-state) + + + #### id + + The `id` filter matches on all or a prefix of a task's ID. + + ```bash + $ docker service ps -f "id=8" redis + + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + 8ryt076polmc redis.4 redis:3.0.6 worker1 Running Running 9 seconds + 8eaxrb2fqpbn redis.10 redis:3.0.6 manager1 Running Running 8 seconds + ``` + + #### name + + The `name` filter matches on task names. + + ```bash + $ docker service ps -f "name=redis.1" redis + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + qihejybwf1x5 redis.1 redis:3.0.6 manager1 Running Running 8 seconds + ``` + + + #### node + + The `node` filter matches on a node name or a node ID. + + ```bash + $ docker service ps -f "node=manager1" redis + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + 0qihejybwf1x redis.1 redis:3.0.6 manager1 Running Running 8 seconds + 1x0v8yomsncd redis.5 redis:3.0.6 manager1 Running Running 8 seconds + 3w1wu13yupln redis.9 redis:3.0.6 manager1 Running Running 8 seconds + 8eaxrb2fqpbn redis.10 redis:3.0.6 manager1 Running Running 8 seconds + ``` + + #### desired-state + + The `desired-state` filter can take the values `running`, `shutdown`, or `accepted`. + + ### Formatting + + The formatting options (`--format`) pretty-prints tasks output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ----------------|------------------------------------------------------------------------------------------ + `.ID` | Task ID + `.Name` | Task name + `.Image` | Task image + `.Node` | Node ID + `.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`) + `.CurrentState` | Current state of the task + `.Error` | Error + `.Ports` | Task published ports + + When using the `--format` option, the `service ps` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Name` and `Image` entries separated by a colon (`:`) for all tasks: + + ```bash + $ docker service ps --format "{{.Name}}: {{.Image}}" top + top.1: busybox + top.2: busybox + top.3: busybox + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_rm.yaml b/_data/engine-cli/docker_service_rm.yaml new file mode 100644 index 0000000..02a5fc1 --- /dev/null +++ b/_data/engine-cli/docker_service_rm.yaml @@ -0,0 +1,39 @@ +command: docker service rm +aliases: remove +short: Remove one or more services +long: |- + Removes the specified services from the swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service rm SERVICE [SERVICE...] +pname: docker service +plink: docker_service.yaml +examples: |- + Remove the `redis` service: + + ```bash + $ docker service rm redis + + redis + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + ``` + + > **Warning** + > + > Unlike `docker rm`, this command does not ask for confirmation before removing + > a running service. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_rollback.yaml b/_data/engine-cli/docker_service_rollback.yaml new file mode 100644 index 0000000..b058155 --- /dev/null +++ b/_data/engine-cli/docker_service_rollback.yaml @@ -0,0 +1,93 @@ +command: docker service rollback +short: Revert changes to a service's configuration +long: |- + Roll back a specified service to its previous version from the swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service rollback [OPTIONS] SERVICE +pname: docker service +plink: docker_service.yaml +options: +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: | + Exit immediately instead of waiting for the service to converge + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress progress output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Roll back to the previous version of a service + + Use the `docker service rollback` command to roll back to the previous version + of a service. After executing this command, the service is reverted to the + configuration that was in place before the most recent `docker service update` + command. + + The following example creates a service with a single replica, updates the + service to use three replicas, and then rolls back the service to the + previous version, having one replica. + + Create a service with a single replica: + + ```bash + $ docker service create --name my-service -p 8080:80 nginx:alpine + ``` + + Confirm that the service is running with a single replica: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE PORTS + xbw728mf6q0d my-service replicated 1/1 nginx:alpine *:8080->80/tcp + ``` + + Update the service to use three replicas: + + ```bash + $ docker service update --replicas=3 my-service + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE PORTS + xbw728mf6q0d my-service replicated 3/3 nginx:alpine *:8080->80/tcp + ``` + + Now roll back the service to its previous version, and confirm it is + running a single replica again: + + ```bash + $ docker service rollback my-service + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE PORTS + xbw728mf6q0d my-service replicated 1/1 nginx:alpine *:8080->80/tcp + ``` +deprecated: false +min_api_version: "1.31" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_scale.yaml b/_data/engine-cli/docker_service_scale.yaml new file mode 100644 index 0000000..23d9c04 --- /dev/null +++ b/_data/engine-cli/docker_service_scale.yaml @@ -0,0 +1,97 @@ +command: docker service scale +short: Scale one or multiple replicated services +long: |- + The scale command enables you to scale one or more replicated services either up + or down to the desired number of replicas. This command cannot be applied on + services which are global mode. The command will return immediately, but the + actual scaling of the service may take some time. To stop all replicas of a + service while keeping the service active in the swarm you can set the scale to 0. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...] +pname: docker service +plink: docker_service.yaml +options: +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: | + Exit immediately instead of waiting for the service to converge + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Scale a single service + + The following command scales the "frontend" service to 50 tasks. + + ```bash + $ docker service scale frontend=50 + + frontend scaled to 50 + ``` + + The following command tries to scale a global service to 10 tasks and returns an error. + + ```bash + $ docker service create --mode global --name backend backend:latest + + b4g08uwuairexjub6ome6usqh + + $ docker service scale backend=10 + + backend: scale can only be used with replicated mode + ``` + + Directly afterwards, run `docker service ls`, to see the actual number of + replicas. + + ```bash + $ docker service ls --filter name=frontend + + ID NAME MODE REPLICAS IMAGE + 3pr5mlvu3fh9 frontend replicated 15/50 nginx:alpine + ``` + + You can also scale a service using the [`docker service update`](service_update.md) + command. The following commands are equivalent: + + ```bash + $ docker service scale frontend=50 + $ docker service update --replicas=50 frontend + ``` + + ### Scale multiple services + + The `docker service scale` command allows you to set the desired number of + tasks for multiple services at once. The following example scales both the + backend and frontend services: + + ```bash + $ docker service scale backend=3 frontend=5 + + backend scaled to 3 + frontend scaled to 5 + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 3pr5mlvu3fh9 frontend replicated 5/5 nginx:alpine + 74nzcxxjv6fq backend replicated 3/3 redis:3.0.6 + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_service_update.yaml b/_data/engine-cli/docker_service_update.yaml new file mode 100644 index 0000000..d67a6db --- /dev/null +++ b/_data/engine-cli/docker_service_update.yaml @@ -0,0 +1,962 @@ +command: docker service update +short: Update a service +long: |- + Updates a service as described by the specified parameters. The parameters are + the same as [`docker service create`](service_create.md). Refer to the description + there for further information. + + Normally, updating a service will only cause the service's tasks to be replaced with new ones if a change to the + service requires recreating the tasks for it to take effect. For example, only changing the + `--update-parallelism` setting will not recreate the tasks, because the individual tasks are not affected by this + setting. However, the `--force` flag will cause the tasks to be recreated anyway. This can be used to perform a + rolling restart without any changes to the service parameters. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker service update [OPTIONS] SERVICE +pname: docker service +plink: docker_service.yaml +options: +- option: args + value_type: command + description: Service command args + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: config-add + value_type: config + description: Add or update a config file on a service + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: config-rm + value_type: list + description: Remove a configuration file + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: constraint-add + value_type: list + description: Add or update a placement constraint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: constraint-rm + value_type: list + description: Remove a constraint + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: container-label-add + value_type: list + description: Add or update a container label + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: container-label-rm + value_type: list + description: Remove a container label by its key + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: credential-spec + value_type: credential-spec + description: Credential spec for managed service account (Windows only) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: | + Exit immediately instead of waiting for the service to converge + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-add + value_type: list + description: Add or update a custom DNS server + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option-add + value_type: list + description: Add or update a DNS option + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-option-rm + value_type: list + description: Remove a DNS option + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-rm + value_type: list + description: Remove a custom DNS server + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search-add + value_type: list + description: Add or update a custom DNS search domain + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dns-search-rm + value_type: list + description: Remove a DNS search domain + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: endpoint-mode + value_type: string + description: Endpoint mode (vip or dnsrr) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: entrypoint + value_type: command + description: Overwrite the default ENTRYPOINT of the image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-add + value_type: list + description: Add or update an environment variable + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: env-rm + value_type: list + description: Remove an environment variable + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + value_type: bool + default_value: "false" + description: Force update even if no changes require it + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: generic-resource-add + value_type: list + description: Add a Generic resource + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: generic-resource-rm + value_type: list + description: Remove a Generic resource + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-add + value_type: list + description: Add an additional supplementary user group to the container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: group-rm + value_type: list + description: | + Remove a previously added supplementary user group from the container + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-cmd + value_type: string + description: Command to run to check health + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-interval + value_type: duration + description: Time between running the check (ms|s|m|h) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-retries + value_type: int + default_value: "0" + description: Consecutive failures needed to report unhealthy + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-start-period + value_type: duration + description: | + Start period for the container to initialize before counting retries towards unstable (ms|s|m|h) + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: health-timeout + value_type: duration + description: Maximum time to allow one check to run (ms|s|m|h) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: host-add + value_type: list + description: Add a custom host-to-IP mapping (host:ip) + deprecated: false + min_api_version: "1.32" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: host-rm + value_type: list + description: Remove a custom host-to-IP mapping (host:ip) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: hostname + value_type: string + description: Container hostname + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: image + value_type: string + description: Service image tag + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: init + value_type: bool + default_value: "false" + description: | + Use an init inside each service container to forward signals and reap processes + deprecated: false + min_api_version: "1.37" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: isolation + value_type: string + description: Service container isolation mode + deprecated: false + min_api_version: "1.35" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-add + value_type: list + description: Add or update a service label + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label-rm + value_type: list + description: Remove a label by its key + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: limit-cpu + value_type: decimal + description: Limit CPUs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: limit-memory + value_type: bytes + default_value: "0" + description: Limit Memory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-driver + value_type: string + description: Logging driver for service + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: log-opt + value_type: list + description: Logging driver options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount-add + value_type: mount + description: Add or update a mount on a service + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: mount-rm + value_type: list + description: Remove a mount by its target path + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-add + value_type: network + description: Add a network + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: network-rm + value_type: list + description: Remove a network + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-healthcheck + value_type: bool + default_value: "false" + description: Disable any container-specified HEALTHCHECK + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-resolve-image + value_type: bool + default_value: "false" + description: | + Do not query the registry to resolve image digest and supported platforms + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: placement-pref-add + value_type: pref + description: Add a placement preference + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: placement-pref-rm + value_type: pref + description: Remove a placement preference + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-add + value_type: port + description: Add or update a published port + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: publish-rm + value_type: port + description: Remove a published port by its target port + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress progress output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: read-only + value_type: bool + default_value: "false" + description: Mount the container's root filesystem as read only + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: replicas + value_type: uint + description: Number of tasks + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: replicas-max-per-node + value_type: uint64 + default_value: "0" + description: Maximum number of tasks per node (default 0 = unlimited) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: reserve-cpu + value_type: decimal + description: Reserve CPUs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: reserve-memory + value_type: bytes + default_value: "0" + description: Reserve Memory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-condition + value_type: string + description: Restart when condition is met ("none"|"on-failure"|"any") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-delay + value_type: duration + description: Delay between restart attempts (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-max-attempts + value_type: uint + description: Maximum number of restarts before giving up + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart-window + value_type: duration + description: Window used to evaluate the restart policy (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback + value_type: bool + default_value: "false" + description: Rollback to previous specification + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-delay + value_type: duration + default_value: 0s + description: Delay between task rollbacks (ns|us|ms|s|m|h) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-failure-action + value_type: string + description: Action on rollback failure ("pause"|"continue") + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-max-failure-ratio + value_type: float + default_value: "0" + description: Failure rate to tolerate during a rollback + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-monitor + value_type: duration + default_value: 0s + description: | + Duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-order + value_type: string + description: Rollback order ("start-first"|"stop-first") + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rollback-parallelism + value_type: uint64 + default_value: "0" + description: | + Maximum number of tasks rolled back simultaneously (0 to roll back all at once) + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret-add + value_type: secret + description: Add or update a secret on a service + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: secret-rm + value_type: list + description: Remove a secret + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-grace-period + value_type: duration + description: | + Time to wait before force killing a container (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: stop-signal + value_type: string + description: Signal to stop the container + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl-add + value_type: list + description: Add or update a Sysctl option + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: sysctl-rm + value_type: list + description: Remove a Sysctl option + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: tty + shorthand: t + value_type: bool + default_value: "false" + description: Allocate a pseudo-TTY + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-delay + value_type: duration + default_value: 0s + description: Delay between updates (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-failure-action + value_type: string + description: Action on update failure ("pause"|"continue"|"rollback") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-max-failure-ratio + value_type: float + default_value: "0" + description: Failure rate to tolerate during an update + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-monitor + value_type: duration + default_value: 0s + description: | + Duration after each task update to monitor for failure (ns|us|ms|s|m|h) + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-order + value_type: string + description: Update order ("start-first"|"stop-first") + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: update-parallelism + value_type: uint64 + default_value: "0" + description: | + Maximum number of tasks updated simultaneously (0 to update all at once) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: user + shorthand: u + value_type: string + description: 'Username or UID (format: [:])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Send registry authentication details to swarm agents + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: workdir + shorthand: w + value_type: string + description: Working directory inside the container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Update a service + + ```bash + $ docker service update --limit-cpu 2 redis + ``` + + ### Perform a rolling restart with no parameter changes + + ```bash + $ docker service update --force --update-parallelism 1 --update-delay 30s redis + ``` + + In this example, the `--force` flag causes the service's tasks to be shut down + and replaced with new ones even though none of the other parameters would + normally cause that to happen. The `--update-parallelism 1` setting ensures + that only one task is replaced at a time (this is the default behavior). The + `--update-delay 30s` setting introduces a 30 second delay between tasks, so + that the rolling restart happens gradually. + + ### Add or remove mounts + + Use the `--mount-add` or `--mount-rm` options add or remove a service's bind mounts + or volumes. + + The following example creates a service which mounts the `test-data` volume to + `/somewhere`. The next step updates the service to also mount the `other-volume` + volume to `/somewhere-else`volume, The last step unmounts the `/somewhere` mount + point, effectively removing the `test-data` volume. Each command returns the + service name. + + - The `--mount-add` flag takes the same parameters as the `--mount` flag on + `service create`. Refer to the [volumes and bind mounts](service_create.md#add-bind-mounts-volumes-or-memory-filesystems) + section in the `service create` reference for details. + + - The `--mount-rm` flag takes the `target` path of the mount. + + ```bash + $ docker service create \ + --name=myservice \ + --mount type=volume,source=test-data,target=/somewhere \ + nginx:alpine + + myservice + + $ docker service update \ + --mount-add type=volume,source=other-volume,target=/somewhere-else \ + myservice + + myservice + + $ docker service update --mount-rm /somewhere myservice + + myservice + ``` + + ### Add or remove published service ports + + Use the `--publish-add` or `--publish-rm` flags to add or remove a published + port for a service. You can use the short or long syntax discussed in the + [docker service create](service_create.md#publish-service-ports-externally-to-the-swarm--p---publish) + reference. + + The following example adds a published service port to an existing service. + + ```bash + $ docker service update \ + --publish-add published=8080,target=80 \ + myservice + ``` + + ### Add or remove network + + Use the `--network-add` or `--network-rm` flags to add or remove a network for + a service. You can use the short or long syntax discussed in the + [docker service create](service_create.md#attach-a-service-to-an-existing-network---network) + reference. + + The following example adds a new alias name to an existing service already connected to network my-network: + + ```bash + $ docker service update \ + --network-rm my-network \ + --network-add name=my-network,alias=web1 \ + myservice + ``` + + ### Roll back to the previous version of a service + + Use the `--rollback` option to roll back to the previous version of the service. + + This will revert the service to the configuration that was in place before the most recent `docker service update` command. + + The following example updates the number of replicas for the service from 4 to 5, and then rolls back to the previous configuration. + + ```bash + $ docker service update --replicas=5 web + + web + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 80bvrzp6vxf3 web replicated 0/5 nginx:alpine + + ``` + Roll back the `web` service... + + ```bash + $ docker service update --rollback web + + web + + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 80bvrzp6vxf3 web replicated 0/4 nginx:alpine + + ``` + + Other options can be combined with `--rollback` as well, for example, `--update-delay 0s` to execute the rollback without a delay between tasks: + + ```bash + $ docker service update \ + --rollback \ + --update-delay 0s + web + + web + + ``` + + Services can also be set up to roll back to the previous version automatically + when an update fails. To set up a service for automatic rollback, use + `--update-failure-action=rollback`. A rollback will be triggered if the fraction + of the tasks which failed to update successfully exceeds the value given with + `--update-max-failure-ratio`. + + The rate, parallelism, and other parameters of a rollback operation are + determined by the values passed with the following flags: + + - `--rollback-delay` + - `--rollback-failure-action` + - `--rollback-max-failure-ratio` + - `--rollback-monitor` + - `--rollback-parallelism` + + For example, a service set up with `--update-parallelism 1 --rollback-parallelism 3` + will update one task at a time during a normal update, but during a rollback, 3 + tasks at a time will get rolled back. These rollback parameters are respected both + during automatic rollbacks and for rollbacks initiated manually using `--rollback`. + + ### Add or remove secrets + + Use the `--secret-add` or `--secret-rm` options add or remove a service's + secrets. + + The following example adds a secret named `ssh-2` and removes `ssh-1`: + + ```bash + $ docker service update \ + --secret-add source=ssh-2,target=ssh-2 \ + --secret-rm ssh-1 \ + myservice + ``` + + ### Update services using templates + + Some flags of `service update` support the use of templating. + See [`service create`](service_create.md#create-services-using-templates) for the reference. + + + ### Specify isolation mode (Windows) + + `service update` supports the same `--isolation` flag as `service create` + See [`service create`](service_create.md) for the reference. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_stack.yaml b/_data/engine-cli/docker_stack.yaml new file mode 100644 index 0000000..3c378f8 --- /dev/null +++ b/_data/engine-cli/docker_stack.yaml @@ -0,0 +1,42 @@ +command: docker stack +short: Manage Docker stacks +long: Manage stacks. +usage: docker stack [OPTIONS] +pname: docker +plink: docker.yaml +cname: +- docker stack deploy +- docker stack ls +- docker stack ps +- docker stack rm +- docker stack services +clink: +- docker_stack_deploy.yaml +- docker_stack_ls.yaml +- docker_stack_ps.yaml +- docker_stack_rm.yaml +- docker_stack_services.yaml +options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stack_deploy.yaml b/_data/engine-cli/docker_stack_deploy.yaml new file mode 100644 index 0000000..e291eca --- /dev/null +++ b/_data/engine-cli/docker_stack_deploy.yaml @@ -0,0 +1,194 @@ +command: docker stack deploy +aliases: up +short: Deploy a new stack or update an existing stack +long: |- + Create and update a stack from a `compose` file on the swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker stack deploy [OPTIONS] STACK +pname: docker stack +plink: docker_stack.yaml +options: +- option: bundle-file + value_type: string + description: Path to a Distributed Application Bundle file + deprecated: false + experimental: true + experimentalcli: false + kubernetes: false + swarm: true +- option: compose-file + shorthand: c + value_type: stringSlice + default_value: '[]' + description: Path to a Compose file, or "-" to read from stdin + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: namespace + value_type: string + description: Kubernetes namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: prune + value_type: bool + default_value: "false" + description: Prune services that are no longer referenced + deprecated: false + min_api_version: "1.27" + experimental: false + experimentalcli: false + kubernetes: false + swarm: true +- option: resolve-image + value_type: string + default_value: always + description: | + Query the registry to resolve image digest and supported platforms ("always"|"changed"|"never") + deprecated: false + min_api_version: "1.30" + experimental: false + experimentalcli: false + kubernetes: false + swarm: true +- option: with-registry-auth + value_type: bool + default_value: "false" + description: Send registry authentication details to Swarm agents + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: true +inherited_options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Compose file + + The `deploy` command supports compose file version `3.0` and above. + + ```bash + $ docker stack deploy --compose-file docker-compose.yml vossibility + + Ignoring unsupported options: links + + Creating network vossibility_vossibility + Creating network vossibility_default + Creating service vossibility_nsqd + Creating service vossibility_logstash + Creating service vossibility_elasticsearch + Creating service vossibility_kibana + Creating service vossibility_ghollector + Creating service vossibility_lookupd + ``` + + The Compose file can also be provided as standard input with `--compose-file -`: + + ```bash + $ cat docker-compose.yml | docker stack deploy --compose-file - vossibility + + Ignoring unsupported options: links + + Creating network vossibility_vossibility + Creating network vossibility_default + Creating service vossibility_nsqd + Creating service vossibility_logstash + Creating service vossibility_elasticsearch + Creating service vossibility_kibana + Creating service vossibility_ghollector + Creating service vossibility_lookupd + ``` + + If your configuration is split between multiple Compose files, e.g. a base + configuration and environment-specific overrides, you can provide multiple + `--compose-file` flags. + + ```bash + $ docker stack deploy --compose-file docker-compose.yml -c docker-compose.prod.yml vossibility + + Ignoring unsupported options: links + + Creating network vossibility_vossibility + Creating network vossibility_default + Creating service vossibility_nsqd + Creating service vossibility_logstash + Creating service vossibility_elasticsearch + Creating service vossibility_kibana + Creating service vossibility_ghollector + Creating service vossibility_lookupd + ``` + + You can verify that the services were correctly created: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 29bv0vnlm903 vossibility_lookupd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 + 4awt47624qwh vossibility_nsqd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 + 4tjx9biia6fs vossibility_elasticsearch replicated 1/1 elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa + 7563uuzr9eys vossibility_kibana replicated 1/1 kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03 + 9gc5m4met4he vossibility_logstash replicated 1/1 logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe + axqh55ipl40h vossibility_vossibility-collector replicated 1/1 icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba + ``` + + ### DAB file + + ```bash + $ docker stack deploy --bundle-file vossibility-stack.dab vossibility + + Loading bundle from vossibility-stack.dab + Creating service vossibility_elasticsearch + Creating service vossibility_kibana + Creating service vossibility_logstash + Creating service vossibility_lookupd + Creating service vossibility_nsqd + Creating service vossibility_vossibility-collector + ``` + + You can verify that the services were correctly created: + + ```bash + $ docker service ls + + ID NAME MODE REPLICAS IMAGE + 29bv0vnlm903 vossibility_lookupd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 + 4awt47624qwh vossibility_nsqd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662 + 4tjx9biia6fs vossibility_elasticsearch replicated 1/1 elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa + 7563uuzr9eys vossibility_kibana replicated 1/1 kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03 + 9gc5m4met4he vossibility_logstash replicated 1/1 logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe + axqh55ipl40h vossibility_vossibility-collector replicated 1/1 icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stack_ls.yaml b/_data/engine-cli/docker_stack_ls.yaml new file mode 100644 index 0000000..ea3c9db --- /dev/null +++ b/_data/engine-cli/docker_stack_ls.yaml @@ -0,0 +1,102 @@ +command: docker stack ls +aliases: list +short: List stacks +long: |- + Lists the stacks. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker stack ls [OPTIONS] +pname: docker stack +plink: docker_stack.yaml +options: +- option: all-namespaces + value_type: bool + default_value: "false" + description: List stacks from all Kubernetes namespaces + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: format + value_type: string + description: Pretty-print stacks using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: namespace + value_type: stringSlice + default_value: '[]' + description: Kubernetes namespaces to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +inherited_options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following command shows all stacks and some additional information: + + ```bash + $ docker stack ls + + ID SERVICES ORCHESTRATOR + myapp 2 Kubernetes + vossibility-stack 6 Swarm + ``` + + ### Formatting + + The formatting option (`--format`) pretty-prints stacks using a Go template. + + Valid placeholders for the Go template are listed below: + + | Placeholder | Description | + | --------------- | ------------------ | + | `.Name` | Stack name | + | `.Services` | Number of services | + | `.Orchestrator` | Orchestrator name | + | `.Namespace` | Namespace | + + When using the `--format` option, the `stack ls` command either outputs + the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Name` and `Services` entries separated by a colon (`:`) for all stacks: + + ```bash + $ docker stack ls --format "{{.Name}}: {{.Services}}" + web-server: 1 + web-cache: 4 + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stack_ps.yaml b/_data/engine-cli/docker_stack_ps.yaml new file mode 100644 index 0000000..4176ec0 --- /dev/null +++ b/_data/engine-cli/docker_stack_ps.yaml @@ -0,0 +1,278 @@ +command: docker stack ps +short: List the tasks in the stack +long: |- + Lists the tasks that are running as part of the specified stack. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker stack ps [OPTIONS] STACK +pname: docker stack +plink: docker_stack.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print tasks using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: namespace + value_type: string + description: Kubernetes namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: no-resolve + value_type: bool + default_value: "false" + description: Do not map IDs to Names + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display task IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### List the tasks that are part of a stack + + The following command shows all the tasks that are part of the `voting` stack: + + ```bash + $ docker stack ps voting + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + xim5bcqtgk1b voting_worker.1 dockersamples/examplevotingapp_worker:latest node2 Running Running 2 minutes ago + q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 2 minutes ago + rx5yo0866nfx voting_vote.1 dockersamples/examplevotingapp_vote:before node3 Running Running 2 minutes ago + tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 2 minutes ago + w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 3 minutes ago + 6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 2 minutes ago + kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:before node2 Running Running 2 minutes ago + t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 3 minutes ago + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there + is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). + Multiple filter flags are combined as an `OR` filter. For example, + `-f name=redis.1 -f name=redis.7` returns both `redis.1` and `redis.7` tasks. + + The currently supported filters are: + + * [id](#id) + * [name](#name) + * [node](#node) + * [desired-state](#desired-state) + + #### id + + The `id` filter matches on all or a prefix of a task's ID. + + ```bash + $ docker stack ps -f "id=t" voting + ID NAME IMAGE NODE DESIRED STATE CURRENTSTATE ERROR PORTS + tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 14 minutes ago + t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 14 minutes ago + ``` + + #### name + + The `name` filter matches on task names. + + ```bash + $ docker stack ps -f "name=voting_redis" voting + ID NAME IMAGE NODE DESIRED STATE CURRENTSTATE ERROR PORTS + w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 17 minutes ago + t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 17 minutes ago + ``` + + #### node + + The `node` filter matches on a node name or a node ID. + + ```bash + $ docker stack ps -f "node=node1" voting + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 18 minutes ago + tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 18 minutes ago + 6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 18 minutes ago + ``` + + #### desired-state + + The `desired-state` filter can take the values `running`, `shutdown`, `ready` or `accepted`. + + ```bash + $ docker stack ps -f "desired-state=running" voting + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + xim5bcqtgk1b voting_worker.1 dockersamples/examplevotingapp_worker:latest node2 Running Running 21 minutes ago + q7yik0ks1in6 voting_result.1 dockersamples/examplevotingapp_result:before node1 Running Running 21 minutes ago + rx5yo0866nfx voting_vote.1 dockersamples/examplevotingapp_vote:before node3 Running Running 21 minutes ago + tz6j82jnwrx7 voting_db.1 postgres:9.4 node1 Running Running 21 minutes ago + w48spazhbmxc voting_redis.1 redis:alpine node2 Running Running 21 minutes ago + 6jj1m02freg1 voting_visualizer.1 dockersamples/visualizer:stable node1 Running Running 21 minutes ago + kqgdmededccb voting_vote.2 dockersamples/examplevotingapp_vote:before node2 Running Running 21 minutes ago + t72q3z038jeh voting_redis.2 redis:alpine node3 Running Running 21 minutes ago + ``` + + ### Formatting + + The formatting options (`--format`) pretty-prints tasks output using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ----------------|------------------------------------------------------------------------------------------ + `.ID` | Task ID + `.Name` | Task name + `.Image` | Task image + `.Node` | Node ID + `.DesiredState` | Desired state of the task (`running`, `shutdown`, or `accepted`) + `.CurrentState` | Current state of the task + `.Error` | Error + `.Ports` | Task published ports + + When using the `--format` option, the `stack ps` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Name` and `Image` entries separated by a colon (`:`) for all tasks: + + ```bash + $ docker stack ps --format "{{.Name}}: {{.Image}}" voting + voting_worker.1: dockersamples/examplevotingapp_worker:latest + voting_result.1: dockersamples/examplevotingapp_result:before + voting_vote.1: dockersamples/examplevotingapp_vote:before + voting_db.1: postgres:9.4 + voting_redis.1: redis:alpine + voting_visualizer.1: dockersamples/visualizer:stable + voting_vote.2: dockersamples/examplevotingapp_vote:before + voting_redis.2: redis:alpine + ``` + + ### Do not map IDs to Names + + The `--no-resolve` option shows IDs for task name, without mapping IDs to Names. + + ```bash + $ docker stack ps --no-resolve voting + ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS + xim5bcqtgk1b 10z9fjfqzsxnezo4hb81p8mqg.1 dockersamples/examplevotingapp_worker:latest qaqt4nrzo775jrx6detglho01 Running Running 30 minutes ago + q7yik0ks1in6 hbxltua1na7mgqjnidldv5m65.1 dockersamples/examplevotingapp_result:before mxpaef1tlh23s052erw88a4w5 Running Running 30 minutes ago + rx5yo0866nfx qyprtqw1g5nrki557i974ou1d.1 dockersamples/examplevotingapp_vote:before kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago + tz6j82jnwrx7 122f0xxngg17z52be7xspa72x.1 postgres:9.4 mxpaef1tlh23s052erw88a4w5 Running Running 31 minutes ago + w48spazhbmxc tg61x8myx563ueo3urmn1ic6m.1 redis:alpine qaqt4nrzo775jrx6detglho01 Running Running 31 minutes ago + 6jj1m02freg1 8cqlyi444kzd3panjb7edh26v.1 dockersamples/visualizer:stable mxpaef1tlh23s052erw88a4w5 Running Running 31 minutes ago + kqgdmededccb qyprtqw1g5nrki557i974ou1d.2 dockersamples/examplevotingapp_vote:before qaqt4nrzo775jrx6detglho01 Running Running 31 minutes ago + t72q3z038jeh tg61x8myx563ueo3urmn1ic6m.2 redis:alpine kanqcxfajd1r16wlnqcblobmm Running Running 31 minutes ago + ``` + + ### Do not truncate output + + When deploying a service, docker resolves the digest for the service's + image, and pins the service to that digest. The digest is not shown by + default, but is printed if `--no-trunc` is used. The `--no-trunc` option + also shows the non-truncated task IDs, and error-messages, as can be seen below: + + ```bash + $ docker stack ps --no-trunc voting + ID NAME IMAGE NODE DESIRED STATE CURREN STATE ERROR PORTS + xim5bcqtgk1bxqz91jzo4a1s5 voting_worker.1 dockersamples/examplevotingapp_worker:latest@sha256:3e4ddf59c15f432280a2c0679c4fc5a2ee5a797023c8ef0d3baf7b1385e9fed node2 Running Runnin 32 minutes ago + q7yik0ks1in6kv32gg6y6yjf7 voting_result.1 dockersamples/examplevotingapp_result:before@sha256:83b56996e930c292a6ae5187fda84dd6568a19d97cdb933720be15c757b7463 node1 Running Runnin 32 minutes ago + rx5yo0866nfxc58zf4irsss6n voting_vote.1 dockersamples/examplevotingapp_vote:before@sha256:8e64b182c87de902f2b72321c89b4af4e2b942d76d0b772532ff27ec4c6ebf6 node3 Running Runnin 32 minutes ago + tz6j82jnwrx7n2offljp3mn03 voting_db.1 postgres:9.4@sha256:6046af499eae34d2074c0b53f9a8b404716d415e4a03e68bc1d2f8064f2b027 node1 Running Runnin 32 minutes ago + w48spazhbmxcmbjfi54gs7x90 voting_redis.1 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node2 Running Runnin 32 minutes ago + 6jj1m02freg1n3z9n1evrzsbl voting_visualizer.1 dockersamples/visualizer:stable@sha256:f924ad66c8e94b10baaf7bdb9cd491ef4e982a1d048a56a17e02bf5945401e5 node1 Running Runnin 32 minutes ago + kqgdmededccbhz2wuc0e9hx7g voting_vote.2 dockersamples/examplevotingapp_vote:before@sha256:8e64b182c87de902f2b72321c89b4af4e2b942d76d0b772532ff27ec4c6ebf6 node2 Running Runnin 32 minutes ago + t72q3z038jehe1wbh9gdum076 voting_redis.2 redis:alpine@sha256:9cd405cd1ec1410eaab064a1383d0d8854d1ef74a54e1e4a92fb4ec7bdc3ee7 node3 Running Runnin 32 minutes ago + ``` + + ### Only display task IDs + + The `-q ` or `--quiet` option only shows IDs of the tasks in the stack. + This example outputs all task IDs of the "voting" stack; + + ```bash + $ docker stack ps -q voting + xim5bcqtgk1b + q7yik0ks1in6 + rx5yo0866nfx + tz6j82jnwrx7 + w48spazhbmxc + 6jj1m02freg1 + kqgdmededccb + t72q3z038jeh + ``` + + This option can be used to perform batch operations. For example, you can use + the task IDs as input for other commands, such as `docker inspect`. The + following example inspects all tasks of the "voting" stack; + + ```bash + $ docker inspect $(docker stack ps -q voting) + + [ + { + "ID": "xim5bcqtgk1b1gk0krq1", + "Version": { + (...) + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stack_rm.yaml b/_data/engine-cli/docker_stack_rm.yaml new file mode 100644 index 0000000..ec951fe --- /dev/null +++ b/_data/engine-cli/docker_stack_rm.yaml @@ -0,0 +1,84 @@ +command: docker stack rm +aliases: remove, down +short: Remove one or more stacks +long: |- + Remove the stack from the swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker stack rm [OPTIONS] STACK [STACK...] +pname: docker stack +plink: docker_stack.yaml +options: +- option: namespace + value_type: string + description: Kubernetes namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +inherited_options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Remove a stack + + This will remove the stack with the name `myapp`. Services, networks, and secrets associated with the stack will be removed. + + ```bash + $ docker stack rm myapp + + Removing service myapp_redis + Removing service myapp_web + Removing service myapp_lb + Removing network myapp_default + Removing network myapp_frontend + ``` + + ### Remove multiple stacks + + This will remove all the specified stacks, `myapp` and `vossibility`. Services, networks, and secrets associated with all the specified stacks will be removed. + + ```bash + $ docker stack rm myapp vossibility + + Removing service myapp_redis + Removing service myapp_web + Removing service myapp_lb + Removing network myapp_default + Removing network myapp_frontend + Removing service vossibility_nsqd + Removing service vossibility_logstash + Removing service vossibility_elasticsearch + Removing service vossibility_kibana + Removing service vossibility_ghollector + Removing service vossibility_lookupd + Removing network vossibility_default + Removing network vossibility_vossibility + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stack_services.yaml b/_data/engine-cli/docker_stack_services.yaml new file mode 100644 index 0000000..083da92 --- /dev/null +++ b/_data/engine-cli/docker_stack_services.yaml @@ -0,0 +1,150 @@ +command: docker stack services +short: List the services in the stack +long: |- + Lists the services that are running as part of the specified stack. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker stack services [OPTIONS] STACK +pname: docker stack +plink: docker_stack.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print services using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: namespace + value_type: string + description: Kubernetes namespace to use + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display IDs + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +inherited_options: +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +- option: orchestrator + value_type: string + description: Orchestrator to use (swarm|kubernetes|all) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following command shows all services in the `myapp` stack: + + ```bash + $ docker stack services myapp + + ID NAME REPLICAS IMAGE COMMAND + 7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f + dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there + is more than one filter, then pass multiple flags (e.g. `--filter "foo=bar" --filter "bif=baz"`). + Multiple filter flags are combined as an `OR` filter. + + The following command shows both the `web` and `db` services: + + ```bash + $ docker stack services --filter name=myapp_web --filter name=myapp_db myapp + + ID NAME REPLICAS IMAGE COMMAND + 7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f + dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 + ``` + + The currently supported filters are: + + * id / ID (`--filter id=7be5ei6sqeye`, or `--filter ID=7be5ei6sqeye`) + * Swarm: supported + * Kubernetes: not supported + * label (`--filter label=key=value`) + * Swarm: supported + * Kubernetes: supported + * mode (`--filter mode=replicated`, or `--filter mode=global`) + * Swarm: not supported + * Kubernetes: supported + * name (`--filter name=myapp_web`) + * Swarm: supported + * Kubernetes: supported + * node (`--filter node=mynode`) + * Swarm: not supported + * Kubernetes: supported + * service (`--filter service=web`) + * Swarm: not supported + * Kubernetes: supported + + ### Formatting + + The formatting options (`--format`) pretty-prints services output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ------------|------------------------------------------------------------------- + `.ID` | Service ID + `.Name` | Service name + `.Mode` | Service mode (replicated, global) + `.Replicas` | Service replicas + `.Image` | Service image + + When using the `--format` option, the `stack services` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `ID`, `Mode`, and `Replicas` entries separated by a colon (`:`) for all services: + + ```bash + $ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}" + + 0zmvwuiu3vue: replicated 10/10 + fm6uf97exkul: global 5/5 + ``` +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_start.yaml b/_data/engine-cli/docker_start.yaml new file mode 100644 index 0000000..fe0567d --- /dev/null +++ b/_data/engine-cli/docker_start.yaml @@ -0,0 +1,63 @@ +command: docker start +short: Start one or more stopped containers +long: Start one or more stopped containers +usage: docker start [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: attach + shorthand: a + value_type: bool + default_value: "false" + description: Attach STDOUT/STDERR and forward signals + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: checkpoint + value_type: string + description: Restore from this checkpoint + deprecated: false + experimental: true + experimentalcli: false + kubernetes: false + swarm: false + os_type: linux +- option: checkpoint-dir + value_type: string + description: Use a custom checkpoint storage directory + deprecated: false + experimental: true + experimentalcli: false + kubernetes: false + swarm: false + os_type: linux +- option: detach-keys + value_type: string + description: Override the key sequence for detaching a container + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: interactive + shorthand: i + value_type: bool + default_value: "false" + description: Attach container's STDIN + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker start my_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stats.yaml b/_data/engine-cli/docker_stats.yaml new file mode 100644 index 0000000..190e0df --- /dev/null +++ b/_data/engine-cli/docker_stats.yaml @@ -0,0 +1,201 @@ +command: docker stats +short: Display a live stream of container(s) resource usage statistics +long: |- + The `docker stats` command returns a live data stream for running containers. To + limit data to one or more specific containers, specify a list of container names + or ids separated by a space. You can specify a stopped container but stopped + containers do not return any data. + + If you need more detailed information about a container's resource usage, use + the `/containers/(id)/stats` API endpoint. + + > **Note** + > + > On Linux, the Docker CLI reports memory usage by subtracting page cache usage + > from the total memory usage. The API does not perform such a calculation but + > rather provides the total memory usage and the amount from the page cache so + > that clients can use the data as needed. + + > **Note** + > + > The `PIDS` column contains the number of processes and kernel threads created + > by that container. Threads is the term used by Linux kernel. Other equivalent + > terms are "lightweight process" or "kernel task", etc. A large number in the + > `PIDS` column combined with a small number of processes (as reported by `ps` + > or `top`) may indicate that something in the container is creating many threads. +usage: docker stats [OPTIONS] [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Show all containers (default shows just running) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-stream + value_type: bool + default_value: "false" + description: Disable streaming stats and only pull the first result + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: no-trunc + value_type: bool + default_value: "false" + description: Do not truncate output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Running `docker stats` on all running containers against a Linux daemon. + + ```bash + $ docker stats + + CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS + b95a83497c91 awesome_brattain 0.28% 5.629MiB / 1.952GiB 0.28% 916B / 0B 147kB / 0B 9 + 67b2525d8ad1 foobar 0.00% 1.727MiB / 1.952GiB 0.09% 2.48kB / 0B 4.11MB / 0B 2 + e5c383697914 test-1951.1.kay7x1lh1twk9c0oig50sd5tr 0.00% 196KiB / 1.952GiB 0.01% 71.2kB / 0B 770kB / 0B 1 + 4bda148efbc0 random.1.vnc8on831idyr42slu578u3cr 0.00% 1.672MiB / 1.952GiB 0.08% 110kB / 0B 578kB / 0B 2 + ``` + + If you don't [specify a format string using `--format`](#formatting), the + following columns are shown. + + | Column name | Description | + |---------------------------|-----------------------------------------------------------------------------------------------| + | `CONTAINER ID` and `Name` | the ID and name of the container | + | `CPU %` and `MEM %` | the percentage of the host's CPU and memory the container is using | + | `MEM USAGE / LIMIT` | the total memory the container is using, and the total amount of memory it is allowed to use | + | `NET I/O` | The amount of data the container has sent and received over its network interface | + | `BLOCK I/O` | The amount of data the container has read to and written from block devices on the host | + | `PIDs` | the number of processes or threads the container has created | + + Running `docker stats` on multiple containers by name and id against a Linux daemon. + + ```bash + $ docker stats awesome_brattain 67b2525d8ad1 + + CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS + b95a83497c91 awesome_brattain 0.28% 5.629MiB / 1.952GiB 0.28% 916B / 0B 147kB / 0B 9 + 67b2525d8ad1 foobar 0.00% 1.727MiB / 1.952GiB 0.09% 2.48kB / 0B 4.11MB / 0B 2 + ``` + + Running `docker stats` with customized format on all (Running and Stopped) containers. + + ```bash + $ docker stats --all --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" fervent_panini 5acfcb1b4fd1 drunk_visvesvaraya big_heisenberg + + CONTAINER CPU % MEM USAGE / LIMIT + fervent_panini 0.00% 56KiB / 15.57GiB + 5acfcb1b4fd1 0.07% 32.86MiB / 15.57GiB + drunk_visvesvaraya 0.00% 0B / 0B + big_heisenberg 0.00% 0B / 0B + ``` + + `drunk_visvesvaraya` and `big_heisenberg` are stopped containers in the above example. + + Running `docker stats` on all running containers against a Windows daemon. + + ```powershell + PS E:\> docker stats + CONTAINER ID CPU % PRIV WORKING SET NET I/O BLOCK I/O + 09d3bb5b1604 6.61% 38.21 MiB 17.1 kB / 7.73 kB 10.7 MB / 3.57 MB + 9db7aa4d986d 9.19% 38.26 MiB 15.2 kB / 7.65 kB 10.6 MB / 3.3 MB + 3f214c61ad1d 0.00% 28.64 MiB 64 kB / 6.84 kB 4.42 MB / 6.93 MB + ``` + + Running `docker stats` on multiple containers by name and id against a Windows daemon. + + ```powershell + PS E:\> docker ps -a + CONTAINER ID NAME IMAGE COMMAND CREATED STATUS PORTS NAMES + 3f214c61ad1d awesome_brattain nanoserver "cmd" 2 minutes ago Up 2 minutes big_minsky + 9db7aa4d986d mad_wilson windowsservercore "cmd" 2 minutes ago Up 2 minutes mad_wilson + 09d3bb5b1604 fervent_panini windowsservercore "cmd" 2 minutes ago Up 2 minutes affectionate_easley + + PS E:\> docker stats 3f214c61ad1d mad_wilson + CONTAINER ID NAME CPU % PRIV WORKING SET NET I/O BLOCK I/O + 3f214c61ad1d awesome_brattain 0.00% 46.25 MiB 76.3 kB / 7.92 kB 10.3 MB / 14.7 MB + 9db7aa4d986d mad_wilson 9.59% 40.09 MiB 27.6 kB / 8.81 kB 17 MB / 20.1 MB + ``` + + ### Formatting + + The formatting option (`--format`) pretty prints container output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + ------------ | -------------------------------------------- + `.Container` | Container name or ID (user input) + `.Name` | Container name + `.ID` | Container ID + `.CPUPerc` | CPU percentage + `.MemUsage` | Memory usage + `.NetIO` | Network IO + `.BlockIO` | Block IO + `.MemPerc` | Memory percentage (Not available on Windows) + `.PIDs` | Number of PIDs (Not available on Windows) + + + When using the `--format` option, the `stats` command either + outputs the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Container` and `CPUPerc` entries separated by a colon (`:`) for all images: + + ```bash + $ docker stats --format "{{.Container}}: {{.CPUPerc}}" + + 09d3bb5b1604: 6.61% + 9db7aa4d986d: 9.19% + 3f214c61ad1d: 0.00% + ``` + + To list all containers statistics with their name, CPU percentage and memory + usage in a table format you can use: + + ```bash + $ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" + + CONTAINER CPU % PRIV WORKING SET + 1285939c1fd3 0.07% 796 KiB / 64 MiB + 9c76f7834ae2 0.07% 2.746 MiB / 64 MiB + d1ea048f04e4 0.03% 4.583 MiB / 64 MiB + ``` + + The default format is as follows: + + On Linux: + + "table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}\t{{.PIDs}}" + + On Windows: + + "table {{.ID}}\t{{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}" +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_stop.yaml b/_data/engine-cli/docker_stop.yaml new file mode 100644 index 0000000..3d775e8 --- /dev/null +++ b/_data/engine-cli/docker_stop.yaml @@ -0,0 +1,29 @@ +command: docker stop +short: Stop one or more running containers +long: |- + The main process inside the container will receive `SIGTERM`, and after a grace + period, `SIGKILL`. +usage: docker stop [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: time + shorthand: t + value_type: int + default_value: "10" + description: Seconds to wait for stop before killing it + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker stop my_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_swarm.yaml b/_data/engine-cli/docker_swarm.yaml new file mode 100644 index 0000000..e5e071d --- /dev/null +++ b/_data/engine-cli/docker_swarm.yaml @@ -0,0 +1,31 @@ +command: docker swarm +short: Manage Swarm +long: Manage the swarm. +usage: docker swarm +pname: docker +plink: docker.yaml +cname: +- docker swarm ca +- docker swarm init +- docker swarm join +- docker swarm join-token +- docker swarm leave +- docker swarm unlock +- docker swarm unlock-key +- docker swarm update +clink: +- docker_swarm_ca.yaml +- docker_swarm_init.yaml +- docker_swarm_join.yaml +- docker_swarm_join-token.yaml +- docker_swarm_leave.yaml +- docker_swarm_unlock.yaml +- docker_swarm_unlock-key.yaml +- docker_swarm_update.yaml +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_ca.yaml b/_data/engine-cli/docker_swarm_ca.yaml new file mode 100644 index 0000000..c786822 --- /dev/null +++ b/_data/engine-cli/docker_swarm_ca.yaml @@ -0,0 +1,163 @@ +command: docker swarm ca +short: Display and rotate the root CA +long: |- + View or rotate the current swarm CA certificate. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker swarm ca [OPTIONS] +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: ca-cert + value_type: pem-file + description: | + Path to the PEM-formatted root CA certificate to use for the new cluster + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: ca-key + value_type: pem-file + description: | + Path to the PEM-formatted root CA key to use for the new cluster + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cert-expiry + value_type: duration + default_value: 2160h0m0s + description: Validity period for node certificates (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: detach + shorthand: d + value_type: bool + default_value: "false" + description: | + Exit immediately instead of waiting for the root rotation to converge + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: external-ca + value_type: external-ca + description: Specifications of one or more certificate signing endpoints + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Suppress progress output + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rotate + value_type: bool + default_value: "false" + description: | + Rotate the swarm CA - if no certificate or key are provided, new ones will be generated + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Run the `docker swarm ca` command without any options to view the current root CA certificate + in PEM format. + + ```bash + $ docker swarm ca + -----BEGIN CERTIFICATE----- + MIIBazCCARCgAwIBAgIUJPzo67QC7g8Ebg2ansjkZ8CbmaswCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTAzMTcxMDAwWhcNMzcwNDI4MTcx + MDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABKL6/C0sihYEb935wVPRA8MqzPLn3jzou0OJRXHsCLcVExigrMdgmLCC+Va4 + +sJ+SLVO1eQbvLHH8uuDdF/QOU6jQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBSfUy5bjUnBAx/B0GkOBKp91XvxzjAKBggqhkjO + PQQDAgNJADBGAiEAnbvh0puOS5R/qvy1PMHY1iksYKh2acsGLtL/jAIvO4ACIQCi + lIwQqLkJ48SQqCjG1DBTSBsHmMSRT+6mE2My+Z3GKA== + -----END CERTIFICATE----- + ``` + + Pass the `--rotate` flag (and optionally a `--ca-cert`, along with a `--ca-key` or + `--external-ca` parameter flag), in order to rotate the current swarm root CA. + + ``` + $ docker swarm ca --rotate + desired root digest: sha256:05da740cf2577a25224c53019e2cce99bcc5ba09664ad6bb2a9425d9ebd1b53e + rotated TLS certificates: [=========================> ] 1/2 nodes + rotated CA certificates: [> ] 0/2 nodes + ``` + + Once the rotation os finished (all the progress bars have completed) the now-current + CA certificate will be printed: + + ``` + $ docker swarm ca --rotate + desired root digest: sha256:05da740cf2577a25224c53019e2cce99bcc5ba09664ad6bb2a9425d9ebd1b53e + rotated TLS certificates: [==================================================>] 2/2 nodes + rotated CA certificates: [==================================================>] 2/2 nodes + -----BEGIN CERTIFICATE----- + MIIBazCCARCgAwIBAgIUFynG04h5Rrl4lKyA4/E65tYKg8IwCgYIKoZIzj0EAwIw + EzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNTE2MDAxMDAwWhcNMzcwNTExMDAx + MDAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH + A0IABC2DuNrIETP7C7lfiEPk39tWaaU0I2RumUP4fX4+3m+87j0DU0CsemUaaOG6 + +PxHhGu2VXQ4c9pctPHgf7vWeVajQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB + Af8EBTADAQH/MB0GA1UdDgQWBBSEL02z6mCI3SmMDmITMr12qCRY2jAKBggqhkjO + PQQDAgNJADBGAiEA263Eb52+825EeNQZM0AME+aoH1319Zp9/J5ijILW+6ACIQCg + gyg5u9Iliel99l7SuMhNeLkrU7fXs+Of1nTyyM73ig== + -----END CERTIFICATE----- + ``` + + ### `--rotate` + + Root CA Rotation is recommended if one or more of the swarm managers have been + compromised, so that those managers can no longer connect to or be trusted by + any other node in the cluster. + + Alternately, root CA rotation can be used to give control of the swarm CA + to an external CA, or to take control back from an external CA. + + The `--rotate` flag does not require any parameters to do a rotation, but you can + optionally specify a certificate and key, or a certificate and external CA URL, + and those will be used instead of an automatically-generated certificate/key pair. + + Because the root CA key should be kept secret, if provided it will not be visible + when viewing swarm any information via the CLI or API. + + The root CA rotation will not be completed until all registered nodes have + rotated their TLS certificates. If the rotation is not completing within a + reasonable amount of time, try running + `docker node ls --format '{{.ID}} {{.Hostname}} {{.Status}} {{.TLSStatus}}'` to + see if any nodes are down or otherwise unable to rotate TLS certificates. + + + ### `--detach` + + Initiate the root CA rotation, but do not wait for the completion of or display the + progress of the rotation. +deprecated: false +min_api_version: "1.30" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_init.yaml b/_data/engine-cli/docker_swarm_init.yaml new file mode 100644 index 0000000..562479a --- /dev/null +++ b/_data/engine-cli/docker_swarm_init.yaml @@ -0,0 +1,304 @@ +command: docker swarm init +short: Initialize a swarm +long: |- + Initialize a swarm. The docker engine targeted by this command becomes a manager + in the newly created single-node swarm. +usage: docker swarm init [OPTIONS] +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: advertise-addr + value_type: string + description: 'Advertised address (format: [:port])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: autolock + value_type: bool + default_value: "false" + description: | + Enable manager autolocking (requiring an unlock key to start a stopped manager) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: availability + value_type: string + default_value: active + description: Availability of the node ("active"|"pause"|"drain") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cert-expiry + value_type: duration + default_value: 2160h0m0s + description: Validity period for node certificates (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: data-path-addr + value_type: string + description: | + Address or interface to use for data path traffic (format: ) + deprecated: false + min_api_version: "1.31" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: data-path-port + value_type: uint32 + default_value: "0" + description: | + Port number to use for data path traffic (1024 - 49151). If no value is set or is set to 0, the default port (4789) is used. + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: default-addr-pool + value_type: ipNetSlice + default_value: '[]' + description: default address pool in CIDR format + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: default-addr-pool-mask-length + value_type: uint32 + default_value: "24" + description: default address pool subnet mask length + deprecated: false + min_api_version: "1.39" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dispatcher-heartbeat + value_type: duration + default_value: 5s + description: Dispatcher heartbeat period (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: external-ca + value_type: external-ca + description: Specifications of one or more certificate signing endpoints + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force-new-cluster + value_type: bool + default_value: "false" + description: Force create a new cluster from current state + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: listen-addr + value_type: node-addr + default_value: 0.0.0.0:2377 + description: 'Listen address (format: [:port])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: max-snapshots + value_type: uint64 + default_value: "0" + description: Number of additional Raft snapshots to retain + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: snapshot-interval + value_type: uint64 + default_value: "10000" + description: Number of log entries between Raft snapshots + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: task-history-limit + value_type: int64 + default_value: "5" + description: Task history retention limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker swarm init --advertise-addr 192.168.99.121 + Swarm initialized: current node (bvz81updecsj6wjz393c09vti) is now a manager. + + To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \ + 172.17.0.2:2377 + + To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions. + ``` + + `docker swarm init` generates two random tokens, a worker token and a manager token. When you join + a new node to the swarm, the node joins as a worker or manager node based upon the token you pass + to [swarm join](swarm_join.md). + + After you create the swarm, you can display or rotate the token using + [swarm join-token](swarm_join-token.md). + + ### `--autolock` + + This flag enables automatic locking of managers with an encryption key. The + private keys and data stored by all managers will be protected by the + encryption key printed in the output, and will not be accessible without it. + Thus, it is very important to store this key in order to activate a manager + after it restarts. The key can be passed to `docker swarm unlock` to reactivate + the manager. Autolock can be disabled by running + `docker swarm update --autolock=false`. After disabling it, the encryption key + is no longer required to start the manager, and it will start up on its own + without user intervention. + + ### `--cert-expiry` + + This flag sets the validity period for node certificates. + + ### `--dispatcher-heartbeat` + + This flag sets the frequency with which nodes are told to use as a + period to report their health. + + ### `--external-ca` + + This flag sets up the swarm to use an external CA to issue node certificates. The value takes + the form `protocol=X,url=Y`. The value for `protocol` specifies what protocol should be used + to send signing requests to the external CA. Currently, the only supported value is `cfssl`. + The URL specifies the endpoint where signing requests should be submitted. + + ### `--force-new-cluster` + + This flag forces an existing node that was part of a quorum that was lost to restart as a single node Manager without losing its data. + + ### `--listen-addr` + + The node listens for inbound swarm manager traffic on this address. The default is to listen on + 0.0.0.0:2377. It is also possible to specify a network interface to listen on that interface's + address; for example `--listen-addr eth0:2377`. + + Specifying a port is optional. If the value is a bare IP address or interface + name, the default port 2377 will be used. + + ### `--advertise-addr` + + This flag specifies the address that will be advertised to other members of the + swarm for API access and overlay networking. If unspecified, Docker will check + if the system has a single IP address, and use that IP address with the + listening port (see `--listen-addr`). If the system has multiple IP addresses, + `--advertise-addr` must be specified so that the correct address is chosen for + inter-manager communication and overlay networking. + + It is also possible to specify a network interface to advertise that interface's address; + for example `--advertise-addr eth0:2377`. + + Specifying a port is optional. If the value is a bare IP address or interface + name, the default port 2377 will be used. + + ### `--data-path-addr` + + This flag 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 then possible to separate the container's data traffic from the + management traffic of the cluster. + If unspecified, Docker will use the same IP address or interface that is used for the + advertise address. + + ### `--data-path-port` + + This flag allows you to configure the UDP port number to use for data path + traffic. The provided port number must be within the 1024 - 49151 range. If + this flag is not set or is set to 0, the default port number 4789 is used. + The data path port can only be configured when initializing the swarm, and + applies to all nodes that join the swarm. + The following example initializes a new Swarm, and configures the data path + port to UDP port 7777; + + ```bash + docker swarm init --data-path-port=7777 + ``` + After the swarm is initialized, use the `docker info` command to verify that + the port is configured: + + ```bash + docker info + ... + ClusterID: 9vs5ygs0gguyyec4iqf2314c0 + Managers: 1 + Nodes: 1 + Data Path Port: 7777 + ... + ``` + + ### `--default-addr-pool` + This flag specifies default subnet pools for global scope networks. + Format example is `--default-addr-pool 30.30.0.0/16 --default-addr-pool 40.40.0.0/16` + + ### `--default-addr-pool-mask-length` + This flag specifies default subnet pools mask length for default-addr-pool. + Format example is `--default-addr-pool-mask-length 24` + + ### `--task-history-limit` + + This flag sets up task history retention limit. + + ### `--max-snapshots` + + This flag sets the number of old Raft snapshots to retain in addition to the + current Raft snapshots. By default, no old snapshots are retained. This option + may be used for debugging, or to store old snapshots of the swarm state for + disaster recovery purposes. + + ### `--snapshot-interval` + + This flag specifies how many log entries to allow in between Raft snapshots. + Setting this to a higher number will trigger snapshots less frequently. + Snapshots compact the Raft log and allow for more efficient transfer of the + state to new managers. However, there is a performance cost to taking snapshots + frequently. + + ### `--availability` + + This flag specifies the availability of the node at the time the node joins a master. + Possible availability values are `active`, `pause`, or `drain`. + + This flag is useful in certain situations. For example, a cluster may want to have + dedicated manager nodes that are not served as worker nodes. This could be achieved + by passing `--availability=drain` to `docker swarm init`. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_join-token.yaml b/_data/engine-cli/docker_swarm_join-token.yaml new file mode 100644 index 0000000..323435e --- /dev/null +++ b/_data/engine-cli/docker_swarm_join-token.yaml @@ -0,0 +1,116 @@ +command: docker swarm join-token +short: Manage join tokens +long: |- + Join tokens are secrets that allow a node to join the swarm. There are two + different join tokens available, one for the worker role and one for the manager + role. You pass the token using the `--token` flag when you run + [swarm join](swarm_join.md). Nodes use the join token only when they join the + swarm. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker swarm join-token [OPTIONS] (worker|manager) +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display token + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rotate + value_type: bool + default_value: "false" + description: Rotate join token + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + You can view or rotate the join tokens using `swarm join-token`. + + As a convenience, you can pass `worker` or `manager` as an argument to + `join-token` to print the full `docker swarm join` command to join a new node to + the swarm: + + ```bash + $ docker swarm join-token worker + + To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx \ + 172.17.0.2:2377 + + $ docker swarm join-token manager + + To add a manager to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2 \ + 172.17.0.2:2377 + ``` + + Use the `--rotate` flag to generate a new join token for the specified role: + + ```bash + $ docker swarm join-token --rotate worker + + Successfully rotated worker join token. + + To add a worker to this swarm, run the following command: + + docker swarm join \ + --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7mel7t \ + 172.17.0.2:2377 + ``` + + After using `--rotate`, only the new token will be valid for joining with the specified role. + + The `-q` (or `--quiet`) flag only prints the token: + + ```bash + $ docker swarm join-token -q worker + + SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-b30ljddcqhef9b9v4rs7mel7t + ``` + + ### `--rotate` + + Because tokens allow new nodes to join the swarm, you should keep them secret. + Be particularly careful with manager tokens since they allow new manager nodes + to join the swarm. A rogue manager has the potential to disrupt the operation of + your swarm. + + Rotate your swarm's join token if a token gets checked-in to version control, + stolen, or a node is compromised. You may also want to periodically rotate the + token to ensure any unknown token leaks do not allow a rogue node to join + the swarm. + + To rotate the join token and print the newly generated token, run + `docker swarm join-token --rotate` and pass the role: `manager` or `worker`. + + Rotating a join-token means that no new nodes will be able to join the swarm + using the old token. Rotation does not affect existing nodes in the swarm + because the join token is only used for authorizing new nodes joining the swarm. + + ### `--quiet` + + Only print the token. Do not print a complete command for joining. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_join.yaml b/_data/engine-cli/docker_swarm_join.yaml new file mode 100644 index 0000000..83768fa --- /dev/null +++ b/_data/engine-cli/docker_swarm_join.yaml @@ -0,0 +1,145 @@ +command: docker swarm join +short: Join a swarm as a node and/or manager +long: |- + Join a node to a swarm. The node joins as a manager node or worker node based upon the token you + pass with the `--token` flag. If you pass a manager token, the node joins as a manager. If you + pass a worker token, the node joins as a worker. +usage: docker swarm join [OPTIONS] HOST:PORT +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: advertise-addr + value_type: string + description: 'Advertised address (format: [:port])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: availability + value_type: string + default_value: active + description: Availability of the node ("active"|"pause"|"drain") + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: data-path-addr + value_type: string + description: | + Address or interface to use for data path traffic (format: ) + deprecated: false + min_api_version: "1.31" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: listen-addr + value_type: node-addr + default_value: 0.0.0.0:2377 + description: 'Listen address (format: [:port])' + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: token + value_type: string + description: Token for entry into the swarm + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Join a node to swarm as a manager + + The example below demonstrates joining a manager node using a manager token. + + ```bash + $ docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2 192.168.99.121:2377 + This node joined a swarm as a manager. + $ docker node ls + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + dkp8vy1dq1kxleu9g4u78tlag * manager2 Ready Active Reachable + dvfxp4zseq4s0rih1selh0d20 manager1 Ready Active Leader + ``` + + A cluster should only have 3-7 managers at most, because a majority of managers must be available + for the cluster to function. Nodes that aren't meant to participate in this management quorum + should join as workers instead. Managers should be stable hosts that have static IP addresses. + + ### Join a node to swarm as a worker + + The example below demonstrates joining a worker node using a worker token. + + ```bash + $ docker swarm join --token SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx 192.168.99.121:2377 + This node joined a swarm as a worker. + $ docker node ls + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 7ln70fl22uw2dvjn2ft53m3q5 worker2 Ready Active + dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active Reachable + dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader + ``` + + ### `--listen-addr value` + + If the node is a manager, it will listen for inbound swarm manager traffic on this + address. The default is to listen on 0.0.0.0:2377. It is also possible to specify a + network interface to listen on that interface's address; for example `--listen-addr eth0:2377`. + + Specifying a port is optional. If the value is a bare IP address, or interface + name, the default port 2377 will be used. + + This flag is generally not necessary when joining an existing swarm. + + ### `--advertise-addr value` + + This flag specifies the address that will be advertised to other members of the + swarm for API access. If unspecified, Docker will check if the system has a + single IP address, and use that IP address with the listening port (see + `--listen-addr`). If the system has multiple IP addresses, `--advertise-addr` + must be specified so that the correct address is chosen for inter-manager + communication and overlay networking. + + It is also possible to specify a network interface to advertise that interface's address; + for example `--advertise-addr eth0:2377`. + + Specifying a port is optional. If the value is a bare IP address, or interface + name, the default port 2377 will be used. + + This flag is generally not necessary when joining an existing swarm. If + you're joining new nodes through a load balancer, you should use this flag to + ensure the node advertises its IP address and not the IP address of the load + balancer. + + ### `--data-path-addr` + + This flag 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 then possible to separate the container's data traffic from the + management traffic of the cluster. + If unspecified, Docker will use the same IP address or interface that is used for the + advertise address. + + ### `--token string` + + Secret value required for nodes to join the swarm + + ### `--availability` + + This flag specifies the availability of the node at the time the node joins a master. + Possible availability values are `active`, `pause`, or `drain`. + + This flag is useful in certain situations. For example, a cluster may want to have + dedicated manager nodes that are not served as worker nodes. This could be achieved + by passing `--availability=drain` to `docker swarm join`. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_leave.yaml b/_data/engine-cli/docker_swarm_leave.yaml new file mode 100644 index 0000000..37ccf2c --- /dev/null +++ b/_data/engine-cli/docker_swarm_leave.yaml @@ -0,0 +1,56 @@ +command: docker swarm leave +short: Leave the swarm +long: |- + When you run this command on a worker, that worker leaves the swarm. + + You can use the `--force` option on a manager to remove it from the swarm. + However, this does not reconfigure the swarm to ensure that there are enough + managers to maintain a quorum in the swarm. The safe way to remove a manager + from a swarm is to demote it to a worker and then direct it to leave the quorum + without using `--force`. Only use `--force` in situations where the swarm will + no longer be used after the manager leaves, such as in a single-node swarm. +usage: docker swarm leave [OPTIONS] +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Force this node to leave the swarm, ignoring warnings + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Consider the following swarm, as seen from the manager: + + ```bash + $ docker node ls + + ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS + 7ln70fl22uw2dvjn2ft53m3q5 worker2 Ready Active + dkp8vy1dq1kxleu9g4u78tlag worker1 Ready Active + dvfxp4zseq4s0rih1selh0d20 * manager1 Ready Active Leader + ``` + + To remove `worker2`, issue the following command from `worker2` itself: + + ```bash + $ docker swarm leave + + Node left the default swarm. + ``` + + The node will still appear in the node list, and marked as `down`. It no longer + affects swarm operation, but a long list of `down` nodes can clutter the node + list. To remove an inactive node from the list, use the [`node rm`](node_rm.md) + command. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_unlock-key.yaml b/_data/engine-cli/docker_swarm_unlock-key.yaml new file mode 100644 index 0000000..3ee5129 --- /dev/null +++ b/_data/engine-cli/docker_swarm_unlock-key.yaml @@ -0,0 +1,92 @@ +command: docker swarm unlock-key +short: Manage the unlock key +long: |- + An unlock key is a secret key needed to unlock a manager after its Docker daemon + restarts. These keys are only used when the autolock feature is enabled for the + swarm. + + You can view or rotate the unlock key using `swarm unlock-key`. To view the key, + run the `docker swarm unlock-key` command without any arguments: + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker swarm unlock-key [OPTIONS] +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: quiet + shorthand: q + value_type: bool + default_value: "false" + description: Only display token + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: rotate + value_type: bool + default_value: "false" + description: Rotate unlock key + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker swarm unlock-key + + To unlock a swarm manager after it restarts, run the `docker swarm unlock` + command and provide the following key: + + SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4 + + Please remember to store this key in a password manager, since without it you + will not be able to restart the manager. + ``` + + Use the `--rotate` flag to rotate the unlock key to a new, randomly-generated + key: + + ```bash + $ docker swarm unlock-key --rotate + + Successfully rotated manager unlock key. + + To unlock a swarm manager after it restarts, run the `docker swarm unlock` + command and provide the following key: + + SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 + + Please remember to store this key in a password manager, since without it you + will not be able to restart the manager. + ``` + + The `-q` (or `--quiet`) flag only prints the key: + + ```bash + $ docker swarm unlock-key -q + + SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8 + ``` + + ### `--rotate` + + This flag rotates the unlock key, replacing it with a new randomly-generated + key. The old unlock key will no longer be accepted. + + ### `--quiet` + + Only print the unlock key, without instructions. +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_unlock.yaml b/_data/engine-cli/docker_swarm_unlock.yaml new file mode 100644 index 0000000..c0334c3 --- /dev/null +++ b/_data/engine-cli/docker_swarm_unlock.yaml @@ -0,0 +1,29 @@ +command: docker swarm unlock +short: Unlock swarm +long: |- + Unlocks a locked manager using a user-supplied unlock key. This command must be + used to reactivate a manager after its Docker daemon restarts if the autolock + setting is turned on. The unlock key is printed at the time when autolock is + enabled, and is also available from the `docker swarm unlock-key` command. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker swarm unlock +pname: docker swarm +plink: docker_swarm.yaml +examples: |- + ```bash + $ docker swarm unlock + Please enter unlock key: + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_swarm_update.yaml b/_data/engine-cli/docker_swarm_update.yaml new file mode 100644 index 0000000..28b6d72 --- /dev/null +++ b/_data/engine-cli/docker_swarm_update.yaml @@ -0,0 +1,90 @@ +command: docker swarm update +short: Update the swarm +long: |- + Updates a swarm with new parameter values. + + > **Note** + > + > This is a cluster management command, and must be executed on a swarm + > manager node. To learn about managers and workers, refer to the + > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the + > documentation. +usage: docker swarm update [OPTIONS] +pname: docker swarm +plink: docker_swarm.yaml +options: +- option: autolock + value_type: bool + default_value: "false" + description: Change manager autolocking setting (true|false) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cert-expiry + value_type: duration + default_value: 2160h0m0s + description: Validity period for node certificates (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: dispatcher-heartbeat + value_type: duration + default_value: 5s + description: Dispatcher heartbeat period (ns|us|ms|s|m|h) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: external-ca + value_type: external-ca + description: Specifications of one or more certificate signing endpoints + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: max-snapshots + value_type: uint64 + default_value: "0" + description: Number of additional Raft snapshots to retain + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: snapshot-interval + value_type: uint64 + default_value: "10000" + description: Number of log entries between Raft snapshots + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: task-history-limit + value_type: int64 + default_value: "5" + description: Task history retention limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker swarm update --cert-expiry 720h + ``` +deprecated: false +min_api_version: "1.24" +experimental: false +experimentalcli: false +kubernetes: false +swarm: true + diff --git a/_data/engine-cli/docker_system.yaml b/_data/engine-cli/docker_system.yaml new file mode 100644 index 0000000..a1bc57f --- /dev/null +++ b/_data/engine-cli/docker_system.yaml @@ -0,0 +1,22 @@ +command: docker system +short: Manage Docker +long: Manage Docker. +usage: docker system +pname: docker +plink: docker.yaml +cname: +- docker system df +- docker system events +- docker system info +- docker system prune +clink: +- docker_system_df.yaml +- docker_system_events.yaml +- docker_system_info.yaml +- docker_system_prune.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_system_df.yaml b/_data/engine-cli/docker_system_df.yaml new file mode 100644 index 0000000..19aa6f7 --- /dev/null +++ b/_data/engine-cli/docker_system_df.yaml @@ -0,0 +1,80 @@ +command: docker system df +short: Show docker disk usage +long: |- + The `docker system df` command displays information regarding the + amount of disk space used by the docker daemon. +usage: docker system df [OPTIONS] +pname: docker system +plink: docker_system.yaml +options: +- option: format + value_type: string + description: Pretty-print images using a Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: verbose + shorthand: v + value_type: bool + default_value: "false" + description: Show detailed information on space usage + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + By default the command will just show a summary of the data used: + + ```bash + $ docker system df + + TYPE TOTAL ACTIVE SIZE RECLAIMABLE + Images 5 2 16.43 MB 11.63 MB (70%) + Containers 2 0 212 B 212 B (100%) + Local Volumes 2 1 36 B 0 B (0%) + ``` + + A more detailed view can be requested using the `-v, --verbose` flag: + + ```bash + $ docker system df -v + + Images space usage: + + REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS + my-curl latest b2789dd875bf 6 minutes ago 11 MB 11 MB 5 B 0 + my-jq latest ae67841be6d0 6 minutes ago 9.623 MB 8.991 MB 632.1 kB 0 + a0971c4015c1 6 minutes ago 11 MB 11 MB 0 B 0 + alpine latest 4e38e38c8ce0 9 weeks ago 4.799 MB 0 B 4.799 MB 1 + alpine 3.3 47cf20d8c26c 9 weeks ago 4.797 MB 4.797 MB 0 B 1 + + Containers space usage: + + CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES + 4a7f7eebae0f alpine:latest "sh" 1 0 B 16 minutes ago Exited (0) 5 minutes ago hopeful_yalow + f98f9c2aa1ea alpine:3.3 "sh" 1 212 B 16 minutes ago Exited (0) 48 seconds ago anon-vol + + Local Volumes space usage: + + NAME LINKS SIZE + 07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e 2 36 B + my-named-vol 0 0 B + ``` + + * `SHARED SIZE` is the amount of space that an image shares with another one (i.e. their common data) + * `UNIQUE SIZE` is the amount of space that is only used by a given image + * `SIZE` is the virtual size of the image, it is the sum of `SHARED SIZE` and `UNIQUE SIZE` + + > **Note** + > + > Network information is not shown because it does not consume disk space. +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_system_events.yaml b/_data/engine-cli/docker_system_events.yaml new file mode 100644 index 0000000..942ad3c --- /dev/null +++ b/_data/engine-cli/docker_system_events.yaml @@ -0,0 +1,361 @@ +command: docker system events +short: Get real time events from the server +long: |- + Use `docker system events` to get real-time events from the server. These + events differ per Docker object type. + + ### Object types + + #### Containers + + Docker containers report the following events: + + - `attach` + - `commit` + - `copy` + - `create` + - `destroy` + - `detach` + - `die` + - `exec_create` + - `exec_detach` + - `exec_start` + - `export` + - `health_status` + - `kill` + - `oom` + - `pause` + - `rename` + - `resize` + - `restart` + - `start` + - `stop` + - `top` + - `unpause` + - `update` + + #### Images + + Docker images report the following events: + + - `delete` + - `import` + - `load` + - `pull` + - `push` + - `save` + - `tag` + - `untag` + + #### Plugins + + Docker plugins report the following events: + + - `install` + - `enable` + - `disable` + - `remove` + + #### Volumes + + Docker volumes report the following events: + + - `create` + - `mount` + - `unmount` + - `destroy` + + #### Networks + + Docker networks report the following events: + + - `create` + - `connect` + - `disconnect` + - `destroy` + + #### Daemons + + Docker daemons report the following events: + + - `reload` + + ### Limiting, filtering, and formatting the output + + #### Limit events by time + + The `--since` and `--until` parameters can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the client machine’s time. If you do not provide the `--since` option, + the command returns only new and/or live events. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the client will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + #### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If you would + like to use multiple filters, pass multiple flags (e.g., + `--filter "foo=bar" --filter "bif=baz"`) + + Using the same filter multiple times will be handled as a *OR*; for example + `--filter container=588a23dac085 --filter container=a8f7720b8c22` will display + events for container 588a23dac085 *OR* container a8f7720b8c22 + + Using multiple filters will be handled as a *AND*; for example + `--filter container=588a23dac085 --filter event=start` will display events for + container container 588a23dac085 *AND* the event type is *start* + + The currently supported filters are: + + * container (`container=`) + * daemon (`daemon=`) + * event (`event=`) + * image (`image=`) + * label (`label=` or `label==`) + * network (`network=`) + * plugin (`plugin=`) + * type (`type=`) + * volume (`volume=`) + + #### Format + + If a format (`--format`) is specified, the given template will be executed + instead of the default + format. Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. + + If a format is set to `{{json .}}`, the events are streamed as valid JSON + Lines. For information about JSON Lines, please refer to http://jsonlines.org/ . +usage: docker system events [OPTIONS] +pname: docker system +plink: docker_system.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Filter output based on conditions provided + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: since + value_type: string + description: Show all events created since timestamp + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: until + value_type: string + description: Stream events until this timestamp + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Basic example + + You'll need two shells for this example. + + **Shell 1: Listening for events:** + + ```bash + $ docker system events + ``` + + **Shell 2: Start and Stop containers:** + + ```bash + $ docker create --name test alpine:latest top + $ docker start test + $ docker stop test + ``` + + **Shell 1: (Again .. now showing events):** + + ```console + 2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + ``` + + To exit the `docker system events` command, use `CTRL+C`. + + ### Filter events by time + + You can filter the output by an absolute timestamp or relative time on the host + machine, using the following different time syntaxes: + + ```bash + $ docker system events --since 1483283804 + + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker system events --since '2017-01-05' + + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker system events --since '2013-09-03T15:49:29' + + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker system events --since '10m' + + 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) + 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) + 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) + 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + ``` + + ### Filter events by criteria + + The following commands show several different ways to filter the `docker event` + output. + + ```bash + $ docker system events --filter 'event=stop' + + 2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain) + + $ docker system events --filter 'image=alpine' + + 2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15) + 2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9) + 2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner) + 2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner) + + $ docker system events --filter 'container=test' + + 2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) + 2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) + 2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker system events --filter 'container=test' --filter 'container=d9cdb1525ea8' + + 2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) + 2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) + 2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9) + 2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test) + 2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test) + + $ docker system events --filter 'container=test' --filter 'event=stop' + + 2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test) + + $ docker system events --filter 'type=volume' + + 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) + 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate) + 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local) + 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) + + $ docker system events --filter 'type=network' + + 2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge) + 2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge) + + $ docker system events --filter 'container=container_1' --filter 'container=container_2' + + 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) + 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) + 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) + 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) + + $ docker system events --filter 'type=volume' + + 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) + 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) + 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) + 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) + + $ docker system events --filter 'type=network' + + 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) + 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) + + $ docker system events --filter 'type=plugin' + + 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) + 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) + ``` + + ### Format the output + + ```bash + $ docker system events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' + + Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 + ``` + + #### Format as JSON + + ```bash + $ docker system events --format '{{json .}}' + + {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + {"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e.. + {"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42.. + {"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_system_info.yaml b/_data/engine-cli/docker_system_info.yaml new file mode 100644 index 0000000..9662751 --- /dev/null +++ b/_data/engine-cli/docker_system_info.yaml @@ -0,0 +1,22 @@ +command: docker system info +short: Display system-wide information +long: Display system-wide information +usage: docker system info [OPTIONS] +pname: docker system +plink: docker_system.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_system_prune.yaml b/_data/engine-cli/docker_system_prune.yaml new file mode 100644 index 0000000..0b12e89 --- /dev/null +++ b/_data/engine-cli/docker_system_prune.yaml @@ -0,0 +1,161 @@ +command: docker system prune +short: Remove unused data +long: |- + Remove all unused containers, networks, images (both dangling and unreferenced), + and optionally, volumes. +usage: docker system prune [OPTIONS] +pname: docker system +plink: docker_system.yaml +options: +- option: all + shorthand: a + value_type: bool + default_value: "false" + description: Remove all unused images not just dangling ones + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: filter + value_type: filter + description: Provide filter values (e.g. 'label==') + deprecated: false + min_api_version: "1.28" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: volumes + value_type: bool + default_value: "false" + description: Prune volumes + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker system prune + + WARNING! This will remove: + - all stopped containers + - all networks not used by at least one container + - all dangling images + - all build cache + Are you sure you want to continue? [y/N] y + + Deleted Containers: + f44f9b81948b3919590d5f79a680d8378f1139b41952e219830a33027c80c867 + 792776e68ac9d75bce4092bc1b5cc17b779bc926ab04f4185aec9bf1c0d4641f + + Deleted Networks: + network1 + network2 + + Deleted Images: + untagged: hello-world@sha256:f3b3b28a45160805bb16542c9531888519430e9e6d6ffc09d72261b0d26ff74f + deleted: sha256:1815c82652c03bfd8644afda26fb184f2ed891d921b20a0703b46768f9755c57 + deleted: sha256:45761469c965421a92a69cc50e92c01e0cfa94fe026cdd1233445ea00e96289a + + Total reclaimed space: 1.84kB + ``` + + By default, volumes are not removed to prevent important data from being + deleted if there is currently no container using the volume. Use the `--volumes` + flag when running the command to prune volumes as well: + + ```bash + $ docker system prune -a --volumes + + WARNING! This will remove: + - all stopped containers + - all networks not used by at least one container + - all volumes not used by at least one container + - all images without at least one container associated to them + - all build cache + Are you sure you want to continue? [y/N] y + + Deleted Containers: + 0998aa37185a1a7036b0e12cf1ac1b6442dcfa30a5c9650a42ed5010046f195b + 73958bfb884fa81fa4cc6baf61055667e940ea2357b4036acbbe25a60f442a4d + + Deleted Networks: + my-network-a + my-network-b + + Deleted Volumes: + named-vol + + Deleted Images: + untagged: my-curl:latest + deleted: sha256:7d88582121f2a29031d92017754d62a0d1a215c97e8f0106c586546e7404447d + deleted: sha256:dd14a93d83593d4024152f85d7c63f76aaa4e73e228377ba1d130ef5149f4d8b + untagged: alpine:3.3 + deleted: sha256:695f3d04125db3266d4ab7bbb3c6b23aa4293923e762aa2562c54f49a28f009f + untagged: alpine:latest + deleted: sha256:ee4603260daafe1a8c2f3b78fd760922918ab2441cbb2853ed5c439e59c52f96 + deleted: sha256:9007f5987db353ec398a223bc5a135c5a9601798ba20a1abba537ea2f8ac765f + deleted: sha256:71fa90c8f04769c9721459d5aa0936db640b92c8c91c9b589b54abd412d120ab + deleted: sha256:bb1c3357b3c30ece26e6604aea7d2ec0ace4166ff34c3616701279c22444c0f3 + untagged: my-jq:latest + deleted: sha256:6e66d724542af9bc4c4abf4a909791d7260b6d0110d8e220708b09e4ee1322e1 + deleted: sha256:07b3fa89d4b17009eb3988dfc592c7d30ab3ba52d2007832dffcf6d40e3eda7f + deleted: sha256:3a88a5c81eb5c283e72db2dbc6d65cbfd8e80b6c89bb6e714cfaaa0eed99c548 + + Total reclaimed space: 13.5 MB + ``` + + > **Note** + > + > The `--volumes` option was added in Docker 17.06.1. Older versions of Docker + > prune volumes by default, along with other Docker objects. On older versions, + > run `docker container prune`, `docker network prune`, and `docker image prune` + > separately to remove unused containers, networks, and images, without removing + > volumes. + + + ### Filtering + + The filtering flag (`--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + * until (``) - only remove containers, images, and networks created before given timestamp + * label (`label=`, `label==`, `label!=`, or `label!==`) - only remove containers, images, networks, and volumes with (or without, in case `label!=...` is used) the specified labels. + + The `until` filter can be Unix timestamps, date formatted + timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed + relative to the daemon machine’s time. Supported formats for date + formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, + `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local + timezone on the daemon will be used if you do not provide either a `Z` or a + `+-00:00` timezone offset at the end of the timestamp. When providing Unix + timestamps enter seconds[.nanoseconds], where seconds is the number of seconds + that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap + seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a + fraction of a second no more than nine digits long. + + The `label` filter accepts two formats. One is the `label=...` (`label=` or `label==`), + which removes containers, images, networks, and volumes with the specified labels. The other + format is the `label!=...` (`label!=` or `label!==`), which removes + containers, images, networks, and volumes without the specified labels. +deprecated: false +min_api_version: "1.25" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_tag.yaml b/_data/engine-cli/docker_tag.yaml new file mode 100644 index 0000000..0ee4da0 --- /dev/null +++ b/_data/engine-cli/docker_tag.yaml @@ -0,0 +1,66 @@ +command: docker tag +short: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE +long: |- + An image name is made up of slash-separated name components, optionally prefixed + by a registry hostname. The hostname must comply with standard DNS rules, but + may not contain underscores. If a hostname is present, it may optionally be + followed by a port number in the format `:8080`. If not present, the command + uses Docker's public registry located at `registry-1.docker.io` by default. Name + components may contain lowercase letters, digits and separators. A separator + is defined as a period, one or two underscores, or one or more dashes. A name + component may not start or end with a separator. + + A tag name must be valid ASCII and may contain lowercase and uppercase letters, + digits, underscores, periods and dashes. A tag name may not start with a + period or a dash and may contain a maximum of 128 characters. + + You can group your images together using names and tags, and then upload them + to [*Share images on Docker Hub*](https://docs.docker.com/get-started/part3/). +usage: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG] +pname: docker +plink: docker.yaml +examples: |- + ### Tag an image referenced by ID + + To tag a local image with ID "0e5574283393" into the "fedora" repository with + "version1.0": + + ```bash + $ docker tag 0e5574283393 fedora/httpd:version1.0 + ``` + + ### Tag an image referenced by Name + + To tag a local image with name "httpd" into the "fedora" repository with + "version1.0": + + ```bash + $ docker tag httpd fedora/httpd:version1.0 + ``` + + Note that since the tag name is not specified, the alias is created for an + existing local version `httpd:latest`. + + ### Tag an image referenced by Name and Tag + + To tag a local image with name "httpd" and tag "test" into the "fedora" + repository with "version1.0.test": + + ```bash + $ docker tag httpd:test fedora/httpd:version1.0.test + ``` + + ### Tag an image for a private repository + + To push an image to a private registry and not the central Docker + registry you must tag it with the registry hostname and port (if needed). + + ```bash + $ docker tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_top.yaml b/_data/engine-cli/docker_top.yaml new file mode 100644 index 0000000..100de43 --- /dev/null +++ b/_data/engine-cli/docker_top.yaml @@ -0,0 +1,12 @@ +command: docker top +short: Display the running processes of a container +long: Display the running processes of a container +usage: docker top CONTAINER [ps OPTIONS] +pname: docker +plink: docker.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust.yaml b/_data/engine-cli/docker_trust.yaml new file mode 100644 index 0000000..d3219d7 --- /dev/null +++ b/_data/engine-cli/docker_trust.yaml @@ -0,0 +1,24 @@ +command: docker trust +short: Manage trust on Docker images +long: Manage trust on Docker images +usage: docker trust +pname: docker +plink: docker.yaml +cname: +- docker trust inspect +- docker trust key +- docker trust revoke +- docker trust sign +- docker trust signer +clink: +- docker_trust_inspect.yaml +- docker_trust_key.yaml +- docker_trust_revoke.yaml +- docker_trust_sign.yaml +- docker_trust_signer.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_inspect.yaml b/_data/engine-cli/docker_trust_inspect.yaml new file mode 100644 index 0000000..8f9091c --- /dev/null +++ b/_data/engine-cli/docker_trust_inspect.yaml @@ -0,0 +1,490 @@ +command: docker trust inspect +short: Return low-level information about keys and signatures +long: |- + `docker trust inspect` provides low-level JSON information on signed repositories. + This includes all image tags that are signed, who signed them, and who can sign + new tags. +usage: docker trust inspect IMAGE[:TAG] [IMAGE[:TAG]...] +pname: docker trust +plink: docker_trust.yaml +options: +- option: pretty + value_type: bool + default_value: "false" + description: Print the information in a human friendly format + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Get low-level details about signatures for a single image tag + + Use the `docker trust inspect` to get trust information about an image. The + following example prints trust information for the `alpine:latest` image: + + ```bash + $ docker trust inspect alpine:latest + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "Name": "alpine:latest", + "SignedTags": [ + { + "SignedTag": "latest", + "Digest": "d6bfc3baf615dc9618209a8d607ba2a8103d9c8a405b3bd8741d88b4bef36478", + "Signers": [ + "Repo Admin" + ] + } + ], + "Signers": [], + "AdministrativeKeys": [ + { + "Name": "Repository", + "Keys": [ + { + "ID": "5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd" + } + ] + }, + { + "Name": "Root", + "Keys": [ + { + "ID": "a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce" + } + ] + } + ] + } + ] + ``` + + The `SignedTags` key will list the `SignedTag` name, its `Digest`, + and the `Signers` responsible for the signature. + + `AdministrativeKeys` will list the `Repository` and `Root` keys. + + If signers are set up for the repository via other `docker trust` + commands, `docker trust inspect` includes a `Signers` key: + + ```bash + $ docker trust inspect my-image:purple + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "Name": "my-image:purple", + "SignedTags": [ + { + "SignedTag": "purple", + "Digest": "941d3dba358621ce3c41ef67b47cf80f701ff80cdf46b5cc86587eaebfe45557", + "Signers": [ + "alice", + "bob", + "carol" + ] + } + ], + "Signers": [ + { + "Name": "alice", + "Keys": [ + { + "ID": "04dd031411ed671ae1e12f47ddc8646d98f135090b01e54c3561e843084484a3" + }, + { + "ID": "6a11e4898a4014d400332ab0e096308c844584ff70943cdd1d6628d577f45fd8" + } + ] + }, + { + "Name": "bob", + "Keys": [ + { + "ID": "433e245c656ae9733cdcc504bfa560f90950104442c4528c9616daa45824ccba" + } + ] + }, + { + "Name": "carol", + "Keys": [ + { + "ID": "d32fa8b5ca08273a2880f455fcb318da3dc80aeae1a30610815140deef8f30d9" + }, + { + "ID": "9a8bbec6ba2af88a5fad6047d428d17e6d05dbdd03d15b4fc8a9a0e8049cd606" + } + ] + } + ], + "AdministrativeKeys": [ + { + "Name": "Repository", + "Keys": [ + { + "ID": "27df2c8187e7543345c2e0bf3a1262e0bc63a72754e9a7395eac3f747ec23a44" + } + ] + }, + { + "Name": "Root", + "Keys": [ + { + "ID": "40b66ccc8b176be8c7d365a17f3e046d1c3494e053dd57cfeacfe2e19c4f8e8f" + } + ] + } + ] + } + ] + ``` + + If the image tag is unsigned or unavailable, `docker trust inspect` does not + display any signed tags. + + ```bash + $ docker trust inspect unsigned-img + + No signatures or cannot access unsigned-img + ``` + + However, if other tags are signed in the same image repository, + `docker trust inspect` reports relevant key information: + + ```bash + $ docker trust inspect alpine:unsigned + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "Name": "alpine:unsigned", + "Signers": [], + "AdministrativeKeys": [ + { + "Name": "Repository", + "Keys": [ + { + "ID": "5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd" + } + ] + }, + { + "Name": "Root", + "Keys": [ + { + "ID": "a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce" + } + ] + } + ] + } + ] + ``` + + ### Get details about signatures for all image tags in a repository + + If no tag is specified, `docker trust inspect` will report details for all + signed tags in the repository: + + ```bash + $ docker trust inspect alpine + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "Name": "alpine", + "SignedTags": [ + { + "SignedTag": "3.5", + "Digest": "b007a354427e1880de9cdba533e8e57382b7f2853a68a478a17d447b302c219c", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "3.6", + "Digest": "d6bfc3baf615dc9618209a8d607ba2a8103d9c8a405b3bd8741d88b4bef36478", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "edge", + "Digest": "23e7d843e63a3eee29b6b8cfcd10e23dd1ef28f47251a985606a31040bf8e096", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "latest", + "Digest": "d6bfc3baf615dc9618209a8d607ba2a8103d9c8a405b3bd8741d88b4bef36478", + "Signers": [ + "Repo Admin" + ] + } + ], + "Signers": [], + "AdministrativeKeys": [ + { + "Name": "Repository", + "Keys": [ + { + "ID": "5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd" + } + ] + }, + { + "Name": "Root", + "Keys": [ + { + "ID": "a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce" + } + ] + } + ] + } + ] + ``` + + + ### Get details about signatures for multiple images + + `docker trust inspect` can take multiple repositories and images as arguments, + and reports the results in an ordered list: + + ```bash + $ docker trust inspect alpine notary + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "Name": "alpine", + "SignedTags": [ + { + "SignedTag": "3.5", + "Digest": "b007a354427e1880de9cdba533e8e57382b7f2853a68a478a17d447b302c219c", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "3.6", + "Digest": "d6bfc3baf615dc9618209a8d607ba2a8103d9c8a405b3bd8741d88b4bef36478", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "edge", + "Digest": "23e7d843e63a3eee29b6b8cfcd10e23dd1ef28f47251a985606a31040bf8e096", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "integ-test-base", + "Digest": "3952dc48dcc4136ccdde37fbef7e250346538a55a0366e3fccc683336377e372", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "latest", + "Digest": "d6bfc3baf615dc9618209a8d607ba2a8103d9c8a405b3bd8741d88b4bef36478", + "Signers": [ + "Repo Admin" + ] + } + ], + "Signers": [], + "AdministrativeKeys": [ + { + "Name": "Repository", + "Keys": [ + { + "ID": "5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd" + } + ] + }, + { + "Name": "Root", + "Keys": [ + { + "ID": "a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce" + } + ] + } + ] + }, + { + "Name": "notary", + "SignedTags": [ + { + "SignedTag": "server", + "Digest": "71f64ab718a3331dee103bc5afc6bc492914738ce37c2d2f127a8133714ecf5c", + "Signers": [ + "Repo Admin" + ] + }, + { + "SignedTag": "signer", + "Digest": "a6122d79b1e74f70b5dd933b18a6d1f99329a4728011079f06b245205f158fe8", + "Signers": [ + "Repo Admin" + ] + } + ], + "Signers": [], + "AdministrativeKeys": [ + { + "Name": "Root", + "Keys": [ + { + "ID": "8cdcdef5bd039f4ab5a029126951b5985eebf57cabdcdc4d21f5b3be8bb4ce92" + } + ] + }, + { + "Name": "Repository", + "Keys": [ + { + "ID": "85bfd031017722f950d480a721f845a2944db26a3dc084040a70f1b0d9bbb3df" + } + ] + } + ] + } + ] + ``` + + ### Formatting + + You can print the inspect output in a human-readable format instead of the default + JSON output, by using the `--pretty` option: + + ### Get details about signatures for a single image tag + + ```bash + $ docker trust inspect --pretty alpine:latest + + SIGNED TAG DIGEST SIGNERS + latest 1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe (Repo Admin) + + Administrative keys for alpine:latest: + Repository Key: 5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd + Root Key: a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce + ``` + + The `SIGNED TAG` is the signed image tag with a unique content-addressable + `DIGEST`. `SIGNERS` lists all entities who have signed. + + The administrative keys listed specify the root key of trust, as well as + the administrative repository key. These keys are responsible for modifying + signers, and rotating keys for the signed repository. + + If signers are set up for the repository via other `docker trust` commands, + `docker trust inspect --pretty` displays them appropriately as a `SIGNER` + and specify their `KEYS`: + + ```bash + $ docker trust inspect --pretty my-image:purple + + SIGNED TAG DIGEST SIGNERS + purple 941d3dba358621ce3c41ef67b47cf80f701ff80cdf46b5cc86587eaebfe45557 alice, bob, carol + + List of signers and their keys: + + SIGNER KEYS + alice 47caae5b3e61, a85aab9d20a4 + bob 034370bcbd77, 82a66673242c + carol b6f9f8e1aab0 + + Administrative keys for my-image: + Repository Key: 27df2c8187e7543345c2e0bf3a1262e0bc63a72754e9a7395eac3f747ec23a44 + Root Key: 40b66ccc8b176be8c7d365a17f3e046d1c3494e053dd57cfeacfe2e19c4f8e8f + ``` + + However, if other tags are signed in the same image repository, + `docker trust inspect` reports relevant key information. + + ```bash + $ docker trust inspect --pretty alpine:unsigned + + No signatures for alpine:unsigned + + + Administrative keys for alpine:unsigned: + Repository Key: 5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd + Root Key: a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce + ``` + + ### Get details about signatures for all image tags in a repository + + ```bash + $ docker trust inspect --pretty alpine + + SIGNED TAG DIGEST SIGNERS + 2.6 9ace551613070689a12857d62c30ef0daa9a376107ec0fff0e34786cedb3399b (Repo Admin) + 2.7 9f08005dff552038f0ad2f46b8e65ff3d25641747d3912e3ea8da6785046561a (Repo Admin) + 3.1 d9477888b78e8c6392e0be8b2e73f8c67e2894ff9d4b8e467d1488fcceec21c8 (Repo Admin) + 3.2 19826d59171c2eb7e90ce52bfd822993bef6a6fe3ae6bb4a49f8c1d0a01e99c7 (Repo Admin) + 3.3 8fd4b76819e1e5baac82bd0a3d03abfe3906e034cc5ee32100d12aaaf3956dc7 (Repo Admin) + 3.4 833ad81ace8277324f3ca8c91c02bdcf1d13988d8ecf8a3f97ecdd69d0390ce9 (Repo Admin) + 3.5 af2a5bd2f8de8fc1ecabf1c76611cdc6a5f1ada1a2bdd7d3816e121b70300308 (Repo Admin) + 3.6 1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe (Repo Admin) + edge 79d50d15bd7ea48ea00cf3dd343b0e740c1afaa8e899bee475236ef338e1b53b (Repo Admin) + latest 1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe (Repo Admin) + + Administrative keys for alpine: + Repository Key: 5a46c9aaa82ff150bb7305a2d17d0c521c2d784246807b2dc611f436a69041fd + Root Key: a2489bcac7a79aa67b19b96c4a3bf0c675ffdf00c6d2fabe1a5df1115e80adce + ``` + + Here's an example with signers that are set up by `docker trust` commands: + + ```bash + $ docker trust inspect --pretty my-image + + SIGNED TAG DIGEST SIGNERS + red 852cc04935f930a857b630edc4ed6131e91b22073bcc216698842e44f64d2943 alice + blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob + green cae8fedc840f90c8057e1c24637d11865743ab1e61a972c1c9da06ec2de9a139 alice, bob + yellow 9cc65fc3126790e683d1b92f307a71f48f75fa7dd47a7b03145a123eaf0b45ba carol + purple 941d3dba358621ce3c41ef67b47cf80f701ff80cdf46b5cc86587eaebfe45557 alice, bob, carol + orange d6c271baa6d271bcc24ef1cbd65abf39123c17d2e83455bdab545a1a9093fc1c alice + + List of signers and their keys for my-image: + + SIGNER KEYS + alice 47caae5b3e61, a85aab9d20a4 + bob 034370bcbd77, 82a66673242c + carol b6f9f8e1aab0 + + Administrative keys for my-image: + Repository Key: 27df2c8187e7543345c2e0bf3a1262e0bc63a72754e9a7395eac3f747ec23a44 + Root Key: 40b66ccc8b176be8c7d365a17f3e046d1c3494e053dd57cfeacfe2e19c4f8e8f + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_key.yaml b/_data/engine-cli/docker_trust_key.yaml new file mode 100644 index 0000000..c6bee2f --- /dev/null +++ b/_data/engine-cli/docker_trust_key.yaml @@ -0,0 +1,18 @@ +command: docker trust key +short: Manage keys for signing Docker images +long: Manage keys for signing Docker images +usage: docker trust key +pname: docker trust +plink: docker_trust.yaml +cname: +- docker trust key generate +- docker trust key load +clink: +- docker_trust_key_generate.yaml +- docker_trust_key_load.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_key_generate.yaml b/_data/engine-cli/docker_trust_key_generate.yaml new file mode 100644 index 0000000..e65d29a --- /dev/null +++ b/_data/engine-cli/docker_trust_key_generate.yaml @@ -0,0 +1,55 @@ +command: docker trust key generate +short: Generate and load a signing key-pair +long: |- + `docker trust key generate` generates a key-pair to be used with signing, + and loads the private key into the local docker trust keystore. +usage: docker trust key generate NAME +pname: docker trust key +plink: docker_trust_key.yaml +options: +- option: dir + value_type: string + description: Directory to generate key in, defaults to current directory + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Generate a key-pair + + ```bash + $ docker trust key generate alice + + Generating key for alice... + Enter passphrase for new alice key with ID 17acf3c: + Repeat passphrase for new alice key with ID 17acf3c: + Successfully generated and loaded private key. Corresponding public key available: alice.pub + $ ls + alice.pub + ``` + + The private signing key is encrypted by the passphrase and loaded into the docker trust keystore. + All passphrase requests to sign with the key will be referred to by the provided `NAME`. + + The public key component `alice.pub` will be available in the current working directory, and can + be used directly by `docker trust signer add`. + + Provide the `--dir` argument to specify a directory to generate the key in: + + ```bash + $ docker trust key generate alice --dir /foo + + Generating key for alice... + Enter passphrase for new alice key with ID 17acf3c: + Repeat passphrase for new alice key with ID 17acf3c: + Successfully generated and loaded private key. Corresponding public key available: alice.pub + $ ls /foo + alice.pub + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_key_load.yaml b/_data/engine-cli/docker_trust_key_load.yaml new file mode 100644 index 0000000..b5efd44 --- /dev/null +++ b/_data/engine-cli/docker_trust_key_load.yaml @@ -0,0 +1,49 @@ +command: docker trust key load +short: Load a private key file for signing +long: |- + `docker trust key load` adds private keys to the local docker trust keystore. + + To add a signer to a repository use `docker trust signer add`. +usage: docker trust key load [OPTIONS] KEYFILE +pname: docker trust key +plink: docker_trust_key.yaml +options: +- option: name + value_type: string + default_value: signer + description: Name for the loaded key + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Load a single private key + + For a private key `alice.pem` with permissions `-rw-------` + + ```bash + $ docker trust key load alice.pem + + Loading key from "alice.pem"... + Enter passphrase for new signer key with ID f8097df: + Repeat passphrase for new signer key with ID f8097df: + Successfully imported key from alice.pem + ``` + + To specify a name use the `--name` flag: + + ```bash + $ docker trust key load --name alice-key alice.pem + + Loading key from "alice.pem"... + Enter passphrase for new alice-key key with ID f8097df: + Repeat passphrase for new alice-key key with ID f8097df: + Successfully imported key from alice.pem + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_revoke.yaml b/_data/engine-cli/docker_trust_revoke.yaml new file mode 100644 index 0000000..c28b7ab --- /dev/null +++ b/_data/engine-cli/docker_trust_revoke.yaml @@ -0,0 +1,120 @@ +command: docker trust revoke +short: Remove trust for an image +long: '`docker trust revoke` removes signatures from tags in signed repositories.' +usage: docker trust revoke [OPTIONS] IMAGE[:TAG] +pname: docker trust +plink: docker_trust.yaml +options: +- option: "yes" + shorthand: "y" + value_type: bool + default_value: "false" + description: Do not prompt for confirmation + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Revoke signatures from a signed tag + + Here's an example of a repo with two signed tags: + + + ```bash + $ docker trust inspect --pretty example/trust-demo + SIGNED TAG DIGEST SIGNERS + red 852cc04935f930a857b630edc4ed6131e91b22073bcc216698842e44f64d2943 alice + blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + When `alice`, one of the signers, runs `docker trust revoke`: + + ```bash + $ docker trust revoke example/trust-demo:red + Enter passphrase for delegation key with ID 27d42a8: + Successfully deleted signature for example/trust-demo:red + ``` + + After revocation, the tag is removed from the list of released tags: + + ```bash + $ docker trust inspect --pretty example/trust-demo + SIGNED TAG DIGEST SIGNERS + blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + ### Revoke signatures on all tags in a repository + + When no tag is specified, `docker trust` revokes all signatures that you have a signing key for. + + ```bash + $ docker trust inspect --pretty example/trust-demo + SIGNED TAG DIGEST SIGNERS + red 852cc04935f930a857b630edc4ed6131e91b22073bcc216698842e44f64d2943 alice + blue f1c38dbaeeb473c36716f6494d803fbfbe9d8a76916f7c0093f227821e378197 alice, bob + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + When `alice`, one of the signers, runs `docker trust revoke`: + + ```bash + $ docker trust revoke example/trust-demo + Please confirm you would like to delete all signature data for example/trust-demo? [y/N] y + Enter passphrase for delegation key with ID 27d42a8: + Successfully deleted signature for example/trust-demo + ``` + + All tags that have `alice`'s signature on them are removed from the list of released tags: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_sign.yaml b/_data/engine-cli/docker_trust_sign.yaml new file mode 100644 index 0000000..ce6e41b --- /dev/null +++ b/_data/engine-cli/docker_trust_sign.yaml @@ -0,0 +1,129 @@ +command: docker trust sign +short: Sign an image +long: '`docker trust sign` adds signatures to tags to create signed repositories.' +usage: docker trust sign IMAGE:TAG +pname: docker trust +plink: docker_trust.yaml +options: +- option: local + value_type: bool + default_value: "false" + description: Sign a locally tagged image + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Sign a tag as a repo admin + + Given an image: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + SIGNED TAG DIGEST SIGNERS + v1 c24134c079c35e698060beabe110bb83ab285d0d978de7d92fed2c8c83570a41 (Repo Admin) + + Administrative keys for example/trust-demo: + Repository Key: 36d4c3601102fa7c5712a343c03b94469e5835fb27c191b529c06fd19c14a942 + Root Key: 246d360f7c53a9021ee7d4259e3c5692f3f1f7ad4737b1ea8c7b8da741ad980b + ``` + + Sign a new tag with `docker trust sign`: + + ```bash + $ docker trust sign example/trust-demo:v2 + + Signing and pushing trust metadata for example/trust-demo:v2 + The push refers to a repository [docker.io/example/trust-demo] + eed4e566104a: Layer already exists + 77edfb6d1e3c: Layer already exists + c69f806905c2: Layer already exists + 582f327616f1: Layer already exists + a3fbb648f0bd: Layer already exists + 5eac2de68a97: Layer already exists + 8d4d1ab5ff74: Layer already exists + v2: digest: sha256:8f6f460abf0436922df7eb06d28b3cdf733d2cac1a185456c26debbff0839c56 size: 1787 + Signing and pushing trust metadata + Enter passphrase for repository key with ID 36d4c36: + Successfully signed docker.io/example/trust-demo:v2 + ``` + + Use `docker trust inspect --pretty` to list the new signature: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + SIGNED TAG DIGEST SIGNERS + v1 c24134c079c35e698060beabe110bb83ab285d0d978de7d92fed2c8c83570a41 (Repo Admin) + v2 8f6f460abf0436922df7eb06d28b3cdf733d2cac1a185456c26debbff0839c56 (Repo Admin) + + Administrative keys for example/trust-demo: + Repository Key: 36d4c3601102fa7c5712a343c03b94469e5835fb27c191b529c06fd19c14a942 + Root Key: 246d360f7c53a9021ee7d4259e3c5692f3f1f7ad4737b1ea8c7b8da741ad980b + ``` + + ### Sign a tag as a signer + + Given an image: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + Sign a new tag with `docker trust sign`: + + ```bash + $ docker trust sign example/trust-demo:v1 + + Signing and pushing trust metadata for example/trust-demo:v1 + The push refers to a repository [docker.io/example/trust-demo] + 26b126eb8632: Layer already exists + 220d34b5f6c9: Layer already exists + 8a5132998025: Layer already exists + aca233ed29c3: Layer already exists + e5d2f035d7a4: Layer already exists + v1: digest: sha256:74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 size: 1357 + Signing and pushing trust metadata + Enter passphrase for delegation key with ID 27d42a8: + Successfully signed docker.io/example/trust-demo:v1 + ``` + + `docker trust inspect --pretty` lists the new signature: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + SIGNED TAG DIGEST SIGNERS + v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 alice + + List of signers and their keys for example/trust-demo: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_signer.yaml b/_data/engine-cli/docker_trust_signer.yaml new file mode 100644 index 0000000..b279973 --- /dev/null +++ b/_data/engine-cli/docker_trust_signer.yaml @@ -0,0 +1,18 @@ +command: docker trust signer +short: Manage entities who can sign Docker images +long: Manage entities who can sign Docker images +usage: docker trust signer +pname: docker trust +plink: docker_trust.yaml +cname: +- docker trust signer add +- docker trust signer remove +clink: +- docker_trust_signer_add.yaml +- docker_trust_signer_remove.yaml +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_signer_add.yaml b/_data/engine-cli/docker_trust_signer_add.yaml new file mode 100644 index 0000000..f523571 --- /dev/null +++ b/_data/engine-cli/docker_trust_signer_add.yaml @@ -0,0 +1,69 @@ +command: docker trust signer add +short: Add a signer +long: '`docker trust signer add` adds signers to signed repositories.' +usage: 'docker trust signer add OPTIONS NAME REPOSITORY [REPOSITORY...] ' +pname: docker trust signer +plink: docker_trust_signer.yaml +options: +- option: key + value_type: list + description: Path to the signer's public key file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Add a signer to a repo + + To add a new signer, `alice`, to this repository: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys: + + SIGNER KEYS + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: 642692c14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + Add `alice` with `docker trust signer add`: + + ```bash + $ docker trust signer add alice example/trust-demo --key alice.crt + Adding signer "alice" to example/trust-demo... + Enter passphrase for repository key with ID 642692c: + Successfully added signer: alice to example/trust-demo + ``` + + `docker trust inspect --pretty` now lists `alice` as a valid signer: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: 642692c14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_trust_signer_remove.yaml b/_data/engine-cli/docker_trust_signer_remove.yaml new file mode 100644 index 0000000..abace4d --- /dev/null +++ b/_data/engine-cli/docker_trust_signer_remove.yaml @@ -0,0 +1,176 @@ +command: docker trust signer remove +short: Remove a signer +long: '`docker trust signer remove` removes signers from signed repositories.' +usage: docker trust signer remove [OPTIONS] NAME REPOSITORY [REPOSITORY...] +pname: docker trust signer +plink: docker_trust_signer.yaml +options: +- option: force + shorthand: f + value_type: bool + default_value: "false" + description: | + Do not prompt for confirmation before removing the most recent signer + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Remove a signer from a repo + + To remove an existing signer, `alice`, from this repository: + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + Remove `alice` with `docker trust signer remove`: + + ```bash + $ docker trust signer remove alice example/trust-demo + + Removing signer "alice" from image example/trust-demo... + Enter passphrase for repository key with ID 642692c: + Successfully removed alice from example/trust-demo + ``` + + `docker trust inspect --pretty` now does not list `alice` as a valid signer: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + No signatures for example/trust-demo + + + List of signers and their keys: + + SIGNER KEYS + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + ### Remove a signer from multiple repos + + To remove an existing signer, `alice`, from multiple repositories: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + SIGNED TAG DIGEST SIGNERS + v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 alice, bob + + List of signers and their keys: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: 95b9e5514c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + ```bash + $ docker trust inspect --pretty example/trust-demo2 + + SIGNED TAG DIGEST SIGNERS + v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 alice, bob + + List of signers and their keys: + + SIGNER KEYS + alice 05e87edcaecb + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo2: + Repository Key: ece554f14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4553d2ab20a8d9268 + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + Remove `alice` from both images with a single `docker trust signer remove` command: + + ```bash + $ docker trust signer remove alice example/trust-demo example/trust-demo2 + + Removing signer "alice" from image example/trust-demo... + Enter passphrase for repository key with ID 95b9e55: + Successfully removed alice from example/trust-demo + + Removing signer "alice" from image example/trust-demo2... + Enter passphrase for repository key with ID ece554f: + Successfully removed alice from example/trust-demo2 + ``` + + Run `docker trust inspect --pretty` to confirm that `alice` is no longer listed as a valid + signer of either `example/trust-demo` or `example/trust-demo2`: + + ```bash + $ docker trust inspect --pretty example/trust-demo + + SIGNED TAG DIGEST SIGNERS + v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob + + List of signers and their keys: + + SIGNER KEYS + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo: + Repository Key: ecc457614c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4555b3c6ab02f71e + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + ```bash + $ docker trust inspect --pretty example/trust-demo2 + + SIGNED TAG DIGEST SIGNERS + v1 74d4bfa917d55d53c7df3d2ab20a8d926874d61c3da5ef6de15dd2654fc467c4 bob + + List of signers and their keys: + + SIGNER KEYS + bob 5600f5ab76a2 + + Administrative keys for example/trust-demo2: + Repository Key: ece554f14c9fc399da523a5f4e24fe306a0a6ee1cc79a10e4553d2ab20a8d9268 + Root Key: 3cb2228f6561e58f46dbc4cda4fcaff9d5ef22e865a94636f82450d1d2234949 + ``` + + `docker trust signer remove` removes signers to repositories on a best effort + basis, so it will continue to remove the signer from subsequent repositories if + one attempt fails: + + ```bash + $ docker trust signer remove alice example/unauthorized example/authorized + + Removing signer "alice" from image example/unauthorized... + No signer alice for image example/unauthorized + + Removing signer "alice" from image example/authorized... + Enter passphrase for repository key with ID c6772a0: + Successfully removed alice from example/authorized + + Error removing signer from: example/unauthorized + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_unpause.yaml b/_data/engine-cli/docker_unpause.yaml new file mode 100644 index 0000000..a1221d2 --- /dev/null +++ b/_data/engine-cli/docker_unpause.yaml @@ -0,0 +1,23 @@ +command: docker unpause +short: Unpause all processes within one or more containers +long: |- + The `docker unpause` command un-suspends all processes in the specified containers. + On Linux, it does this using the freezer cgroup. + + See the + [freezer cgroup documentation](https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) + for further details. +usage: docker unpause CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +examples: |- + ```bash + $ docker unpause my_container + my_container + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_update.yaml b/_data/engine-cli/docker_update.yaml new file mode 100644 index 0000000..a76196a --- /dev/null +++ b/_data/engine-cli/docker_update.yaml @@ -0,0 +1,237 @@ +command: docker update +short: Update configuration of one or more containers +long: |- + The `docker update` command dynamically updates container configuration. + You can use this command to prevent containers from consuming too many + resources from their Docker host. With a single command, you can place + limits on a single container or on many. To specify more than one container, + provide space-separated list of container names or IDs. + + With the exception of the `--kernel-memory` option, you can specify these + options on a running or a stopped container. On kernel version older than + 4.6, you can only update `--kernel-memory` on a stopped container or on + a running container with kernel memory initialized. + + > **Warning** + > + > The `docker update` and `docker container update` commands are not supported + > for Windows containers. + {: .warning } +usage: docker update [OPTIONS] CONTAINER [CONTAINER...] +pname: docker +plink: docker.yaml +options: +- option: blkio-weight + value_type: uint16 + default_value: "0" + description: | + Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-period + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) period + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-quota + value_type: int64 + default_value: "0" + description: Limit CPU CFS (Completely Fair Scheduler) quota + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-period + value_type: int64 + default_value: "0" + description: Limit the CPU real-time period in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-rt-runtime + value_type: int64 + default_value: "0" + description: Limit the CPU real-time runtime in microseconds + deprecated: false + min_api_version: "1.25" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpu-shares + shorthand: c + value_type: int64 + default_value: "0" + description: CPU shares (relative weight) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpus + value_type: decimal + description: Number of CPUs + deprecated: false + min_api_version: "1.29" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-cpus + value_type: string + description: CPUs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: cpuset-mems + value_type: string + description: MEMs in which to allow execution (0-3, 0,1) + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kernel-memory + value_type: bytes + default_value: "0" + description: Kernel memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory + shorthand: m + value_type: bytes + default_value: "0" + description: Memory limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-reservation + value_type: bytes + default_value: "0" + description: Memory soft limit + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: memory-swap + value_type: bytes + default_value: "0" + description: | + Swap limit equal to memory plus swap: '-1' to enable unlimited swap + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: pids-limit + value_type: int64 + default_value: "0" + description: Tune container pids limit (set -1 for unlimited) + deprecated: false + min_api_version: "1.40" + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: restart + value_type: string + description: Restart policy to apply when a container exits + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + The following sections illustrate ways to use this command. + + ### Update a container's cpu-shares + + To limit a container's cpu-shares to 512, first identify the container + name or ID. You can use `docker ps` to find these values. You can also + use the ID returned from the `docker run` command. Then, do the following: + + ```bash + $ docker update --cpu-shares 512 abebf7571666 + ``` + + ### Update a container with cpu-shares and memory + + To update multiple resource configurations for multiple containers: + + ```bash + $ docker update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse + ``` + + ### Update a container's kernel memory constraints + + You can update a container's kernel memory limit using the `--kernel-memory` + option. On kernel version older than 4.6, this option can be updated on a + running container only if the container was started with `--kernel-memory`. + If the container was started *without* `--kernel-memory` you need to stop + the container before updating kernel memory. + + For example, if you started a container with this command: + + ```bash + $ docker run -dit --name test --kernel-memory 50M ubuntu bash + ``` + + You can update kernel memory while the container is running: + + ```bash + $ docker update --kernel-memory 80M test + ``` + + If you started a container *without* kernel memory initialized: + + ```bash + $ docker run -dit --name test2 --memory 300M ubuntu bash + ``` + + Update kernel memory of running container `test2` will fail. You need to stop + the container before updating the `--kernel-memory` setting. The next time you + start it, the container uses the new value. + + Kernel version newer than (include) 4.6 does not have this limitation, you + can use `--kernel-memory` the same way as other options. + + ### Update a container's restart policy + + You can change a container's restart policy on a running container. The new + restart policy takes effect instantly after you run `docker update` on a + container. + + To update restart policy for one or more containers: + + ```bash + $ docker update --restart=on-failure:3 abebf7571666 hopeful_morse + ``` + + Note that if the container is started with "--rm" flag, you cannot update the restart + policy for it. The `AutoRemove` and `RestartPolicy` are mutually exclusive for the + container. +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_version.yaml b/_data/engine-cli/docker_version.yaml new file mode 100644 index 0000000..de9aa0a --- /dev/null +++ b/_data/engine-cli/docker_version.yaml @@ -0,0 +1,85 @@ +command: docker version +short: Show the Docker version information +long: |- + By default, this will render all version information in an easy to read + layout. If a format is specified, the given template will be executed instead. + + Go's [text/template](http://golang.org/pkg/text/template/) package + describes all the details of the format. +usage: docker version [OPTIONS] +pname: docker +plink: docker.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: kubeconfig + value_type: string + description: Kubernetes config file + deprecated: false + experimental: false + experimentalcli: false + kubernetes: true + swarm: false +examples: |- + ### Default output + + ```bash + $ docker version + + Client: + Version: 19.03.8 + API version: 1.40 + Go version: go1.12.17 + Git commit: afacb8b + Built: Wed Mar 11 01:21:11 2020 + OS/Arch: darwin/amd64 + Experimental: true + + Server: + Engine: + Version: 19.03.8 + API version: 1.40 (minimum version 1.12) + Go version: go1.12.17 + Git commit: afacb8b + Built: Wed Mar 11 01:29:16 2020 + OS/Arch: linux/amd64 + Experimental: true + containerd: + Version: v1.2.13 + GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 + runc: + Version: 1.0.0-rc10 + GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd + docker-init: + Version: 0.18.0 + GitCommit: fec3683 + ``` + + ### Get the server version + + ```bash + $ docker version --format '{{.Server.Version}}' + + 19.03.8 + ``` + + ### Dump raw JSON data + + ```bash + $ docker version --format '{{json .}}' + + {"Client":{"Platform":{"Name":"Docker Engine - Community"},"Version":"19.03.8","ApiVersion":"1.40","DefaultAPIVersion":"1.40","GitCommit":"afacb8b","GoVersion":"go1.12.17","Os":"darwin","Arch":"amd64","BuildTime":"Wed Mar 11 01:21:11 2020","Experimental":true},"Server":{"Platform":{"Name":"Docker Engine - Community"},"Components":[{"Name":"Engine","Version":"19.03.8","Details":{"ApiVersion":"1.40","Arch":"amd64","BuildTime":"Wed Mar 11 01:29:16 2020","Experimental":"true","GitCommit":"afacb8b","GoVersion":"go1.12.17","KernelVersion":"4.19.76-linuxkit","MinAPIVersion":"1.12","Os":"linux"}},{"Name":"containerd","Version":"v1.2.13","Details":{"GitCommit":"7ad184331fa3e55e52b890ea95e65ba581ae3429"}},{"Name":"runc","Version":"1.0.0-rc10","Details":{"GitCommit":"dc9208a3303feef5b3839f4323d9beb36df0a9dd"}},{"Name":"docker-init","Version":"0.18.0","Details":{"GitCommit":"fec3683"}}],"Version":"19.03.8","ApiVersion":"1.40","MinAPIVersion":"1.12","GitCommit":"afacb8b","GoVersion":"go1.12.17","Os":"linux","Arch":"amd64","KernelVersion":"4.19.76-linuxkit","Experimental":true,"BuildTime":"2020-03-11T01:29:16.000000000+00:00"}} + ``` +deprecated: false +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_volume.yaml b/_data/engine-cli/docker_volume.yaml new file mode 100644 index 0000000..26aead5 --- /dev/null +++ b/_data/engine-cli/docker_volume.yaml @@ -0,0 +1,27 @@ +command: docker volume +short: Manage volumes +long: |- + Manage volumes. You can use subcommands to create, inspect, list, remove, or + prune volumes. +usage: docker volume COMMAND +pname: docker +plink: docker.yaml +cname: +- docker volume create +- docker volume inspect +- docker volume ls +- docker volume prune +- docker volume rm +clink: +- docker_volume_create.yaml +- docker_volume_inspect.yaml +- docker_volume_ls.yaml +- docker_volume_prune.yaml +- docker_volume_rm.yaml +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_volume_create.yaml b/_data/engine-cli/docker_volume_create.yaml new file mode 100644 index 0000000..76c1fae --- /dev/null +++ b/_data/engine-cli/docker_volume_create.yaml @@ -0,0 +1,134 @@ +command: docker volume create +short: Create a volume +long: |- + Creates a new volume that containers can consume and store data in. If a name is + not specified, Docker generates a random name. +usage: docker volume create [OPTIONS] [VOLUME] +pname: docker volume +plink: docker_volume.yaml +options: +- option: driver + shorthand: d + value_type: string + default_value: local + description: Specify volume driver name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: label + value_type: list + description: Set metadata for a volume + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: name + value_type: string + description: Specify volume name + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: opt + shorthand: o + value_type: map + default_value: map[] + description: Set driver specific options + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + Create a volume and then configure the container to use it: + + ```bash + $ docker volume create hello + + hello + + $ docker run -d -v hello:/world busybox ls /world + ``` + + The mount is created inside the container's `/world` directory. Docker does not + support relative paths for mount points inside the container. + + Multiple containers can use the same volume in the same time period. This is + useful if two containers need access to shared data. For example, if one + container writes and the other reads the data. + + Volume names must be unique among drivers. This means you cannot use the same + volume name with two different drivers. If you attempt this `docker` returns an + error: + + ```console + A volume named "hello" already exists with the "some-other" driver. Choose a different volume name. + ``` + + If you specify a volume name already in use on the current driver, Docker + assumes you want to re-use the existing volume and does not return an error. + + ### Driver-specific options + + Some volume drivers may take options to customize the volume creation. Use the + `-o` or `--opt` flags to pass driver options: + + ```bash + $ docker volume create --driver fake \ + --opt tardis=blue \ + --opt timey=wimey \ + foo + ``` + + These options are passed directly to the volume driver. Options for + different volume drivers may do different things (or nothing at all). + + The built-in `local` driver on Windows does not support any options. + + The built-in `local` driver on Linux accepts options similar to the linux + `mount` command. You can provide multiple options by passing the `--opt` flag + multiple times. Some `mount` options (such as the `o` option) can take a + comma-separated list of options. Complete list of available mount options can be + found [here](http://man7.org/linux/man-pages/man8/mount.8.html). + + For example, the following creates a `tmpfs` volume called `foo` with a size of + 100 megabyte and `uid` of 1000. + + ```bash + $ docker volume create --driver local \ + --opt type=tmpfs \ + --opt device=tmpfs \ + --opt o=size=100m,uid=1000 \ + foo + ``` + + Another example that uses `btrfs`: + + ```bash + $ docker volume create --driver local \ + --opt type=btrfs \ + --opt device=/dev/sda2 \ + foo + ``` + + Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from + `192.168.1.1`: + + ```bash + $ docker volume create --driver local \ + --opt type=nfs \ + --opt o=addr=192.168.1.1,rw \ + --opt device=:/path/to/dir \ + foo + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_volume_inspect.yaml b/_data/engine-cli/docker_volume_inspect.yaml new file mode 100644 index 0000000..c2d5f57 --- /dev/null +++ b/_data/engine-cli/docker_volume_inspect.yaml @@ -0,0 +1,64 @@ +command: docker volume inspect +short: Display detailed information on one or more volumes +long: |- + Returns information about a volume. By default, this command renders all results + in a JSON array. You can specify an alternate format to execute a + given template for each result. Go's + [text/template](http://golang.org/pkg/text/template/) package describes all the + details of the format. +usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...] +pname: docker volume +plink: docker_volume.yaml +options: +- option: format + shorthand: f + value_type: string + description: Format the output using the given Go template + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ```bash + $ docker volume create myvolume + + myvolume + ``` + + Use the `docker volume inspect` comment to inspect the configuration of the volume: + + ```bash + $ docker volume inspect myvolume + ``` + + The output is in JSON format, for example: + + ```json + [ + { + "CreatedAt": "2020-04-19T11:00:21Z", + "Driver": "local", + "Labels": {}, + "Mountpoint": "/var/lib/docker/volumes/8140a838303144125b4f54653b47ede0486282c623c3551fbc7f390cdc3e9cf5/_data", + "Name": "myvolume", + "Options": {}, + "Scope": "local" + } + ] + ``` + Use the `--format` flag to format the output using a Go template, for example, + to print the `Mountpoint` property: + + ```bash + $ docker volume inspect --format '{{ .Mountpoint }}' myvolume + + /var/lib/docker/volumes/myvolume/_data + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_volume_ls.yaml b/_data/engine-cli/docker_volume_ls.yaml new file mode 100644 index 0000000..f8e57b4 --- /dev/null +++ b/_data/engine-cli/docker_volume_ls.yaml @@ -0,0 +1,193 @@ +command: docker volume ls +aliases: list +short: List volumes +long: |- + List all the volumes known to Docker. You can filter using the `-f` or + `--filter` flag. Refer to the [filtering](#filtering) section for more + information about available filter options. +usage: docker volume ls [OPTIONS] +pname: docker volume +plink: docker_volume.yaml +options: +- option: filter + shorthand: f + value_type: filter + description: Provide filter values (e.g. 'dangling=true') + deprecated: false + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +- option: format + value_type: string + description: Pretty-print volumes using a Go template + deprecated: 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 + experimental: false + experimentalcli: false + kubernetes: false + swarm: false +examples: |- + ### Create a volume + ```bash + $ docker volume create rosemary + + rosemary + + $ docker volume create tyler + + tyler + + $ docker volume ls + + DRIVER VOLUME NAME + local rosemary + local tyler + ``` + + ### Filtering + + The filtering flag (`-f` or `--filter`) format is of "key=value". If there is more + than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) + + The currently supported filters are: + + - dangling (boolean - true or false, 0 or 1) + - driver (a volume driver's name) + - label (`label=` or `label==`) + - name (a volume's name) + + #### dangling + + The `dangling` filter matches on all volumes not referenced by any containers + + ```bash + $ docker run -d -v tyler:/tmpwork busybox + + f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18 + $ docker volume ls -f dangling=true + DRIVER VOLUME NAME + local rosemary + ``` + + #### driver + + The `driver` filter matches volumes based on their driver. + + The following example matches volumes that are created with the `local` driver: + + ```bash + $ docker volume ls -f driver=local + + DRIVER VOLUME NAME + local rosemary + local tyler + ``` + + #### label + + The `label` filter matches volumes based on the presence of a `label` alone or + a `label` and a value. + + First, let's create some volumes to illustrate this; + + ```bash + $ docker volume create the-doctor --label is-timelord=yes + + the-doctor + $ docker volume create daleks --label is-timelord=no + + daleks + ``` + + The following example filter matches volumes with the `is-timelord` label + regardless of its value. + + ```bash + $ docker volume ls --filter label=is-timelord + + DRIVER VOLUME NAME + local daleks + local the-doctor + ``` + + As the above example demonstrates, both volumes with `is-timelord=yes`, and + `is-timelord=no` are returned. + + Filtering on both `key` *and* `value` of the label, produces the expected result: + + ```bash + $ docker volume ls --filter label=is-timelord=yes + + DRIVER VOLUME NAME + local the-doctor + ``` + + Specifying multiple label filter produces an "and" search; all conditions + should be met; + + ```bash + $ docker volume ls --filter label=is-timelord=yes --filter label=is-timelord=no + + DRIVER VOLUME NAME + ``` + + #### name + + The `name` filter matches on all or part of a volume's name. + + The following filter matches all volumes with a name containing the `rose` string. + + ```bash + $ docker volume ls -f name=rose + + DRIVER VOLUME NAME + local rosemary + ``` + + ### Formatting + + The formatting options (`--format`) pretty-prints volumes output + using a Go template. + + Valid placeholders for the Go template are listed below: + + Placeholder | Description + --------------|------------------------------------------------------------------------------------------ + `.Name` | Volume name + `.Driver` | Volume driver + `.Scope` | Volume scope (local, global) + `.Mountpoint` | The mount point of the volume on the host + `.Labels` | All labels assigned to the volume + `.Label` | Value of a specific label for this volume. For example `{{.Label "project.version"}}` + + When using the `--format` option, the `volume ls` command will either + output the data exactly as the template declares or, when using the + `table` directive, includes column headers as well. + + The following example uses a template without headers and outputs the + `Name` and `Driver` entries separated by a colon (`:`) for all volumes: + + ```bash + $ docker volume ls --format "{{.Name}}: {{.Driver}}" + + vol1: local + vol2: local + vol3: local + ``` +deprecated: false +min_api_version: "1.21" +experimental: false +experimentalcli: false +kubernetes: false +swarm: false + diff --git a/_data/engine-cli/docker_volume_prune.yaml b/_data/engine-cli/docker_volume_prune.yaml new file mode 100644 index 0000000..1b1eabc --- /dev/null +++ b/_data/engine-cli/docker_volume_prune.yaml @@ -0,0 +1,45 @@ +command: docker volume prune +short: Remove all unused local volumes +long: Remove all unused local volumes. Unused local volumes are those which are not + referenced by any containers +usage: docker volume prune [OPTIONS] +pname: docker volume +plink: docker_volume.yaml +options: +- option: filter + value_type: filter + description: Provide filter values (e.g. 'label=